Skip to content

Commit

Permalink
smbtorture: Find flapping list based on method
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
anoopcs9 committed Aug 30, 2024
1 parent 5426d82 commit beefbd1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions testcases/smbtorture/test_smbtorture.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)):
Expand Down Expand Up @@ -62,7 +62,9 @@ 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:
Expand Down

0 comments on commit beefbd1

Please sign in to comment.