Vagrantfile 22 KB

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