Vagrantfile 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514
  1. # -*- mode: ruby -*-
  2. # vi: set ft=ruby :
  3. # Automated creation of testing environments / binaries on misc. platforms
  4. $cpus = Integer(ENV.fetch('VMCPUS', '4')) # create VMs with that many cpus
  5. $xdistn = Integer(ENV.fetch('XDISTN', '4')) # dispatch tests to that many pytest workers
  6. $wmem = $xdistn * 256 # give the VM additional memory for workers [MB]
  7. def packages_debianoid(user)
  8. return <<-EOF
  9. export DEBIAN_FRONTEND=noninteractive
  10. apt-get update
  11. # in case we get a grub update, it must not interactively ask for boot device:
  12. echo "set grub-pc/install_devices /dev/sda" | debconf-communicate
  13. # install all the (security and other) updates
  14. apt-get dist-upgrade -y
  15. # for building borgbackup and dependencies:
  16. apt-get install -y libssl-dev libacl1-dev liblz4-dev libfuse-dev fuse pkg-config
  17. usermod -a -G fuse #{user}
  18. chgrp fuse /dev/fuse
  19. chmod 666 /dev/fuse
  20. apt-get install -y fakeroot build-essential git curl
  21. apt-get install -y python3-dev python3-setuptools
  22. # for building python:
  23. apt-get install -y zlib1g-dev libbz2-dev libncurses5-dev libreadline-dev liblzma-dev libsqlite3-dev libffi-dev
  24. apt-get install -y python3-pip virtualenv python3-virtualenv
  25. EOF
  26. end
  27. def packages_redhatted
  28. return <<-EOF
  29. yum install -y epel-release
  30. yum update -y
  31. # for building borgbackup and dependencies:
  32. yum install -y openssl-devel openssl libacl-devel libacl lz4-devel fuse-devel fuse pkgconfig
  33. usermod -a -G fuse vagrant
  34. chgrp fuse /dev/fuse
  35. chmod 666 /dev/fuse
  36. yum install -y fakeroot gcc git patch
  37. # needed to compile msgpack-python (otherwise it will use slow fallback code):
  38. yum install -y gcc-c++
  39. # for building python:
  40. yum install -y zlib-devel bzip2-devel ncurses-devel readline-devel xz xz-devel sqlite-devel libffi-devel
  41. #yum install -y python-pip
  42. #pip install virtualenv
  43. EOF
  44. end
  45. def packages_darwin
  46. return <<-EOF
  47. # install all the (security and other) updates
  48. sudo softwareupdate --ignore iTunesX
  49. sudo softwareupdate --ignore iTunes
  50. sudo softwareupdate --ignore Safari
  51. sudo softwareupdate --ignore "Install macOS High Sierra"
  52. sudo softwareupdate --install --all
  53. which brew || CI=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
  54. brew update > /dev/null
  55. brew install pkg-config readline openssl@1.1 zstd lz4 xz fakeroot git
  56. brew install --cask osxfuse
  57. brew upgrade # upgrade everything
  58. echo 'export PKG_CONFIG_PATH=/usr/local/opt/openssl@1.1/lib/pkgconfig' >> ~vagrant/.bash_profile
  59. EOF
  60. end
  61. def packages_freebsd
  62. return <<-EOF
  63. # VM has no hostname set
  64. hostname freebsd
  65. # install all the (security and other) updates, base system
  66. freebsd-update --not-running-from-cron fetch install
  67. # for building borgbackup and dependencies:
  68. pkg install -y openssl liblz4 fusefs-libs pkgconf
  69. pkg install -y git bash
  70. # for building python:
  71. pkg install -y sqlite3 libffi
  72. # make bash default / work:
  73. chsh -s bash vagrant
  74. mount -t fdescfs fdesc /dev/fd
  75. echo 'fdesc /dev/fd fdescfs rw 0 0' >> /etc/fstab
  76. # make FUSE work
  77. echo 'fuse_load="YES"' >> /boot/loader.conf
  78. echo 'vfs.usermount=1' >> /etc/sysctl.conf
  79. kldload fuse
  80. sysctl vfs.usermount=1
  81. pw groupmod operator -M vagrant
  82. # /dev/fuse has group operator
  83. chmod 666 /dev/fuse
  84. # install all the (security and other) updates, packages
  85. pkg update
  86. yes | pkg upgrade
  87. EOF
  88. end
  89. def packages_openbsd
  90. return <<-EOF
  91. pkg_add bash
  92. chsh -s /usr/local/bin/bash vagrant
  93. pkg_add lz4
  94. pkg_add zstd
  95. pkg_add git # no fakeroot
  96. pkg_add py3-pip
  97. pkg_add py3-virtualenv
  98. ln -sf /usr/local/bin/virtualenv-3 /usr/local/bin/virtualenv
  99. EOF
  100. end
  101. def packages_netbsd
  102. return <<-EOF
  103. pkg_add zstd lz4 xxhash git
  104. sed -i 's/Version: /Version: 0.8.0/g' /usr/pkg/lib/pkgconfig/libxxhash.pc # bug in netbsd 9.2, version missing
  105. pkg_add bash
  106. chsh -s bash vagrant
  107. echo "export PROMPT_COMMAND=" >> ~vagrant/.bash_profile # bug in netbsd 9.2, .bash_profile broken for screen
  108. echo "export PROMPT_COMMAND=" >> ~root/.bash_profile # bug in netbsd 9.2, .bash_profile broken for screen
  109. pkg_add pkg-config
  110. # pkg_add fuse # llfuse supports netbsd, but is still buggy.
  111. # https://bitbucket.org/nikratio/python-llfuse/issues/70/perfuse_open-setsockopt-no-buffer-space
  112. pkg_add python38 py38-sqlite3 py38-pip py38-virtualenv
  113. ln -s /usr/pkg/bin/python3.8 /usr/pkg/bin/python
  114. ln -s /usr/pkg/bin/python3.8 /usr/pkg/bin/python3
  115. ln -s /usr/pkg/bin/pip3.8 /usr/pkg/bin/pip
  116. ln -s /usr/pkg/bin/pip3.8 /usr/pkg/bin/pip3
  117. ln -s /usr/pkg/bin/virtualenv-3.8 /usr/pkg/bin/virtualenv
  118. ln -s /usr/pkg/bin/virtualenv-3.8 /usr/pkg/bin/virtualenv3
  119. EOF
  120. end
  121. def packages_openindiana
  122. return <<-EOF
  123. # needs separate provisioning step + reboot:
  124. #pkg update
  125. # already installed:
  126. #pkg install python-37 python-35 virtualenv-35 pip-35 clang-40 lz4 zstd git
  127. pkg install gcc-7
  128. ln -sf /usr/bin/python3.5 /usr/bin/pyton3
  129. ln -sf /usr/bin/virtualenv-3.5 /usr/bin/virtualenv
  130. ln -sf /usr/bin/pip-3.5 /usr/bin/pip
  131. EOF
  132. end
  133. # Install required cygwin packages and configure environment
  134. #
  135. # Microsoft/EdgeOnWindows10 image has MLS-OpenSSH installed by default,
  136. # which is based on cygwin x86_64 but should not be used together with cygwin.
  137. # In order to have have cygwin compatible bash 'ImagePath' is replaced with
  138. # cygrunsrv of newly installed cygwin
  139. #
  140. # supported cygwin versions:
  141. # x86_64
  142. # x86
  143. def packages_cygwin(version)
  144. setup_exe = "setup-#{version}.exe"
  145. return <<-EOF
  146. mkdir -p /cygdrive/c/cygwin
  147. powershell -Command '$client = new-object System.Net.WebClient; $client.DownloadFile("https://www.cygwin.com/#{setup_exe}","C:\\cygwin\\#{setup_exe}")'
  148. echo '
  149. REM --- Change to use different CygWin platform and final install path
  150. set CYGSETUP=#{setup_exe}
  151. REM --- Install build version of CygWin in a subfolder
  152. set OURPATH=%cd%
  153. set CYGBUILD="C:\\cygwin\\CygWin"
  154. set CYGMIRROR=http://mirrors.kernel.org/sourceware/cygwin/
  155. set BASEPKGS=openssh,rsync
  156. set BUILDPKGS=python3,python3-setuptools,python-devel,binutils,gcc-g++,libopenssl,openssl-devel,git,make,liblz4-devel,liblz4_1,curl
  157. %CYGSETUP% -q -B -o -n -R %CYGBUILD% -L -D -s %CYGMIRROR% -P %BASEPKGS%,%BUILDPKGS%
  158. cd /d C:\\cygwin\\CygWin\\bin
  159. regtool set /HKLM/SYSTEM/CurrentControlSet/Services/OpenSSHd/ImagePath "C:\\cygwin\\CygWin\\bin\\cygrunsrv.exe"
  160. bash -c "ssh-host-config --no"
  161. bash -c "chown sshd_server /cygdrive/c/cygwin/CygWin/var/empty"
  162. ' > /cygdrive/c/cygwin/install.bat
  163. echo "alias mkdir='mkdir -p'" > ~/.profile
  164. echo "export CYGWIN_ROOT=/cygdrive/c/cygwin/CygWin" >> ~/.profile
  165. echo 'export PATH=$CYGWIN_ROOT/bin:$PATH' >> ~/.profile
  166. echo '' > ~/.bash_profile
  167. cmd.exe /c 'setx /m PATH "C:\\cygwin\\CygWin\\bin;%PATH%"'
  168. source ~/.profile
  169. cd /cygdrive/c/cygwin && cmd.exe /c install.bat
  170. echo 'db_home: windows' > $CYGWIN_ROOT/etc/nsswitch.conf
  171. EOF
  172. end
  173. def install_cygwin_venv
  174. return <<-EOF
  175. python3 -m ensurepip -U --default-pip
  176. pip install virtualenv
  177. EOF
  178. end
  179. def install_pyenv(boxname)
  180. script = <<-EOF
  181. curl -s -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash
  182. echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> ~/.bash_profile
  183. echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
  184. echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bash_profile
  185. echo 'export PYTHON_CONFIGURE_OPTS="--enable-shared"' >> ~/.bash_profile
  186. EOF
  187. return script
  188. end
  189. def fix_pyenv_darwin(boxname)
  190. return <<-EOF
  191. echo 'export PYTHON_CONFIGURE_OPTS="--enable-framework"' >> ~/.bash_profile
  192. EOF
  193. end
  194. def install_pythons(boxname)
  195. return <<-EOF
  196. . ~/.bash_profile
  197. pyenv install 3.5.3 # tests, 3.5.3 is first to support openssl 1.1
  198. pyenv install 3.6.2 # tests
  199. pyenv install 3.7.9 # binary build, use latest 3.7.x release
  200. pyenv install 3.8.0 # tests
  201. pyenv install 3.9.0 # tests
  202. pyenv rehash
  203. EOF
  204. end
  205. def build_sys_venv(boxname)
  206. return <<-EOF
  207. . ~/.bash_profile
  208. cd /vagrant/borg
  209. virtualenv --python=python3 borg-env
  210. EOF
  211. end
  212. def build_pyenv_venv(boxname)
  213. return <<-EOF
  214. . ~/.bash_profile
  215. cd /vagrant/borg
  216. # use the latest 3.7 release
  217. pyenv global 3.7.9
  218. pyenv virtualenv 3.7.9 borg-env
  219. ln -s ~/.pyenv/versions/borg-env .
  220. EOF
  221. end
  222. def install_borg(fuse)
  223. script = <<-EOF
  224. . ~/.bash_profile
  225. cd /vagrant/borg
  226. . borg-env/bin/activate
  227. pip install -U wheel # upgrade wheel, too old for 3.5
  228. cd borg
  229. pip install -r requirements.d/development.lock.txt
  230. python setup.py clean
  231. EOF
  232. if fuse
  233. script += <<-EOF
  234. # by using [fuse], setup.py can handle different FUSE requirements:
  235. pip install -e .[fuse]
  236. EOF
  237. else
  238. script += <<-EOF
  239. pip install -e .
  240. # do not install llfuse into the virtualenvs built by tox:
  241. sed -i.bak '/fuse.txt/d' tox.ini
  242. EOF
  243. end
  244. return script
  245. end
  246. def install_pyinstaller()
  247. return <<-EOF
  248. . ~/.bash_profile
  249. cd /vagrant/borg
  250. . borg-env/bin/activate
  251. git clone https://github.com/thomaswaldmann/pyinstaller.git
  252. cd pyinstaller
  253. git checkout v4.2-maint
  254. python setup.py install
  255. EOF
  256. end
  257. def build_binary_with_pyinstaller(boxname)
  258. return <<-EOF
  259. . ~/.bash_profile
  260. cd /vagrant/borg
  261. . borg-env/bin/activate
  262. cd borg
  263. pyinstaller --clean --distpath=/vagrant/borg scripts/borg.exe.spec
  264. echo 'export PATH="/vagrant/borg:$PATH"' >> ~/.bash_profile
  265. cd .. && tar -czvf borg.tgz borg-dir
  266. EOF
  267. end
  268. def run_tests(boxname)
  269. return <<-EOF
  270. . ~/.bash_profile
  271. cd /vagrant/borg/borg
  272. . ../borg-env/bin/activate
  273. if which pyenv 2> /dev/null; then
  274. # for testing, use the earliest point releases of the supported python versions:
  275. pyenv global 3.5.3 3.6.2 3.7.9 3.8.0 3.9.0
  276. pyenv local 3.5.3 3.6.2 3.7.9 3.8.0 3.9.0
  277. fi
  278. # otherwise: just use the system python
  279. if which fakeroot 2> /dev/null; then
  280. echo "Running tox WITH fakeroot -u"
  281. fakeroot -u tox --skip-missing-interpreters -e py35,py36,py37,py38,py39
  282. else
  283. echo "Running tox WITHOUT fakeroot -u"
  284. tox --skip-missing-interpreters -e py35,py36,py37,py38,py39
  285. fi
  286. EOF
  287. end
  288. def fs_init(user)
  289. return <<-EOF
  290. # clean up (wrong/outdated) stuff we likely got via rsync:
  291. rm -rf /vagrant/borg/borg/.tox 2> /dev/null
  292. rm -rf /vagrant/borg/borg/borgbackup.egg-info 2> /dev/null
  293. rm -rf /vagrant/borg/borg/__pycache__ 2> /dev/null
  294. find /vagrant/borg/borg/src -name '__pycache__' -exec rm -rf {} \\; 2> /dev/null
  295. chown -R #{user} /vagrant/borg
  296. touch ~#{user}/.bash_profile ; chown #{user} ~#{user}/.bash_profile
  297. echo 'export LANG=en_US.UTF-8' >> ~#{user}/.bash_profile
  298. echo 'export LC_CTYPE=en_US.UTF-8' >> ~#{user}/.bash_profile
  299. echo 'export XDISTN=#{$xdistn}' >> ~#{user}/.bash_profile
  300. EOF
  301. end
  302. Vagrant.configure(2) do |config|
  303. # use rsync to copy content to the folder
  304. config.vm.synced_folder ".", "/vagrant/borg/borg", :type => "rsync", :rsync__args => ["--verbose", "--archive", "--delete", "-z"], :rsync__chown => false
  305. # do not let the VM access . on the host machine via the default shared folder!
  306. config.vm.synced_folder ".", "/vagrant", disabled: true
  307. config.vm.provider :virtualbox do |v|
  308. #v.gui = true
  309. v.cpus = $cpus
  310. end
  311. # Linux
  312. config.vm.define "centos7_64" do |b|
  313. b.vm.box = "centos/7"
  314. b.vm.provider :virtualbox do |v|
  315. v.memory = 1024 + $wmem
  316. end
  317. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  318. b.vm.provision "install system packages", :type => :shell, :inline => packages_redhatted
  319. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("centos7_64")
  320. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("centos7_64")
  321. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("centos7_64")
  322. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  323. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("centos7_64")
  324. end
  325. config.vm.define "focal64" do |b|
  326. b.vm.box = "ubuntu/focal64"
  327. b.vm.provider :virtualbox do |v|
  328. v.memory = 1024 + $wmem
  329. end
  330. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  331. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
  332. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("focal64")
  333. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  334. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("focal64")
  335. end
  336. config.vm.define "bionic64" do |b|
  337. b.vm.box = "ubuntu/bionic64"
  338. b.vm.provider :virtualbox do |v|
  339. v.memory = 1024 + $wmem
  340. end
  341. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  342. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
  343. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("bionic64")
  344. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  345. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("bionic64")
  346. end
  347. config.vm.define "buster64" do |b|
  348. b.vm.box = "debian/buster64"
  349. b.vm.provider :virtualbox do |v|
  350. v.memory = 1024 + $wmem
  351. end
  352. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  353. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
  354. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("buster64")
  355. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  356. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("buster64")
  357. end
  358. config.vm.define "stretch64" do |b|
  359. b.vm.box = "debian/stretch64"
  360. b.vm.provider :virtualbox do |v|
  361. v.memory = 1024 + $wmem
  362. end
  363. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  364. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
  365. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("stretch64")
  366. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("stretch64")
  367. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("stretch64")
  368. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  369. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
  370. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("stretch64")
  371. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("stretch64")
  372. end
  373. # OS X
  374. config.vm.define "darwin64" do |b|
  375. b.vm.box = "macos-sierra"
  376. b.vm.provider :virtualbox do |v|
  377. v.memory = 2048 + $wmem
  378. v.customize ['modifyvm', :id, '--ostype', 'MacOS_64']
  379. v.customize ['modifyvm', :id, '--paravirtprovider', 'default']
  380. v.customize ['modifyvm', :id, '--nested-hw-virt', 'on']
  381. # Adjust CPU settings according to
  382. # https://github.com/geerlingguy/macos-virtualbox-vm
  383. v.customize ['modifyvm', :id, '--cpuidset',
  384. '00000001', '000306a9', '00020800', '80000201', '178bfbff']
  385. # Disable USB variant requiring Virtualbox proprietary extension pack
  386. v.customize ["modifyvm", :id, '--usbehci', 'off', '--usbxhci', 'off']
  387. end
  388. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  389. b.vm.provision "packages darwin", :type => :shell, :privileged => false, :inline => packages_darwin
  390. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("darwin64")
  391. b.vm.provision "fix pyenv", :type => :shell, :privileged => false, :inline => fix_pyenv_darwin("darwin64")
  392. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("darwin64")
  393. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("darwin64")
  394. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  395. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
  396. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("darwin64")
  397. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("darwin64")
  398. end
  399. # BSD
  400. config.vm.define "freebsd64" do |b|
  401. b.vm.box = "freebsd121-64"
  402. b.vm.provider :virtualbox do |v|
  403. v.memory = 1024 + $wmem
  404. end
  405. b.ssh.shell = "sh"
  406. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  407. b.vm.provision "install system packages", :type => :shell, :inline => packages_freebsd
  408. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("freebsd")
  409. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("freebsd")
  410. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("freebsd")
  411. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  412. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
  413. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("freebsd")
  414. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("freebsd")
  415. end
  416. config.vm.define "openbsd64" do |b|
  417. b.vm.box = "openbsd64-64" # note: basic openbsd install for vagrant WITH sudo and rsync pre-installed
  418. b.vm.provider :virtualbox do |v|
  419. v.memory = 1024 + $wmem
  420. end
  421. b.ssh.shell = "sh"
  422. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  423. b.vm.provision "packages openbsd", :type => :shell, :inline => packages_openbsd
  424. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("openbsd64")
  425. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(false)
  426. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("openbsd64")
  427. end
  428. config.vm.define "netbsd64" do |b|
  429. b.vm.box = "generic/netbsd9"
  430. b.vm.provider :virtualbox do |v|
  431. v.memory = 1024 + $wmem
  432. end
  433. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  434. b.vm.provision "packages netbsd", :type => :shell, :inline => packages_netbsd
  435. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("netbsd64")
  436. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(false)
  437. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("netbsd64")
  438. end
  439. # rsync on openindiana has troubles, does not set correct owner for /vagrant/borg and thus gives lots of
  440. # permission errors. can be manually fixed in the VM by: sudo chown -R vagrant /vagrant/borg ; then rsync again.
  441. config.vm.define "openindiana64" do |b|
  442. b.vm.box = "openindiana"
  443. b.vm.provider :virtualbox do |v|
  444. v.memory = 1536 + $wmem
  445. end
  446. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  447. b.vm.provision "packages openindiana", :type => :shell, :inline => packages_openindiana
  448. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("openindiana64")
  449. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(false)
  450. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("openindiana64")
  451. end
  452. config.vm.define "windows10" do |b|
  453. b.vm.box = "Microsoft/EdgeOnWindows10"
  454. b.vm.guest = :windows
  455. b.vm.boot_timeout = 180
  456. b.vm.graceful_halt_timeout = 120
  457. b.ssh.shell = "sh -l"
  458. b.ssh.username = "IEUser"
  459. b.ssh.password = "Passw0rd!"
  460. b.ssh.insert_key = false
  461. b.vm.provider :virtualbox do |v|
  462. v.memory = 1536 + $wmem
  463. #v.gui = true
  464. end
  465. b.vm.provision "packages cygwin", :type => :shell, :privileged => false, :inline => packages_cygwin("x86_64")
  466. b.vm.provision :reload
  467. b.vm.provision "cygwin install pip", :type => :shell, :privileged => false, :inline => install_cygwin_venv
  468. b.vm.provision "cygwin build env", :type => :shell, :privileged => false, :inline => build_sys_venv("windows10")
  469. b.vm.provision "cygwin install borg", :type => :shell, :privileged => false, :inline => install_borg(false)
  470. b.vm.provision "cygwin run tests", :type => :shell, :privileged => false, :inline => run_tests("windows10")
  471. end
  472. end