From 09432ab8e615acd220281c0d3d6fb92bede0bbf8 Mon Sep 17 00:00:00 2001 From: Anoop C S Date: Wed, 28 Aug 2024 12:31:31 +0530 Subject: [PATCH] smbtorture: Prefer method to find specific flapping list https://github.com/samba-in-kubernetes/sit-environment/pull/121 adds 'method' to share section in test-info.yml. With 'variant' no longer relevant, prefer 'method' to determine the need for VFS specific flapping file. Signed-off-by: Anoop C S --- test-info.yml.example | 6 ++++-- testcases/smbtorture/test_smbtorture.py | 10 +++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/test-info.yml.example b/test-info.yml.example index bb4f2a6..3cf9295 100644 --- a/test-info.yml.example +++ b/test-info.yml.example @@ -19,8 +19,10 @@ shares: backend: # If present override default backend filesystem name: cephfs - # If present list the variant of the backend filesystem - variant: vfs + # If present list the variant used for samba/ctdb setup + variant: default + # If present list the method used in share configuration + method: vfs # If present, use these credentials to perform the # tests for this share users: diff --git a/testcases/smbtorture/test_smbtorture.py b/testcases/smbtorture/test_smbtorture.py index f501d48..646792b 100755 --- a/testcases/smbtorture/test_smbtorture.py +++ b/testcases/smbtorture/test_smbtorture.py @@ -23,8 +23,8 @@ def flapping_file(backend: str, variant: str = "") -> str: file = "flapping." + backend - if variant and variant != "default": - file_variant = f"{file}-{variant}" + if variant and "vfs" in variant: + file_variant = f"{file}-vfs" if os.path.exists(os.path.join(selftest_dir, file_variant)): return file_variant if os.path.exists(os.path.join(selftest_dir, file)): @@ -62,7 +62,11 @@ def smbtorture(share_name: str, test: str, tmp_output: Path) -> bool: flapping_list = ["flapping", "flapping.d"] share = testhelper.get_share(test_info, share_name) test_backend = share["backend"].get("name") - test_backend_variant = share["backend"].get("variant") + test_backend_variant = ( + share["backend"].get("method") + if share["backend"].get("method") is not None + else share["backend"].get("variant") + ) if test_backend is not None: file = flapping_file(test_backend, test_backend_variant) if file is not None: