From fe62f913fdc811a504ecb4a96c8abd5f05601e57 Mon Sep 17 00:00:00 2001 From: Liam Young Date: Wed, 8 Mar 2023 12:34:05 +0000 Subject: [PATCH] Add tempest k8s scale test for remaining services --- zaza/openstack/charm_tests/cinder/tests.py | 7 +++++++ zaza/openstack/charm_tests/glance/tests.py | 7 +++++++ zaza/openstack/charm_tests/neutron/tests.py | 7 +++++++ zaza/openstack/charm_tests/nova/tests.py | 7 +++++++ .../charm_tests/placement/__init__.py | 0 zaza/openstack/charm_tests/placement/tests.py | 21 +++++++++++++++++++ 6 files changed, 49 insertions(+) create mode 100644 zaza/openstack/charm_tests/placement/__init__.py create mode 100644 zaza/openstack/charm_tests/placement/tests.py diff --git a/zaza/openstack/charm_tests/cinder/tests.py b/zaza/openstack/charm_tests/cinder/tests.py index 1fcd201..421d306 100644 --- a/zaza/openstack/charm_tests/cinder/tests.py +++ b/zaza/openstack/charm_tests/cinder/tests.py @@ -26,6 +26,7 @@ import zaza.openstack.charm_tests.glance.setup as glance_setup import zaza.openstack.charm_tests.neutron.tests as neutron_tests import zaza.openstack.configure.guest as guest import zaza.openstack.charm_tests.nova.utils as nova_utils +import zaza.openstack.charm_tests.tempest.tests as tempest_tests from tenacity import ( Retrying, @@ -390,3 +391,9 @@ class SecurityTests(test_utils.OpenStackBaseTest): expected_passes, expected_failures, expected_to_pass=False) + + +class CinderTempestTestK8S(tempest_tests.TempestTestScaleK8SBase): + """Test cinder k8s scale out and scale back.""" + + application_name = "cinder" diff --git a/zaza/openstack/charm_tests/glance/tests.py b/zaza/openstack/charm_tests/glance/tests.py index 0f505df..d547dc9 100644 --- a/zaza/openstack/charm_tests/glance/tests.py +++ b/zaza/openstack/charm_tests/glance/tests.py @@ -23,6 +23,7 @@ import boto3 import zaza.model as model import zaza.openstack.charm_tests.test_utils as test_utils import zaza.openstack.utilities.openstack as openstack_utils +import zaza.openstack.charm_tests.tempest.tests as tempest_tests class GlanceTest(test_utils.OpenStackBaseTest): @@ -266,3 +267,9 @@ class GlanceCinderBackendTest(test_utils.OpenStackBaseTest): image_size_in_gb = int(math.ceil(float(image["size"]) / 1024 ** 3)) self.assertEqual(image_size_in_gb, volume.size) openstack_utils.delete_image(self.glance_client, image["id"]) + + +class GlanceTempestTestK8S(tempest_tests.TempestTestScaleK8SBase): + """Test glance k8s scale out and scale back.""" + + application_name = "glance" diff --git a/zaza/openstack/charm_tests/neutron/tests.py b/zaza/openstack/charm_tests/neutron/tests.py index 4777456..b65a68c 100644 --- a/zaza/openstack/charm_tests/neutron/tests.py +++ b/zaza/openstack/charm_tests/neutron/tests.py @@ -33,6 +33,7 @@ import zaza.openstack.charm_tests.nova.utils as nova_utils import zaza.openstack.charm_tests.test_utils as test_utils import zaza.openstack.configure.guest as guest import zaza.openstack.utilities.openstack as openstack_utils +import zaza.openstack.charm_tests.tempest.tests as tempest_tests import zaza.utilities.machine_os @@ -1276,3 +1277,9 @@ class NeutronGatewayDeferredRestartTest(test_utils.BaseDeferredRestartTest): def check_clear_hooks(self): """Gateway does not defer hooks so noop.""" return + + +class NeutronTempestTestK8S(tempest_tests.TempestTestScaleK8SBase): + """Test neutron k8s scale out and scale back.""" + + application_name = "neutron" diff --git a/zaza/openstack/charm_tests/nova/tests.py b/zaza/openstack/charm_tests/nova/tests.py index 695ab0c..65b5775 100644 --- a/zaza/openstack/charm_tests/nova/tests.py +++ b/zaza/openstack/charm_tests/nova/tests.py @@ -35,6 +35,7 @@ import zaza.openstack.charm_tests.test_utils as test_utils import zaza.openstack.utilities.generic as generic_utils import zaza.openstack.configure.guest as guest import zaza.openstack.utilities.openstack as openstack_utils +import zaza.openstack.charm_tests.tempest.tests as tempest_tests from zaza.utilities import juju as juju_utils @@ -1165,3 +1166,9 @@ class SecurityTests(test_utils.OpenStackBaseTest): expected_passes, expected_failures, expected_to_pass=not len(expected_failures)) + + +class NovaTempestTestK8S(tempest_tests.TempestTestScaleK8SBase): + """Test nova k8s scale out and scale back.""" + + application_name = "nova" diff --git a/zaza/openstack/charm_tests/placement/__init__.py b/zaza/openstack/charm_tests/placement/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/zaza/openstack/charm_tests/placement/tests.py b/zaza/openstack/charm_tests/placement/tests.py new file mode 100644 index 0000000..2d085a3 --- /dev/null +++ b/zaza/openstack/charm_tests/placement/tests.py @@ -0,0 +1,21 @@ +# Copyright 2023 Canonical Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Encapsulate placement testing.""" +import zaza.openstack.charm_tests.tempest.tests as tempest_tests + +class KeystoneTempestTestK8S(tempest_tests.TempestTestScaleK8SBase): + """Test keystone k8s scale out and scale back.""" + + application_name = "placement"