Browse Source

Test fixes and tweaks

Fixed issue where tests/framework.py was ignorning DISTRO env
variable.

Added SNAP_FILE env variable, which allows tests to be run on an
abitrary .snap file. For example, one fetch with `snap download`.

Change-Id: Ie6cce841e00d6d56d0525d0a81c4faad3c54e8e8
changes/90/717090/1
Pete Vander Giessen 3 months ago
parent
commit
f6c44fb77a
2 changed files with 5 additions and 5 deletions
  1. +4
    -4
      tests/framework.py
  2. +1
    -1
      tox.ini

+ 4
- 4
tests/framework.py View File

@@ -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))



+ 1
- 1
tox.ini View File

@@ -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