From 2a641137e8dab2dcadabd3c6a60100986330ae5e Mon Sep 17 00:00:00 2001 From: Claudiu Belu Date: Mon, 25 Aug 2025 10:34:18 +0000 Subject: [PATCH] Updates tempest-k8s for manila There are a few changes needed in tempest-k8s, needed in order to run the manila tempest tests: - We're only using the manila v2 API, thus, tests related to v1 should be skipped. - CephFS share group snapshots are not supported since the W release. Tests related to it should be skipped. - The default value for share.catalog_type is "share", and it should be set to "sharev2". - The default value for share.endpoint_type is "publicURL", and it should be set to "public". - The config option share.capability_storage_pool needs to be set to "NFS". Change-Id: Ie739a983e089bd0e3cc8f50465a4cb11fc22552b Signed-off-by: Claudiu Belu --- charms/tempest-k8s/src/charm.py | 2 ++ charms/tempest-k8s/src/utils/overrides.py | 11 +++++++++++ charms/tempest-k8s/src/utils/tempest_exclude_list.txt | 11 +++++++++++ charms/tempest-k8s/tests/unit/test_tempest_charm.py | 6 +++++- 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/charms/tempest-k8s/src/charm.py b/charms/tempest-k8s/src/charm.py index 785f9386..34a5c066 100755 --- a/charms/tempest-k8s/src/charm.py +++ b/charms/tempest-k8s/src/charm.py @@ -73,6 +73,7 @@ from utils.constants import ( ) from utils.overrides import ( get_compute_overrides, + get_manila_overrides, get_role_based_overrides, get_swift_overrides, ) @@ -251,6 +252,7 @@ class TempestOperatorCharm(sunbeam_charm.OSBaseOperatorCharmK8S): ( get_swift_overrides(), get_compute_overrides(), + get_manila_overrides(), get_role_based_overrides(self.config["roles"]), ) ).strip() diff --git a/charms/tempest-k8s/src/utils/overrides.py b/charms/tempest-k8s/src/utils/overrides.py index 51f2c322..275bee9a 100644 --- a/charms/tempest-k8s/src/utils/overrides.py +++ b/charms/tempest-k8s/src/utils/overrides.py @@ -48,6 +48,17 @@ def get_compute_overrides() -> str: ) +def get_manila_overrides() -> str: + """Return manila configuration override.""" + return " ".join( + ( + "share.catalog_type sharev2", + "share.endpoint_type public", + "share.capability_storage_protocol NFS", + ) + ) + + def get_role_based_overrides(config_roles: str) -> str: """Generate tempest.conf overrides based on the configured roles. diff --git a/charms/tempest-k8s/src/utils/tempest_exclude_list.txt b/charms/tempest-k8s/src/utils/tempest_exclude_list.txt index 22f6c8ad..2ef5a950 100644 --- a/charms/tempest-k8s/src/utils/tempest_exclude_list.txt +++ b/charms/tempest-k8s/src/utils/tempest_exclude_list.txt @@ -45,3 +45,14 @@ tempest.api.object_storage.test_container_acl.ObjectTestACLs.test_write_object_w # too much. # Reference: https://bugs.launchpad.net/charm-ceph-radosgw/+bug/1967567 tempest.api.object_storage.test_container_quotas.ContainerQuotasTest.test_upload_too_many_objects + +# The manila-k8s charm only registers the v2 manila endpoints, and these tests tests v1. +manila_tempest_tests.tests.api.test_microversions.MicroversionsTest.test_microversions_v1_no_version +manila_tempest_tests.tests.api.test_microversions.MicroversionsTest.test_microversions_v1_with_version + +# CephFS share group snapshot not supported anymore since W release. These tests will try +# to create a share group snapshot in the resource setup step. +manila_tempest_tests.tests.api.test_share_group_actions.ShareGroupActionsTest +manila_tempest_tests.tests.api.test_share_groups_negative.ShareGroupsNegativeTest +manila_tempest_tests.tests.api.test_share_groups.ShareGroupsTest.test_create_delete_empty_share_group_snapshot_min +manila_tempest_tests.tests.api.test_share_groups.ShareGroupsTest.test_create_share_group_from_empty_share_group_snapshot_min diff --git a/charms/tempest-k8s/tests/unit/test_tempest_charm.py b/charms/tempest-k8s/tests/unit/test_tempest_charm.py index 18b268e8..bb1de460 100644 --- a/charms/tempest-k8s/tests/unit/test_tempest_charm.py +++ b/charms/tempest-k8s/tests/unit/test_tempest_charm.py @@ -72,7 +72,11 @@ TEST_TEMPEST_ENV = { "TEMPEST_WORKSPACE": "tempest", "TEMPEST_WORKSPACE_PATH": "/var/lib/tempest/workspace", "TEMPEST_CONFIG_OVERRIDES": " ".join( - (overrides.get_swift_overrides(), overrides.get_compute_overrides()) + ( + overrides.get_swift_overrides(), + overrides.get_compute_overrides(), + overrides.get_manila_overrides(), + ), ), }