-
Notifications
You must be signed in to change notification settings - Fork 79
Expand file tree
/
Copy pathVagrantfile
More file actions
178 lines (147 loc) · 5.59 KB
/
Vagrantfile
File metadata and controls
178 lines (147 loc) · 5.59 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
Vagrant.configure("2") do |config|
config.vm.provider "virtualbox" do |vb|
vb.memory = 8192
vb.cpus = 2
end
# Regular debian testing box
config.vm.define "debian" do |debian|
debian.vm.box = "generic/debian12"
debian.vm.provision "file", source: "./", destination: "/home/vagrant/try"
debian.vm.provision "shell", privileged: false, inline: "
sudo apt-get update
sudo apt-get install -y git expect curl attr pandoc gcc make autoconf mergerfs
sudo chown -R vagrant:vagrant try
cd try
scripts/run_tests.sh
autoconf && ./configure && make
sudo make install
which try-commit || exit 2
scripts/run_tests.sh
"
end
# Regular debian testing box but we try the rustup oneliner
config.vm.define "debianrustup" do |debianrustup|
debianrustup.vm.box = "generic/debian12"
debianrustup.vm.provision "file", source: "./", destination: "/home/vagrant/try"
debianrustup.vm.provision "shell", privileged: false, inline: "
sudo apt-get update
sudo apt-get install -y curl attr pandoc gcc make autoconf mergerfs
sudo chown -R vagrant:vagrant try
cd try
mkdir rustup
./try -D rustup \"curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y\"
ls -lah rustup/upperdir/home/vagrant/.cargo/bin
rm -rf rustup
autoconf && ./configure && make
sudo make install
which try-commit || exit 2
mkdir rustup
./try -D rustup \"curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y\"
ls -lah rustup/upperdir/home/vagrant/.cargo/bin
"
end
# Regular debian testing box with LVM
config.vm.define "debianlvm" do |debianlvm|
debianlvm.vm.box = "generic/debian12"
debianlvm.vm.provision "file", source: "./", destination: "/home/vagrant/try"
debianlvm.vm.provision "shell", privileged: false, inline: "
sudo apt-get update
sudo apt-get install -y git expect lvm2 mergerfs curl attr pandoc gcc make autoconf mergerfs
# Create an image for the lvm disk
sudo fallocate -l 2G /root/lvm_disk.img
# Setup a loopback device
sudo losetup /dev/loop0 /root/lvm_disk.img
# Create the lv physicalvolume, volumegroup, and logicalvolumes
sudo pvcreate /dev/loop0
sudo vgcreate vg0 /dev/loop0
sudo lvcreate -n lv0 -l 50%FREE vg0
sudo lvcreate -n lv1 -l 100%FREE vg0
sudo mkfs.ext4 /dev/vg0/lv0
sudo mkfs.ext4 /dev/vg0/lv1
sudo mkdir /mnt/lv0
sudo mount /dev/vg0/lv0 /mnt/lv0
sudo mkdir /mnt/lv0/lv1
sudo mount /dev/vg0/lv1 /mnt/lv0/lv1
# This is intentional, if we moved try to lv1 it'd work since itself does not contain a nested mount
sudo mv /home/vagrant/try /mnt/lv0
sudo chown -R vagrant:vagrant /mnt/lv0/try
cd /mnt/lv0/try
scripts/run_tests.sh
autoconf && ./configure && make
sudo make install
which try-commit || exit 2
scripts/run_tests.sh
"
end
config.vm.define "debianloginshell" do |debianloginshell|
debianloginshell.vm.box = "generic/debian12"
debianloginshell.vm.provision "file", source: "./", destination: "/home/vagrant/try"
debianloginshell.vm.provision "shell", privileged: false, inline: <<-'SHELL'
sudo apt-get update
sudo apt-get install -y curl attr pandoc gcc make autoconf mergerfs zsh
sudo chown -R vagrant:vagrant try
cd try
autoconf && ./configure && make
sudo make install
which try-commit || exit 2
check_case() {
try_shell="$1"
shell="$2"
expected_output="$3"
case="$4"
TRY="/usr/local/bin/try"
expected="$(mktemp)"
out="$(mktemp)"
echo "$expected_output" >"$expected"
TRY_SHELL="$try_shell" SHELL="$shell" "$TRY" 'echo $TRY_SHELL' >"$out" || exit 1
if ! diff -q "$expected" "$out"; then
exit "$case"
fi
rm "$expected"
rm "$out"
}
username="$(whoami)"
sudo chsh "$username" --shell=/usr/bin/zsh
sudo chmod +x "/usr/bin/zsh"
check_case "" "" "/usr/bin/zsh" "3"
sudo chmod -x "/usr/bin/zsh"
check_case "" "" "/bin/sh" "4"
echo "Test Complete"
SHELL
end
# Regular rocky testing box
config.vm.define "rocky9" do |rocky|
rocky.vm.box = "generic/rocky9"
rocky.vm.provision "file", source: "./", destination: "/home/vagrant/try"
rocky.vm.provision "shell", privileged: false, inline: "
sudo yum install -y git expect curl attr pandoc fuse
wget https://github.com/trapexit/mergerfs/releases/download/2.40.2/mergerfs-2.40.2-1.el9.x86_64.rpm
sudo rpm -i mergerfs-2.40.2-1.el9.x86_64.rpm
sudo chown -R vagrant:vagrant try
cd try
TRY_TOP=$(pwd) scripts/run_tests.sh
autoconf && ./configure && make
sudo make install
which try-commit || exit 2
TRY_TOP=$(pwd) scripts/run_tests.sh
"
end
#
# Regular rocky testing box
config.vm.define "fedora39" do |fedora|
fedora.vm.box = "generic/fedora39"
fedora.vm.provision "file", source: "./", destination: "/home/vagrant/try"
fedora.vm.provision "shell", privileged: false, inline: "
sudo yum install -y git expect curl attr pandoc fuse
wget https://github.com/trapexit/mergerfs/releases/download/2.40.2/mergerfs-2.40.2-1.fc39.x86_64.rpm
sudo rpm -i mergerfs-2.40.2-1.fc39.x86_64.rpm
sudo chown -R vagrant:vagrant try
cd try
TRY_TOP=$(pwd) scripts/run_tests.sh
autoconf && ./configure && make
sudo make install
which try-commit || exit 2
TRY_TOP=$(pwd) scripts/run_tests.sh
"
end
end