From 0c84fa746e41840500afb73c79078dd3e2a3da06 Mon Sep 17 00:00:00 2001 From: Anoop C S Date: Wed, 28 Aug 2024 12:31:31 +0530 Subject: [PATCH] smbtorture: Find flapping list based on share name With https://github.com/samba-in-kubernetes/sit-environment/pull/117, 'variant' no longer indicates the method through which a particular share is configured for client access. Instead determine the need for VFS specific flapping file using the share name itself. Signed-off-by: Anoop C S --- testcases/smbtorture/test_smbtorture.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/testcases/smbtorture/test_smbtorture.py b/testcases/smbtorture/test_smbtorture.py index f501d48..4ae85b1 100755 --- a/testcases/smbtorture/test_smbtorture.py +++ b/testcases/smbtorture/test_smbtorture.py @@ -21,10 +21,10 @@ test_info = testhelper.read_yaml(test_info_file) -def flapping_file(backend: str, variant: str = "") -> str: +def flapping_file(backend: str, share_name: str) -> str: file = "flapping." + backend - if variant and variant != "default": - file_variant = f"{file}-{variant}" + if 'vfs' in share_name: + 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,9 +62,8 @@ 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") if test_backend is not None: - file = flapping_file(test_backend, test_backend_variant) + file = flapping_file(test_backend, share_name) if file is not None: flapping_list.append(file) for filter in flapping_list: