Vagrantfile 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521
  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. hostname netbsd # the box we use has an invalid hostname
  104. PKG_PATH="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/amd64/7.0.1/All"
  105. export PKG_PATH
  106. pkg_add mozilla-rootcerts lz4 git
  107. chsh -s bash vagrant
  108. mkdir -p /usr/local/opt/lz4/include
  109. mkdir -p /usr/local/opt/lz4/lib
  110. ln -s /usr/pkg/include/lz4*.h /usr/local/opt/lz4/include/
  111. ln -s /usr/pkg/lib/liblz4* /usr/local/opt/lz4/lib/
  112. touch /etc/openssl/openssl.cnf # avoids a flood of "can't open ..."
  113. mozilla-rootcerts install
  114. pkg_add pkg-config # avoids some "pkg-config missing" error msg, even without fuse pkg
  115. # pkg_add fuse # llfuse supports netbsd, but is still buggy.
  116. # https://bitbucket.org/nikratio/python-llfuse/issues/70/perfuse_open-setsockopt-no-buffer-space
  117. pkg_add python37 py37-sqlite3 py37-pip py37-virtualenv
  118. ln -s /usr/pkg/bin/python3.7 /usr/pkg/bin/python
  119. ln -s /usr/pkg/bin/python3.7 /usr/pkg/bin/python3
  120. ln -s /usr/pkg/bin/pip3.7 /usr/pkg/bin/pip
  121. ln -s /usr/pkg/bin/pip3.7 /usr/pkg/bin/pip3
  122. ln -s /usr/pkg/bin/virtualenv-3.7 /usr/pkg/bin/virtualenv
  123. ln -s /usr/pkg/bin/virtualenv-3.7 /usr/pkg/bin/virtualenv3
  124. EOF
  125. end
  126. def packages_openindiana
  127. return <<-EOF
  128. # needs separate provisioning step + reboot:
  129. #pkg update
  130. # already installed:
  131. #pkg install python-37 python-35 virtualenv-35 pip-35 clang-40 lz4 zstd git
  132. pkg install gcc-7
  133. ln -sf /usr/bin/python3.5 /usr/bin/pyton3
  134. ln -sf /usr/bin/virtualenv-3.5 /usr/bin/virtualenv
  135. ln -sf /usr/bin/pip-3.5 /usr/bin/pip
  136. EOF
  137. end
  138. # Install required cygwin packages and configure environment
  139. #
  140. # Microsoft/EdgeOnWindows10 image has MLS-OpenSSH installed by default,
  141. # which is based on cygwin x86_64 but should not be used together with cygwin.
  142. # In order to have have cygwin compatible bash 'ImagePath' is replaced with
  143. # cygrunsrv of newly installed cygwin
  144. #
  145. # supported cygwin versions:
  146. # x86_64
  147. # x86
  148. def packages_cygwin(version)
  149. setup_exe = "setup-#{version}.exe"
  150. return <<-EOF
  151. mkdir -p /cygdrive/c/cygwin
  152. powershell -Command '$client = new-object System.Net.WebClient; $client.DownloadFile("https://www.cygwin.com/#{setup_exe}","C:\\cygwin\\#{setup_exe}")'
  153. echo '
  154. REM --- Change to use different CygWin platform and final install path
  155. set CYGSETUP=#{setup_exe}
  156. REM --- Install build version of CygWin in a subfolder
  157. set OURPATH=%cd%
  158. set CYGBUILD="C:\\cygwin\\CygWin"
  159. set CYGMIRROR=http://mirrors.kernel.org/sourceware/cygwin/
  160. set BASEPKGS=openssh,rsync
  161. set BUILDPKGS=python3,python3-setuptools,python-devel,binutils,gcc-g++,libopenssl,openssl-devel,git,make,liblz4-devel,liblz4_1,curl
  162. %CYGSETUP% -q -B -o -n -R %CYGBUILD% -L -D -s %CYGMIRROR% -P %BASEPKGS%,%BUILDPKGS%
  163. cd /d C:\\cygwin\\CygWin\\bin
  164. regtool set /HKLM/SYSTEM/CurrentControlSet/Services/OpenSSHd/ImagePath "C:\\cygwin\\CygWin\\bin\\cygrunsrv.exe"
  165. bash -c "ssh-host-config --no"
  166. bash -c "chown sshd_server /cygdrive/c/cygwin/CygWin/var/empty"
  167. ' > /cygdrive/c/cygwin/install.bat
  168. echo "alias mkdir='mkdir -p'" > ~/.profile
  169. echo "export CYGWIN_ROOT=/cygdrive/c/cygwin/CygWin" >> ~/.profile
  170. echo 'export PATH=$CYGWIN_ROOT/bin:$PATH' >> ~/.profile
  171. echo '' > ~/.bash_profile
  172. cmd.exe /c 'setx /m PATH "C:\\cygwin\\CygWin\\bin;%PATH%"'
  173. source ~/.profile
  174. cd /cygdrive/c/cygwin && cmd.exe /c install.bat
  175. echo 'db_home: windows' > $CYGWIN_ROOT/etc/nsswitch.conf
  176. EOF
  177. end
  178. def install_cygwin_venv
  179. return <<-EOF
  180. python3 -m ensurepip -U --default-pip
  181. pip install virtualenv
  182. EOF
  183. end
  184. def install_pyenv(boxname)
  185. return <<-EOF
  186. echo 'export PYTHON_CONFIGURE_OPTS="--enable-shared"' >> ~/.bash_profile
  187. echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
  188. echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
  189. . ~/.bash_profile
  190. curl -s -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash
  191. echo 'eval "$(pyenv init --path)"' >> ~/.bash_profile
  192. echo 'eval "$(pyenv init -)"' >> ~/.bashrc
  193. echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
  194. EOF
  195. end
  196. def fix_pyenv_darwin(boxname)
  197. return <<-EOF
  198. echo 'export PYTHON_CONFIGURE_OPTS="--enable-framework"' >> ~/.bash_profile
  199. EOF
  200. end
  201. def install_pythons(boxname)
  202. return <<-EOF
  203. . ~/.bash_profile
  204. pyenv install 3.5.3 # tests, 3.5.3 is first to support openssl 1.1
  205. pyenv install 3.6.2 # tests
  206. pyenv install 3.7.9 # binary build, use latest 3.7.x release
  207. pyenv install 3.8.0 # tests
  208. pyenv install 3.9.0 # tests
  209. pyenv rehash
  210. EOF
  211. end
  212. def build_sys_venv(boxname)
  213. return <<-EOF
  214. . ~/.bash_profile
  215. cd /vagrant/borg
  216. virtualenv --python=python3 borg-env
  217. EOF
  218. end
  219. def build_pyenv_venv(boxname)
  220. return <<-EOF
  221. . ~/.bash_profile
  222. cd /vagrant/borg
  223. # use the latest 3.7 release
  224. pyenv global 3.7.9
  225. pyenv virtualenv 3.7.9 borg-env
  226. ln -s ~/.pyenv/versions/borg-env .
  227. EOF
  228. end
  229. def install_borg(fuse)
  230. script = <<-EOF
  231. . ~/.bash_profile
  232. cd /vagrant/borg
  233. . borg-env/bin/activate
  234. pip install -U wheel # upgrade wheel, too old for 3.5
  235. cd borg
  236. pip install -r requirements.d/development.lock.txt
  237. python setup.py clean
  238. EOF
  239. if fuse
  240. script += <<-EOF
  241. # by using [fuse], setup.py can handle different FUSE requirements:
  242. pip install -e .[fuse]
  243. EOF
  244. else
  245. script += <<-EOF
  246. pip install -e .
  247. # do not install llfuse into the virtualenvs built by tox:
  248. sed -i.bak '/fuse.txt/d' tox.ini
  249. EOF
  250. end
  251. return script
  252. end
  253. def install_pyinstaller()
  254. return <<-EOF
  255. . ~/.bash_profile
  256. cd /vagrant/borg
  257. . borg-env/bin/activate
  258. git clone https://github.com/thomaswaldmann/pyinstaller.git
  259. cd pyinstaller
  260. git checkout v4.2-maint
  261. python setup.py install
  262. EOF
  263. end
  264. def build_binary_with_pyinstaller(boxname)
  265. return <<-EOF
  266. . ~/.bash_profile
  267. cd /vagrant/borg
  268. . borg-env/bin/activate
  269. cd borg
  270. pyinstaller --clean --distpath=/vagrant/borg scripts/borg.exe.spec
  271. echo 'export PATH="/vagrant/borg:$PATH"' >> ~/.bash_profile
  272. cd .. && tar -czvf borg.tgz borg-dir
  273. EOF
  274. end
  275. def run_tests(boxname)
  276. return <<-EOF
  277. . ~/.bash_profile
  278. cd /vagrant/borg/borg
  279. . ../borg-env/bin/activate
  280. if which pyenv 2> /dev/null; then
  281. # for testing, use the earliest point releases of the supported python versions:
  282. pyenv global 3.5.3 3.6.2 3.7.9 3.8.0 3.9.0
  283. pyenv local 3.5.3 3.6.2 3.7.9 3.8.0 3.9.0
  284. fi
  285. # otherwise: just use the system python
  286. if which fakeroot 2> /dev/null; then
  287. echo "Running tox WITH fakeroot -u"
  288. fakeroot -u tox --skip-missing-interpreters -e py35,py36,py37,py38,py39
  289. else
  290. echo "Running tox WITHOUT fakeroot -u"
  291. tox --skip-missing-interpreters -e py35,py36,py37,py38,py39
  292. fi
  293. EOF
  294. end
  295. def fs_init(user)
  296. return <<-EOF
  297. # clean up (wrong/outdated) stuff we likely got via rsync:
  298. rm -rf /vagrant/borg/borg/.tox 2> /dev/null
  299. rm -rf /vagrant/borg/borg/borgbackup.egg-info 2> /dev/null
  300. rm -rf /vagrant/borg/borg/__pycache__ 2> /dev/null
  301. find /vagrant/borg/borg/src -name '__pycache__' -exec rm -rf {} \\; 2> /dev/null
  302. chown -R #{user} /vagrant/borg
  303. touch ~#{user}/.bash_profile ; chown #{user} ~#{user}/.bash_profile
  304. echo 'export LANG=en_US.UTF-8' >> ~#{user}/.bash_profile
  305. echo 'export LC_CTYPE=en_US.UTF-8' >> ~#{user}/.bash_profile
  306. echo 'export XDISTN=#{$xdistn}' >> ~#{user}/.bash_profile
  307. EOF
  308. end
  309. Vagrant.configure(2) do |config|
  310. # use rsync to copy content to the folder
  311. config.vm.synced_folder ".", "/vagrant/borg/borg", :type => "rsync", :rsync__args => ["--verbose", "--archive", "--delete", "-z"], :rsync__chown => false
  312. # do not let the VM access . on the host machine via the default shared folder!
  313. config.vm.synced_folder ".", "/vagrant", disabled: true
  314. config.vm.provider :virtualbox do |v|
  315. #v.gui = true
  316. v.cpus = $cpus
  317. end
  318. # Linux
  319. config.vm.define "centos7_64" do |b|
  320. b.vm.box = "centos/7"
  321. b.vm.provider :virtualbox do |v|
  322. v.memory = 1024 + $wmem
  323. end
  324. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  325. b.vm.provision "install system packages", :type => :shell, :inline => packages_redhatted
  326. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("centos7_64")
  327. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("centos7_64")
  328. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("centos7_64")
  329. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  330. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("centos7_64")
  331. end
  332. config.vm.define "focal64" do |b|
  333. b.vm.box = "ubuntu/focal64"
  334. b.vm.provider :virtualbox do |v|
  335. v.memory = 1024 + $wmem
  336. end
  337. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  338. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
  339. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("focal64")
  340. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  341. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("focal64")
  342. end
  343. config.vm.define "bionic64" do |b|
  344. b.vm.box = "ubuntu/bionic64"
  345. b.vm.provider :virtualbox do |v|
  346. v.memory = 1024 + $wmem
  347. end
  348. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  349. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
  350. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("bionic64")
  351. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  352. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("bionic64")
  353. end
  354. config.vm.define "buster64" do |b|
  355. b.vm.box = "debian/buster64"
  356. b.vm.provider :virtualbox do |v|
  357. v.memory = 1024 + $wmem
  358. end
  359. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  360. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
  361. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("buster64")
  362. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  363. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("buster64")
  364. end
  365. config.vm.define "stretch64" do |b|
  366. b.vm.box = "debian/stretch64"
  367. b.vm.provider :virtualbox do |v|
  368. v.memory = 1024 + $wmem
  369. end
  370. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  371. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
  372. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("stretch64")
  373. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("stretch64")
  374. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("stretch64")
  375. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  376. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
  377. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("stretch64")
  378. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("stretch64")
  379. end
  380. # OS X
  381. config.vm.define "darwin64" do |b|
  382. b.vm.box = "macos-sierra"
  383. b.vm.provider :virtualbox do |v|
  384. v.memory = 2048 + $wmem
  385. v.customize ['modifyvm', :id, '--ostype', 'MacOS_64']
  386. v.customize ['modifyvm', :id, '--paravirtprovider', 'default']
  387. v.customize ['modifyvm', :id, '--nested-hw-virt', 'on']
  388. # Adjust CPU settings according to
  389. # https://github.com/geerlingguy/macos-virtualbox-vm
  390. v.customize ['modifyvm', :id, '--cpuidset',
  391. '00000001', '000306a9', '00020800', '80000201', '178bfbff']
  392. # Disable USB variant requiring Virtualbox proprietary extension pack
  393. v.customize ["modifyvm", :id, '--usbehci', 'off', '--usbxhci', 'off']
  394. end
  395. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  396. b.vm.provision "packages darwin", :type => :shell, :privileged => false, :inline => packages_darwin
  397. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("darwin64")
  398. b.vm.provision "fix pyenv", :type => :shell, :privileged => false, :inline => fix_pyenv_darwin("darwin64")
  399. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("darwin64")
  400. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("darwin64")
  401. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  402. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
  403. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("darwin64")
  404. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("darwin64")
  405. end
  406. # BSD
  407. config.vm.define "freebsd64" do |b|
  408. b.vm.box = "freebsd121-64"
  409. b.vm.provider :virtualbox do |v|
  410. v.memory = 1024 + $wmem
  411. end
  412. b.ssh.shell = "sh"
  413. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  414. b.vm.provision "install system packages", :type => :shell, :inline => packages_freebsd
  415. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("freebsd")
  416. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("freebsd")
  417. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("freebsd")
  418. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  419. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
  420. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("freebsd")
  421. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("freebsd")
  422. end
  423. config.vm.define "openbsd64" do |b|
  424. b.vm.box = "openbsd64-64" # note: basic openbsd install for vagrant WITH sudo and rsync pre-installed
  425. b.vm.provider :virtualbox do |v|
  426. v.memory = 1024 + $wmem
  427. end
  428. b.ssh.shell = "sh"
  429. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  430. b.vm.provision "packages openbsd", :type => :shell, :inline => packages_openbsd
  431. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("openbsd64")
  432. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(false)
  433. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("openbsd64")
  434. end
  435. config.vm.define "netbsd64" do |b|
  436. b.vm.box = "netbsd70-64"
  437. b.vm.provider :virtualbox do |v|
  438. v.memory = 1024 + $wmem
  439. end
  440. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  441. b.vm.provision "packages netbsd", :type => :shell, :inline => packages_netbsd
  442. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("netbsd64")
  443. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(false)
  444. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("netbsd64")
  445. end
  446. # rsync on openindiana has troubles, does not set correct owner for /vagrant/borg and thus gives lots of
  447. # permission errors. can be manually fixed in the VM by: sudo chown -R vagrant /vagrant/borg ; then rsync again.
  448. config.vm.define "openindiana64" do |b|
  449. b.vm.box = "openindiana"
  450. b.vm.provider :virtualbox do |v|
  451. v.memory = 1536 + $wmem
  452. end
  453. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  454. b.vm.provision "packages openindiana", :type => :shell, :inline => packages_openindiana
  455. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("openindiana64")
  456. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(false)
  457. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("openindiana64")
  458. end
  459. config.vm.define "windows10" do |b|
  460. b.vm.box = "Microsoft/EdgeOnWindows10"
  461. b.vm.guest = :windows
  462. b.vm.boot_timeout = 180
  463. b.vm.graceful_halt_timeout = 120
  464. b.ssh.shell = "sh -l"
  465. b.ssh.username = "IEUser"
  466. b.ssh.password = "Passw0rd!"
  467. b.ssh.insert_key = false
  468. b.vm.provider :virtualbox do |v|
  469. v.memory = 1536 + $wmem
  470. #v.gui = true
  471. end
  472. b.vm.provision "packages cygwin", :type => :shell, :privileged => false, :inline => packages_cygwin("x86_64")
  473. b.vm.provision :reload
  474. b.vm.provision "cygwin install pip", :type => :shell, :privileged => false, :inline => install_cygwin_venv
  475. b.vm.provision "cygwin build env", :type => :shell, :privileged => false, :inline => build_sys_venv("windows10")
  476. b.vm.provision "cygwin install borg", :type => :shell, :privileged => false, :inline => install_borg(false)
  477. b.vm.provision "cygwin run tests", :type => :shell, :privileged => false, :inline => run_tests("windows10")
  478. end
  479. end