diff options
author | ChaoyuZhang <[email protected]> | 2016-12-03 02:20:57 +0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2016-12-02 11:20:57 -0700 |
commit | 6c09d3e5a04db023536aab467064cad3f7858776 (patch) | |
tree | e0fe9c6fb0cedd12ff4b7c511971985422980e32 /tests | |
parent | 4dec26e49a8c2fefb357158a87c9756f14c31697 (diff) |
Enable mountpoint_003_pos
Update the test case to correctly interpret how Linux reports
the mount options.
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: ChaoyuZhang <[email protected]>
Closes #5410
Diffstat (limited to 'tests')
-rw-r--r-- | tests/runfiles/linux.run | 4 | ||||
-rwxr-xr-x | tests/zfs-tests/tests/functional/cli_root/zfs_set/mountpoint_003_pos.ksh | 50 |
2 files changed, 33 insertions, 21 deletions
diff --git a/tests/runfiles/linux.run b/tests/runfiles/linux.run index 0b29787ae..c187960dc 100644 --- a/tests/runfiles/linux.run +++ b/tests/runfiles/linux.run @@ -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_007_pos'] -# DISABLED: -# mountpoint_003_pos - needs investigation [tests/functional/cli_root/zfs_set] tests = ['cache_001_pos', 'cache_002_neg', 'canmount_001_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_004_pos', 'version_001_neg', 'zfs_set_001_neg', '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 # zfs_share_005_pos - needs investigation, probably unsupported NFS share format diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_set/mountpoint_003_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_set/mountpoint_003_pos.ksh index ce427c105..b160c8104 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zfs_set/mountpoint_003_pos.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zfs_set/mountpoint_003_pos.ksh @@ -61,13 +61,13 @@ log_onexit cleanup # if is_linux; then set -A args \ - "dev" "/dev/" "nodev" "/nodev/" \ - "exec" "/exec/" "noexec" "/noexec/" \ - "mand" "/mand/" "nomand" "/nomand/" \ - "ro" "read only" "rw" "read/write" \ - "suid" "/suid/" "nosuid" "/nosuid/" \ - "xattr" "/xattr/" "noxattr" "/noxattr/" \ - "atime" "/atime/" "noatime" "/noatime/" + "nodev" "dev" \ + "noexec" "exec" \ + "mand" "nomand" \ + "ro" "rw" \ + "nosuid" "suid" \ + "xattr" "noxattr" \ + "atime" "noatime" else set -A args \ "devices" "/devices/" "nodevices" "/nodevices/" \ @@ -90,26 +90,40 @@ typeset i=0 while ((i < ${#args[@]})); do if is_linux; then 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 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" if ! is_global_zone && [[ ${args[$i]} == devices ]] ; then args[((i+1))]="/nodevices/" fi - fi - $ECHO $msg | $GREP "${args[((i+1))]}" > /dev/null 2>&1 - if (($? != 0)) ; then - log_fail "Expected option: ${args[((i+1))]} \n" \ - "Real option: $msg" - fi + $ECHO $msg | $GREP "${args[((i+1))]}" > /dev/null 2>&1 + if (($? != 0)) ; then + log_fail "Expected option: ${args[((i+1))]} \n" \ + "Real option: $msg" + fi + - log_must $UMOUNT $tmpmnt - ((i += 2)) + log_must $UMOUNT $tmpmnt + ((i += 2)) + fi done log_pass "With legacy mount, FSType-specific option works well passed." |