Merge "Move volume tests to experimental pipeline"

This commit is contained in:
Zuul 2021-04-12 19:06:30 +00:00 committed by Gerrit Code Review
commit b42d532c45
4 changed files with 60 additions and 9 deletions

View File

@ -8,6 +8,18 @@
label: bionic-brown label: bionic-brown
vars: vars:
tox_envlist: snap tox_envlist: snap
- job:
name: microstack-bionic-lvm
parent: openstack-tox-snap-with-sudo
timeout: 7200
nodeset:
nodes:
- name: bionic-brown
label: bionic-brown
vars:
tox_envlist: snap-lvm
- job: - job:
name: microstack-focal name: microstack-focal
parent: openstack-tox-snap-with-sudo parent: openstack-tox-snap-with-sudo
@ -19,9 +31,26 @@
vars: vars:
tox_envlist: snap tox_envlist: snap
- job:
name: microstack-focal-lvm
parent: openstack-tox-snap-with-sudo
timeout: 7200
nodeset:
nodes:
- name: focal-brown
label: focal-brown
vars:
tox_envlist: snap-lvm
- project: - project:
check: check:
fail-fast: true fail-fast: true
jobs: jobs:
- microstack-bionic - microstack-bionic
- microstack-focal - microstack-focal
experimental:
fail-fast: true
jobs:
- microstack-bionic-lvm
- microstack-focal-lvm

View File

@ -121,12 +121,21 @@ class TestHost:
'--name', 'snap_generated']) '--name', 'snap_generated'])
self.check_call(['microstack-test.tempest-init']) self.check_call(['microstack-test.tempest-init'])
def run_verifications(self): def _create_filtered_test_list(self, source):
target = '/tmp/snap.microstack-test/tmp/exclude-volume-tests.txt'
cmd = ['sudo', 'sh', '-c',
f'sed "/.*volume.*/d" {source} > {target}']
self.check_call(cmd)
return '/tmp/exclude-volume-tests.txt'
def run_verifications(self, include_volumes=False):
"""Run a set of verification tests on MicroStack from this host.""" """Run a set of verification tests on MicroStack from this host."""
test_list = '/snap/microstack-test/current/2020.06-test-list.txt'
if not include_volumes:
test_list = self._create_filtered_test_list(test_list)
self.check_call([ self.check_call([
'microstack-test.rally', 'verify', 'start', 'microstack-test.rally', 'verify', 'start',
'--load-list', '--load-list', f'{test_list}',
'/snap/microstack-test/current/2020.06-test-list.txt',
'--detailed', '--concurrency', '2']) '--detailed', '--concurrency', '2'])
self.check_call([ self.check_call([
'microstack-test.rally', 'verify', 'report', 'microstack-test.rally', 'verify', 'report',

View File

@ -25,7 +25,9 @@ from tests.framework import Framework # noqa E402
class TestBasics(Framework): class TestBasics(Framework):
snap_try = False snap_try = False
use_lvm = False
def test_basics(self): def test_basics(self):
"""Basic test """Basic test
@ -36,12 +38,14 @@ class TestBasics(Framework):
""" """
self._localhost.install_microstack(path='microstack_ussuri_amd64.snap', self._localhost.install_microstack(path='microstack_ussuri_amd64.snap',
snap_try=self.snap_try) snap_try=self.snap_try)
self._localhost.init_microstack([ init_args = ['--auto', '--control']
'--auto', if self.use_lvm:
'--control', init_args.extend([
'--setup-loop-based-cinder-lvm-backend', '--setup-loop-based-cinder-lvm-backend',
'--loop-device-file-size=24' '--loop-device-file-size=24',
]) ])
self._localhost.init_microstack(init_args)
endpoints = self._localhost.check_output( endpoints = self._localhost.check_output(
['/snap/bin/microstack.openstack', 'endpoint', 'list'] ['/snap/bin/microstack.openstack', 'endpoint', 'list']
).decode('utf-8') ).decode('utf-8')
@ -78,7 +82,7 @@ class TestBasics(Framework):
self._localhost.setup_tempest_verifier() self._localhost.setup_tempest_verifier()
# Make sure there are no verification failures in the report. # Make sure there are no verification failures in the report.
failures = self._localhost.run_verifications() failures = self._localhost.run_verifications(self.use_lvm)
self.assertEqual(failures, 0, 'Verification tests had failure.') self.assertEqual(failures, 0, 'Verification tests had failure.')
# Try to remove the snap without sudo. # Try to remove the snap without sudo.
@ -106,9 +110,12 @@ if __name__ == '__main__':
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument("--snap-try", help="Install snap as rw mount from " parser.add_argument("--snap-try", help="Install snap as rw mount from "
"squashfs-root directory", action='store_true') "squashfs-root directory", action='store_true')
parser.add_argument("--use-lvm", help="Init snap with experimental lvm "
"support", action='store_true')
parser.add_argument('unittest_args', nargs='*') parser.add_argument('unittest_args', nargs='*')
args = parser.parse_args() args = parser.parse_args()
TestBasics.snap_try = args.snap_try TestBasics.snap_try = args.snap_try
TestBasics.use_lvm = args.use_lvm
sys.argv[1:] = args.unittest_args sys.argv[1:] = args.unittest_args
# Run our tests, ignoring deprecation warnings and warnings about # Run our tests, ignoring deprecation warnings and warnings about

View File

@ -30,6 +30,12 @@ commands =
bash -c "unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY ; {toxinidir}/tests/test_basic.py" bash -c "unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY ; {toxinidir}/tests/test_basic.py"
bash -c "unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY ; {toxinidir}/tests/test_cluster.py" bash -c "unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY ; {toxinidir}/tests/test_cluster.py"
[testenv:snap-lvm]
commands =
{toxinidir}/tools/lxd_build.sh
flake8 {toxinidir}/tests/
bash -c "unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY ; {toxinidir}/tests/test_basic.py --use-lvm"
[testenv:snap-try] [testenv:snap-try]
# Testing environment for local debugging. Mounts rw snap from squashfs-root dir. # Testing environment for local debugging. Mounts rw snap from squashfs-root dir.
commands = commands =