From b35fba7ed4321faf1e0f1b06397e07a5cc0e8d0d Mon Sep 17 00:00:00 2001 From: Federico Ressi Date: Wed, 9 Feb 2022 11:10:07 +0100 Subject: [PATCH] Migrate some test cases from scenario to sanity test suite Change-Id: I346dfc66c2f40076bf681112dad76933434f675a --- .../vars/test-workflow-faults-neutron.yaml | 18 ++++++++++++++++++ .../tobiko-run/vars/test-workflow-faults.yaml | 14 ++++++++++---- .../tobiko-run/vars/test-workflow-minimal.yaml | 14 ++++++++++++++ .../{scenario => sanity}/cloud/__init__.py | 0 .../{scenario => sanity}/cloud/test_nodes.py | 0 tobiko/tests/sanity/neutron/__init__.py | 0 .../neutron/test_agents.py | 0 .../{scenario => sanity}/neutron/test_cli.py | 0 .../{scenario => sanity}/neutron/test_nodes.py | 0 tobiko/tests/sanity/nova/__init__.py | 0 .../{scenario => sanity}/nova/test_service.py | 0 .../tests/scenario/neutron/test_floating_ip.py | 2 ++ tobiko/tests/scenario/neutron/test_network.py | 1 + tobiko/tests/scenario/neutron/test_port.py | 1 + tobiko/tests/scenario/neutron/test_router.py | 1 + tobiko/tests/scenario/nova/test_server.py | 1 + tox.ini | 10 ++++++++++ zuul.d/project.yaml | 1 + 18 files changed, 59 insertions(+), 4 deletions(-) create mode 100644 roles/tobiko-run/vars/test-workflow-minimal.yaml rename tobiko/tests/{scenario => sanity}/cloud/__init__.py (100%) rename tobiko/tests/{scenario => sanity}/cloud/test_nodes.py (100%) create mode 100644 tobiko/tests/sanity/neutron/__init__.py rename tobiko/tests/{scenario => sanity}/neutron/test_agents.py (100%) rename tobiko/tests/{scenario => sanity}/neutron/test_cli.py (100%) rename tobiko/tests/{scenario => sanity}/neutron/test_nodes.py (100%) create mode 100644 tobiko/tests/sanity/nova/__init__.py rename tobiko/tests/{scenario => sanity}/nova/test_service.py (100%) diff --git a/roles/tobiko-run/vars/test-workflow-faults-neutron.yaml b/roles/tobiko-run/vars/test-workflow-faults-neutron.yaml index d7ef67a32..6f591dd24 100644 --- a/roles/tobiko-run/vars/test-workflow-faults-neutron.yaml +++ b/roles/tobiko-run/vars/test-workflow-faults-neutron.yaml @@ -1,17 +1,35 @@ --- test_workflow_steps: + - tox_description: 'run sanity test cases before creating resources' + tox_envlist: neutron_sanity + tox_step_name: before + tox_environment: + TOBIKO_PREVENT_CREATE: no + - tox_description: 'create Neutron resources' tox_envlist: neutron tox_step_name: create_neutron_resources tox_environment: TOBIKO_PREVENT_CREATE: no + - tox_description: 'run sanity test cases before disruptive tests' + tox_envlist: neutron_sanity + tox_step_name: between + tox_environment: + TOBIKO_PREVENT_CREATE: no + - tox_description: 'run disruptive test cases' tox_envlist: neutron_faults tox_step_name: neutron_faults pytest_maxfail: 1 + - tox_description: 'run sanity test cases after disruptive tests' + tox_envlist: neutron_sanity + tox_step_name: after + tox_environment: + TOBIKO_PREVENT_CREATE: no + - tox_description: 'verify Neutron resources' tox_envlist: neutron tox_step_name: verify_neutron_resources diff --git a/roles/tobiko-run/vars/test-workflow-faults.yaml b/roles/tobiko-run/vars/test-workflow-faults.yaml index 2ba8942bf..5b6645ce5 100644 --- a/roles/tobiko-run/vars/test-workflow-faults.yaml +++ b/roles/tobiko-run/vars/test-workflow-faults.yaml @@ -1,15 +1,21 @@ --- test_workflow_steps: + - tox_description: 'run sanity test cases before creating resources' + tox_envlist: sanity + tox_step_name: before + tox_environment: + TOBIKO_PREVENT_CREATE: no + - tox_description: 'create workload resources' tox_envlist: scenario tox_step_name: create_resources tox_environment: TOBIKO_PREVENT_CREATE: no - - tox_description: 'run sanity test cases before disruptive test cases' + - tox_description: 'run sanity test cases before disruptive tests' tox_envlist: sanity - tox_step_name: before_faults + tox_step_name: between tox_environment: TOBIKO_PREVENT_CREATE: no @@ -20,9 +26,9 @@ test_workflow_steps: TOBIKO_PREVENT_CREATE: no pytest_maxfail: 1 - - tox_description: 'run sanity test cases after disruptive test cases' + - tox_description: 'run sanity test cases after disruptive tests' tox_envlist: sanity - tox_step_name: after_faults + tox_step_name: after tox_environment: TOBIKO_PREVENT_CREATE: no diff --git a/roles/tobiko-run/vars/test-workflow-minimal.yaml b/roles/tobiko-run/vars/test-workflow-minimal.yaml new file mode 100644 index 000000000..779a4dc92 --- /dev/null +++ b/roles/tobiko-run/vars/test-workflow-minimal.yaml @@ -0,0 +1,14 @@ +--- + +test_workflow_steps: + - tox_description: 'run sanity test cases before creating resources' + tox_envlist: sanity + tox_step_name: before + tox_environment: + TOBIKO_PREVENT_CREATE: no + + - tox_description: 'create workload resources' + tox_envlist: scenario + tox_step_name: create_resources + tox_environment: + TOBIKO_PREVENT_CREATE: no diff --git a/tobiko/tests/scenario/cloud/__init__.py b/tobiko/tests/sanity/cloud/__init__.py similarity index 100% rename from tobiko/tests/scenario/cloud/__init__.py rename to tobiko/tests/sanity/cloud/__init__.py diff --git a/tobiko/tests/scenario/cloud/test_nodes.py b/tobiko/tests/sanity/cloud/test_nodes.py similarity index 100% rename from tobiko/tests/scenario/cloud/test_nodes.py rename to tobiko/tests/sanity/cloud/test_nodes.py diff --git a/tobiko/tests/sanity/neutron/__init__.py b/tobiko/tests/sanity/neutron/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tobiko/tests/scenario/neutron/test_agents.py b/tobiko/tests/sanity/neutron/test_agents.py similarity index 100% rename from tobiko/tests/scenario/neutron/test_agents.py rename to tobiko/tests/sanity/neutron/test_agents.py diff --git a/tobiko/tests/scenario/neutron/test_cli.py b/tobiko/tests/sanity/neutron/test_cli.py similarity index 100% rename from tobiko/tests/scenario/neutron/test_cli.py rename to tobiko/tests/sanity/neutron/test_cli.py diff --git a/tobiko/tests/scenario/neutron/test_nodes.py b/tobiko/tests/sanity/neutron/test_nodes.py similarity index 100% rename from tobiko/tests/scenario/neutron/test_nodes.py rename to tobiko/tests/sanity/neutron/test_nodes.py diff --git a/tobiko/tests/sanity/nova/__init__.py b/tobiko/tests/sanity/nova/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tobiko/tests/scenario/nova/test_service.py b/tobiko/tests/sanity/nova/test_service.py similarity index 100% rename from tobiko/tests/scenario/nova/test_service.py rename to tobiko/tests/sanity/nova/test_service.py diff --git a/tobiko/tests/scenario/neutron/test_floating_ip.py b/tobiko/tests/scenario/neutron/test_floating_ip.py index 2b7eb4eff..6545c6ce7 100644 --- a/tobiko/tests/scenario/neutron/test_floating_ip.py +++ b/tobiko/tests/scenario/neutron/test_floating_ip.py @@ -17,6 +17,7 @@ from __future__ import absolute_import import typing from oslo_log import log +import pytest import testtools import tobiko @@ -33,6 +34,7 @@ CONF = config.CONF LOG = log.getLogger(__name__) +@pytest.mark.minimal class FloatingIPTest(testtools.TestCase): """Tests connectivity via floating IPs""" diff --git a/tobiko/tests/scenario/neutron/test_network.py b/tobiko/tests/scenario/neutron/test_network.py index a402681d9..680907199 100644 --- a/tobiko/tests/scenario/neutron/test_network.py +++ b/tobiko/tests/scenario/neutron/test_network.py @@ -25,6 +25,7 @@ from tobiko.shell import ping from tobiko.shell import sh +@pytest.mark.minimal class NetworkTest(testtools.TestCase): #: Resources stack with Nova server to send messages to diff --git a/tobiko/tests/scenario/neutron/test_port.py b/tobiko/tests/scenario/neutron/test_port.py index 5fbb34e6b..5f6d7cffe 100644 --- a/tobiko/tests/scenario/neutron/test_port.py +++ b/tobiko/tests/scenario/neutron/test_port.py @@ -39,6 +39,7 @@ IPV4 = constants.IP_VERSION_4 IPV6 = constants.IP_VERSION_6 +@pytest.mark.minimal class PortTest(testtools.TestCase): """Test Neutron ports""" diff --git a/tobiko/tests/scenario/neutron/test_router.py b/tobiko/tests/scenario/neutron/test_router.py index e8445e9fd..fd560c18e 100644 --- a/tobiko/tests/scenario/neutron/test_router.py +++ b/tobiko/tests/scenario/neutron/test_router.py @@ -31,6 +31,7 @@ LOG = log.getLogger(__name__) CONF = config.CONF +@pytest.mark.minimal class RouterTest(testtools.TestCase): """Test Neutron routers""" diff --git a/tobiko/tests/scenario/nova/test_server.py b/tobiko/tests/scenario/nova/test_server.py index e451113d4..83c010b32 100644 --- a/tobiko/tests/scenario/nova/test_server.py +++ b/tobiko/tests/scenario/nova/test_server.py @@ -49,6 +49,7 @@ class CirrosServerStackFixture(stacks.CirrosServerStackFixture): return stack +@pytest.mark.minimal @keystone.skip_unless_has_keystone_credentials() class CirrosServerTest(testtools.TestCase): diff --git a/tox.ini b/tox.ini index dd804950a..006ce8620 100644 --- a/tox.ini +++ b/tox.ini @@ -232,6 +232,16 @@ setenv = PYTEST_TIMEOUT = 1800 +[testenv:neutron_sanity] + +basepython = {[integration]basepython} +envdir = {[integration]envdir} +passenv = {[integration]passenv} +setenv = + {[testenv:sanity]setenv} + OS_TEST_PATH = {toxinidir}/tobiko/tests/sanity/neutron + + [testenv:faults] basepython = {[integration]basepython} diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index aed146606..50abd33de 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -13,6 +13,7 @@ - devstack-tobiko-neutron - devstack-tobiko-nova - devstack-tobiko-ovs + - devstack-tobiko-sanity - devstack-tobiko-storage - docs-on-readthedocs - openstack-cover-jobs