Vagrantfile 22 KB

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