Vagrantfile 23 KB

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