Skip to content

Commit beefbd1

Browse files
committed
smbtorture: Find flapping list based on method
samba-in-kubernetes/sit-environment#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 <[email protected]>
1 parent 5426d82 commit beefbd1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

testcases/smbtorture/test_smbtorture.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323

2424
def flapping_file(backend: str, variant: str = "") -> str:
2525
file = "flapping." + backend
26-
if variant and variant != "default":
27-
file_variant = f"{file}-{variant}"
26+
if variant and "vfs" in variant:
27+
file_variant = f"{file}-vfs"
2828
if os.path.exists(os.path.join(selftest_dir, file_variant)):
2929
return file_variant
3030
if os.path.exists(os.path.join(selftest_dir, file)):
@@ -62,7 +62,9 @@ def smbtorture(share_name: str, test: str, tmp_output: Path) -> bool:
6262
flapping_list = ["flapping", "flapping.d"]
6363
share = testhelper.get_share(test_info, share_name)
6464
test_backend = share["backend"].get("name")
65-
test_backend_variant = share["backend"].get("variant")
65+
test_backend_variant = share["backend"].get("method")
66+
if share["backend"].get("method") is not None
67+
else share["backend"].get("variant")
6668
if test_backend is not None:
6769
file = flapping_file(test_backend, test_backend_variant)
6870
if file is not None:

0 commit comments

Comments
 (0)