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:
parent
a3dcc0aa0c
commit
3886e7081a
|
@ -162,7 +162,6 @@ known = {
|
||||||
'casenorm/mixed_none_lookup_ci': ['FAIL', '7633'],
|
'casenorm/mixed_none_lookup_ci': ['FAIL', '7633'],
|
||||||
'casenorm/mixed_formd_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_002_pos': ['SKIP', na_reason],
|
||||||
'cli_root/zfs_unshare/zfs_unshare_006_pos': ['SKIP', na_reason],
|
|
||||||
'cli_root/zpool_import/import_rewind_device_replaced':
|
'cli_root/zpool_import/import_rewind_device_replaced':
|
||||||
['FAIL', rewind_reason],
|
['FAIL', rewind_reason],
|
||||||
'cli_user/misc/zfs_share_001_neg': ['SKIP', na_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_001_pos': ['FAIL', known_reason],
|
||||||
'cli_root/zfs_rollback/zfs_rollback_002_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_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_add/zpool_add_004_pos': ['FAIL', known_reason],
|
||||||
'cli_root/zpool_destroy/zpool_destroy_001_pos': ['SKIP', '6145'],
|
'cli_root/zpool_destroy/zpool_destroy_001_pos': ['SKIP', '6145'],
|
||||||
'cli_root/zpool_import/zpool_import_missing_003_pos': ['SKIP', '6839'],
|
'cli_root/zpool_import/zpool_import_missing_003_pos': ['SKIP', '6839'],
|
||||||
|
|
|
@ -41,9 +41,7 @@
|
||||||
|
|
||||||
verify_runnable "global"
|
verify_runnable "global"
|
||||||
|
|
||||||
if is_linux; then
|
[ -d "/var/lib/samba/usershares" ] || log_unsupported "Samba usershares disabled"
|
||||||
log_unsupported "some distros come with Samba "user shares" disabled"
|
|
||||||
fi
|
|
||||||
|
|
||||||
function cleanup
|
function cleanup
|
||||||
{
|
{
|
||||||
|
@ -51,9 +49,10 @@ function cleanup
|
||||||
log_must zfs destroy -f $TESTPOOL/$TESTFS/shared1
|
log_must zfs destroy -f $TESTPOOL/$TESTFS/shared1
|
||||||
log_must zfs destroy -f $TESTPOOL/$TESTFS/shared2
|
log_must zfs destroy -f $TESTPOOL/$TESTFS/shared2
|
||||||
log_must zfs destroy -f $TESTPOOL/$TESTFS/shared3
|
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."
|
"protocol."
|
||||||
log_onexit cleanup
|
log_onexit cleanup
|
||||||
|
|
||||||
|
@ -74,19 +73,19 @@ log_must zfs share -a
|
||||||
log_must zfs unshare nfs -a
|
log_must zfs unshare nfs -a
|
||||||
|
|
||||||
# 3. Verify that only nfs filesystems are unshared.
|
# 3. Verify that only nfs filesystems are unshared.
|
||||||
log_must eval "not_shared $TESTPOOL/$TESTFS/shared1"
|
log_must not_shared $TESTPOOL/$TESTFS/shared1
|
||||||
log_must eval "not_shared $TESTPOOL/$TESTFS/shared2"
|
log_must not_shared $TESTPOOL/$TESTFS/shared2
|
||||||
log_must eval "is_shared_smb $TESTPOOL/$TESTFS/shared2"
|
log_must is_shared_smb $TESTPOOL/$TESTFS/shared2
|
||||||
log_must eval "is_shared_smb $TESTPOOL/$TESTFS/shared3"
|
log_must is_shared_smb $TESTPOOL/$TESTFS/shared3
|
||||||
|
|
||||||
# 4. Share all filesystems again.
|
# 4. Share all filesystems again.
|
||||||
log_must zfs share -a
|
log_must zfs share -a
|
||||||
|
|
||||||
# 5. Invoke 'zfs unshare smb -a' and verify only smb filesystems are unshared.
|
# 5. Invoke 'zfs unshare smb -a' and verify only smb filesystems are unshared.
|
||||||
log_must zfs unshare smb -a
|
log_must zfs unshare smb -a
|
||||||
log_must eval "is_shared $TESTPOOL/$TESTFS/shared1"
|
log_must is_shared $TESTPOOL/$TESTFS/shared1
|
||||||
log_must eval "is_shared $TESTPOOL/$TESTFS/shared2"
|
log_must is_shared $TESTPOOL/$TESTFS/shared2
|
||||||
log_must eval "not_shared_smb $TESTPOOL/$TESTFS/shared2"
|
log_must not_shared_smb $TESTPOOL/$TESTFS/shared2
|
||||||
log_must eval "not_shared_smb $TESTPOOL/$TESTFS/shared3"
|
log_must not_shared_smb $TESTPOOL/$TESTFS/shared3
|
||||||
|
|
||||||
log_pass "'zfs unshare [nfs|smb] -a' only works on the specified protocol."
|
log_pass "'zfs unshare [nfs|smb] -a' only works on the specified protocol."
|
||||||
|
|
Loading…
Reference in New Issue