-
Notifications
You must be signed in to change notification settings - Fork 17
/
Vagrantfile
69 lines (60 loc) · 1.88 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
########################################
### rpc-upgrades
###
### vagrantfile for testing rpc-upgrades
###
### usage: vagrant up <leapfrog_to_test>
########################################
# Verify whether required plugins are installed.
required_plugins = [ "vagrant-cachier", "vagrant-disksize" ]
required_plugins.each do |plugin|
if not Vagrant.has_plugin?(plugin)
raise "The vagrant plugin #{plugin} is required. Please run `vagrant plugin install #{plugin}`"
end
end
# Configure Job Actions the way gating would pass them
job_actions = [
"kilo_to_newton_leap",
"kilo_to_r14.23.0_leap",
"liberty_to_newton_leap",
"mitaka_to_newton_leap",
"r12.1.2_to_r14.23.0_leap",
"r12.2.2_to_r14.23.0_leap",
"r12.2.5_to_r14.23.0_leap",
"r12.2.8_to_r14.23.0_leap",
"newton_to_queens_inc",
"pike_to_queens_inc",
"queens_to_rocky_inc"
]
Vagrant.configure("2") do |config|
config.vm.provider "virtualbox" do |provider|
provider.memory = 16384
provider.cpus = 4
end
# Configure the box
config.vm.box = "ubuntu/trusty64"
config.vm.box_check_update = false
# Configure the disk size.
config.disksize.size = "100GB"
# Configure cache options
config.cache.scope = :box
### vagrant up job actions
job_actions.each do |job_action|
(upgrade_from, _, upgrade_to, upgrade_type) = job_action.split("_")
config.vm.define job_action do |job|
job.vm.hostname = upgrade_from.gsub(".", "-")
job.vm.provision "shell",
privileged: true,
inline: <<-SHELL
sudo su -
apt update
apt-get -y purge python-openssl python-urllib3 python-chardet
apt-get -y install git build-essential gcc libssl-dev libffi-dev python-dev
ln -s /vagrant /opt/rpc-upgrades
pushd /opt/rpc-upgrades
export RE_JOB_ACTION="#{job_action}"
./run-tests.sh
SHELL
end
end
end