Browse Source

Merge "Test fixes and tweaks"

changes/76/720276/1
Zuul 2 years ago
committed by Gerrit Code Review
parent
commit
214f0e8d5b
  1. 8
      tests/framework.py
  2. 2
      tox.ini

8
tests/framework.py

@ -81,8 +81,9 @@ class Host():
self.prefix = []
self.dump_dir = '/tmp'
self.machine = ''
self.distro = 'bionic'
self.snap = 'microstack_stein_amd64.snap'
self.distro = os.environ.get('DISTRO') or 'bionic'
self.snap = os.environ.get('SNAP_FILE') or \
'microstack_stein_amd64.snap'
self.horizon_ip = '10.20.20.1'
self.host_type = 'localhost'
@ -106,11 +107,10 @@ class Host():
def multipass(self):
self.machine = petname.generate()
self.prefix = ['multipass', 'exec', self.machine, '--']
distro = os.environ.get('distro') or self.distro
check('sudo', 'snap', 'install', '--classic', '--edge', 'multipass')
check('multipass', 'launch', '--cpus', '2', '--mem', '8G', distro,
check('multipass', 'launch', '--cpus', '2', '--mem', '8G', self.distro,
'--name', self.machine)
check('multipass', 'copy-files', self.snap, '{}:'.format(self.machine))

2
tox.ini

@ -8,7 +8,7 @@ install_command = pip install {opts} {packages}
deps = -r{toxinidir}/test-requirements.txt
setenv =
PATH = /snap/bin:{env:PATH}
passenv = HOME TERM DISTRO INTERACTIVE_DEBUG USER
passenv = HOME TERM DISTRO INTERACTIVE_DEBUG USER SNAP_FILE
whitelist_externals =
sudo
/snap/bin/snapcraft

Loading…
Cancel
Save