Enable mountpoint_003_pos
Update the test case to correctly interpret how Linux reports the mount options. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: ChaoyuZhang <zhang.chaoyu@zte.com.cn> Closes #5410
This commit is contained in:
parent
4dec26e49a
commit
6c09d3e5a0
|
@ -167,8 +167,6 @@ tests = ['zfs_send_001_pos', 'zfs_send_002_pos', 'zfs_send_003_pos',
|
||||||
'zfs_send_004_neg', 'zfs_send_005_pos', 'zfs_send_006_pos',
|
'zfs_send_004_neg', 'zfs_send_005_pos', 'zfs_send_006_pos',
|
||||||
'zfs_send_007_pos']
|
'zfs_send_007_pos']
|
||||||
|
|
||||||
# DISABLED:
|
|
||||||
# mountpoint_003_pos - needs investigation
|
|
||||||
[tests/functional/cli_root/zfs_set]
|
[tests/functional/cli_root/zfs_set]
|
||||||
tests = ['cache_001_pos', 'cache_002_neg', 'canmount_001_pos',
|
tests = ['cache_001_pos', 'cache_002_neg', 'canmount_001_pos',
|
||||||
'canmount_002_pos', 'canmount_003_pos', 'canmount_004_pos',
|
'canmount_002_pos', 'canmount_003_pos', 'canmount_004_pos',
|
||||||
|
@ -178,7 +176,7 @@ tests = ['cache_001_pos', 'cache_002_neg', 'canmount_001_pos',
|
||||||
'user_property_001_pos', 'user_property_003_neg', 'readonly_001_pos',
|
'user_property_001_pos', 'user_property_003_neg', 'readonly_001_pos',
|
||||||
'user_property_004_pos', 'version_001_neg', 'zfs_set_001_neg',
|
'user_property_004_pos', 'version_001_neg', 'zfs_set_001_neg',
|
||||||
'zfs_set_002_neg', 'zfs_set_003_neg', 'property_alias_001_pos',
|
'zfs_set_002_neg', 'zfs_set_003_neg', 'property_alias_001_pos',
|
||||||
'ro_props_001_pos']
|
'ro_props_001_pos', 'mountpoint_003_pos']
|
||||||
|
|
||||||
# DISABLED: Tests need to be updated for Linux share behavior
|
# DISABLED: Tests need to be updated for Linux share behavior
|
||||||
# zfs_share_005_pos - needs investigation, probably unsupported NFS share format
|
# zfs_share_005_pos - needs investigation, probably unsupported NFS share format
|
||||||
|
|
|
@ -61,13 +61,13 @@ log_onexit cleanup
|
||||||
#
|
#
|
||||||
if is_linux; then
|
if is_linux; then
|
||||||
set -A args \
|
set -A args \
|
||||||
"dev" "/dev/" "nodev" "/nodev/" \
|
"nodev" "dev" \
|
||||||
"exec" "/exec/" "noexec" "/noexec/" \
|
"noexec" "exec" \
|
||||||
"mand" "/mand/" "nomand" "/nomand/" \
|
"mand" "nomand" \
|
||||||
"ro" "read only" "rw" "read/write" \
|
"ro" "rw" \
|
||||||
"suid" "/suid/" "nosuid" "/nosuid/" \
|
"nosuid" "suid" \
|
||||||
"xattr" "/xattr/" "noxattr" "/noxattr/" \
|
"xattr" "noxattr" \
|
||||||
"atime" "/atime/" "noatime" "/noatime/"
|
"atime" "noatime"
|
||||||
else
|
else
|
||||||
set -A args \
|
set -A args \
|
||||||
"devices" "/devices/" "nodevices" "/nodevices/" \
|
"devices" "/devices/" "nodevices" "/nodevices/" \
|
||||||
|
@ -90,26 +90,40 @@ typeset i=0
|
||||||
while ((i < ${#args[@]})); do
|
while ((i < ${#args[@]})); do
|
||||||
if is_linux; then
|
if is_linux; then
|
||||||
log_must $MOUNT -t zfs -o ${args[$i]} $testfs $tmpmnt
|
log_must $MOUNT -t zfs -o ${args[$i]} $testfs $tmpmnt
|
||||||
|
|
||||||
|
msg=$($MOUNT | $GREP "$tmpmnt ")
|
||||||
|
|
||||||
|
$ECHO $msg | $GREP "${args[((i))]}" > /dev/null 2>&1
|
||||||
|
if (($? != 0)) ; then
|
||||||
|
$ECHO $msg | $GREP "${args[((i-1))]}" > /dev/null 2>&1
|
||||||
|
if (($? == 0)) ; then
|
||||||
|
log_fail "Expected option: ${args[((i))]} \n" \
|
||||||
|
"Real option: $msg"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
log_must $UMOUNT $tmpmnt
|
||||||
|
((i += 1))
|
||||||
else
|
else
|
||||||
log_must $MOUNT -F zfs -o ${args[$i]} $testfs $tmpmnt
|
log_must $MOUNT -F zfs -o ${args[$i]} $testfs $tmpmnt
|
||||||
fi
|
|
||||||
msg=$($MOUNT | $GREP "^$tmpmnt ")
|
|
||||||
|
|
||||||
if ! is_linux; then
|
msg=$($MOUNT | $GREP "^$tmpmnt ")
|
||||||
|
|
||||||
# In LZ, a user with all zone privileges can never "devices"
|
# In LZ, a user with all zone privileges can never "devices"
|
||||||
if ! is_global_zone && [[ ${args[$i]} == devices ]] ; then
|
if ! is_global_zone && [[ ${args[$i]} == devices ]] ; then
|
||||||
args[((i+1))]="/nodevices/"
|
args[((i+1))]="/nodevices/"
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
$ECHO $msg | $GREP "${args[((i+1))]}" > /dev/null 2>&1
|
$ECHO $msg | $GREP "${args[((i+1))]}" > /dev/null 2>&1
|
||||||
if (($? != 0)) ; then
|
if (($? != 0)) ; then
|
||||||
log_fail "Expected option: ${args[((i+1))]} \n" \
|
log_fail "Expected option: ${args[((i+1))]} \n" \
|
||||||
"Real option: $msg"
|
"Real option: $msg"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
log_must $UMOUNT $tmpmnt
|
|
||||||
((i += 2))
|
log_must $UMOUNT $tmpmnt
|
||||||
|
((i += 2))
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
log_pass "With legacy mount, FSType-specific option works well passed."
|
log_pass "With legacy mount, FSType-specific option works well passed."
|
||||||
|
|
Loading…
Reference in New Issue