ZTS: parameter expansion in zfs_unshare_006_pos

zfs_unshare_006 checks to see if a dataset still has an active SMB
share after doing an NFS unshare -a. The test could fail because the
check for the SMB share does not expect dashes in a dataset name to be
converted to underscores as pathname delimiters are.

Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com>
Signed-off-by: John Kennedy <john.kennedy@delphix.com>
Closes #13893
This commit is contained in:
John Wren Kennedy 2022-09-15 14:14:35 -06:00 committed by GitHub
parent 621a7ebe58
commit dc2fe24ca2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1265,7 +1265,7 @@ function is_shared_smb
datasetexists "$fs" || return datasetexists "$fs" || return
if is_linux; then if is_linux; then
net usershare list | grep -xFq "${fs//\//_}" net usershare list | grep -xFq "${fs//[-\/]/_}"
else else
log_note "SMB on $UNAME currently unsupported by the test framework" log_note "SMB on $UNAME currently unsupported by the test framework"
return 1 return 1