Skip to content

Commit

Permalink
smbtorture: Find flapping list based on share name
Browse files Browse the repository at this point in the history
With samba-in-kubernetes/sit-environment#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 <anoopcs@cryptolab.net>
  • Loading branch information
anoopcs9 committed Aug 28, 2024
1 parent 5426d82 commit 0c84fa7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions testcases/smbtorture/test_smbtorture.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)):
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 0c84fa7

Please sign in to comment.