aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorнаб <[email protected]>2022-03-11 01:42:32 +0100
committerBrian Behlendorf <[email protected]>2022-04-01 17:55:30 -0700
commit3886e7081ada7e4275ff20f7e42c19d3645af212 (patch)
treee3a8614f833f85c8afb48d303f1b67426cdcfeb7 /tests
parenta3dcc0aa0c0b7873265d0b014ea6133bd8e40591 (diff)
tests: zfs_unshare_006: log_unsupported iff usershares are actually off
Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: John Kennedy <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #13259
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test-runner/bin/zts-report.py.in2
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_006_pos.ksh23
2 files changed, 12 insertions, 13 deletions
diff --git a/tests/test-runner/bin/zts-report.py.in b/tests/test-runner/bin/zts-report.py.in
index e15d6bded..93d593791 100755
--- a/tests/test-runner/bin/zts-report.py.in
+++ b/tests/test-runner/bin/zts-report.py.in
@@ -162,7 +162,6 @@ known = {
'casenorm/mixed_none_lookup_ci': ['FAIL', '7633'],
'casenorm/mixed_formd_lookup_ci': ['FAIL', '7633'],
'cli_root/zfs_unshare/zfs_unshare_002_pos': ['SKIP', na_reason],
- 'cli_root/zfs_unshare/zfs_unshare_006_pos': ['SKIP', na_reason],
'cli_root/zpool_import/import_rewind_device_replaced':
['FAIL', rewind_reason],
'cli_user/misc/zfs_share_001_neg': ['SKIP', na_reason],
@@ -215,6 +214,7 @@ maybe = {
'cli_root/zfs_rollback/zfs_rollback_001_pos': ['FAIL', known_reason],
'cli_root/zfs_rollback/zfs_rollback_002_pos': ['FAIL', known_reason],
'cli_root/zfs_snapshot/zfs_snapshot_002_neg': ['FAIL', known_reason],
+ 'cli_root/zfs_unshare/zfs_unshare_006_pos': ['SKIP', na_reason],
'cli_root/zpool_add/zpool_add_004_pos': ['FAIL', known_reason],
'cli_root/zpool_destroy/zpool_destroy_001_pos': ['SKIP', '6145'],
'cli_root/zpool_import/zpool_import_missing_003_pos': ['SKIP', '6839'],
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_006_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_006_pos.ksh
index b4318020c..b6e5178cf 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_006_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_unshare/zfs_unshare_006_pos.ksh
@@ -41,9 +41,7 @@
verify_runnable "global"
-if is_linux; then
- log_unsupported "some distros come with Samba "user shares" disabled"
-fi
+[ -d "/var/lib/samba/usershares" ] || log_unsupported "Samba usershares disabled"
function cleanup
{
@@ -51,9 +49,10 @@ function cleanup
log_must zfs destroy -f $TESTPOOL/$TESTFS/shared1
log_must zfs destroy -f $TESTPOOL/$TESTFS/shared2
log_must zfs destroy -f $TESTPOOL/$TESTFS/shared3
+ log_must rm -f /var/lib/samba/usershares/testpool_testfs_shared{2,3}
}
-log_assert "Verify 'zfs unshare [nfs|smb] -a' only works on the specified "\
+log_assert "Verify 'zfs unshare [nfs|smb] -a' only works on the specified" \
"protocol."
log_onexit cleanup
@@ -74,19 +73,19 @@ log_must zfs share -a
log_must zfs unshare nfs -a
# 3. Verify that only nfs filesystems are unshared.
-log_must eval "not_shared $TESTPOOL/$TESTFS/shared1"
-log_must eval "not_shared $TESTPOOL/$TESTFS/shared2"
-log_must eval "is_shared_smb $TESTPOOL/$TESTFS/shared2"
-log_must eval "is_shared_smb $TESTPOOL/$TESTFS/shared3"
+log_must not_shared $TESTPOOL/$TESTFS/shared1
+log_must not_shared $TESTPOOL/$TESTFS/shared2
+log_must is_shared_smb $TESTPOOL/$TESTFS/shared2
+log_must is_shared_smb $TESTPOOL/$TESTFS/shared3
# 4. Share all filesystems again.
log_must zfs share -a
# 5. Invoke 'zfs unshare smb -a' and verify only smb filesystems are unshared.
log_must zfs unshare smb -a
-log_must eval "is_shared $TESTPOOL/$TESTFS/shared1"
-log_must eval "is_shared $TESTPOOL/$TESTFS/shared2"
-log_must eval "not_shared_smb $TESTPOOL/$TESTFS/shared2"
-log_must eval "not_shared_smb $TESTPOOL/$TESTFS/shared3"
+log_must is_shared $TESTPOOL/$TESTFS/shared1
+log_must is_shared $TESTPOOL/$TESTFS/shared2
+log_must not_shared_smb $TESTPOOL/$TESTFS/shared2
+log_must not_shared_smb $TESTPOOL/$TESTFS/shared3
log_pass "'zfs unshare [nfs|smb] -a' only works on the specified protocol."