Skip to content

Commit

Permalink
smbtorture: Prefer method to find specific flapping list
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 09432ab
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
6 changes: 4 additions & 2 deletions test-info.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 7 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,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:
Expand Down

0 comments on commit 09432ab

Please sign in to comment.