tests: zfs_unshare_006: log_unsupported iff usershares are actually off

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13259
This commit is contained in:
наб 2022-03-11 01:42:32 +01:00 committed by Brian Behlendorf
parent a3dcc0aa0c
commit 3886e7081a
2 changed files with 12 additions and 13 deletions

View File

@ -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'],

View File

@ -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,6 +49,7 @@ 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" \
@ -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."