summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2017-08-19 01:21:46 +0000
committerngie <ngie@FreeBSD.org>2017-08-19 01:21:46 +0000
commitb82e58ea7a8199a9fdab1f5657b6b31f22d5644c (patch)
treeba36843c42d57d53df67254cd7b3c49ef405e68c /bin
parent2621dd679140e999bfa5695e6952fdaf6f3b66f5 (diff)
downloadFreeBSD-src-b82e58ea7a8199a9fdab1f5657b6b31f22d5644c.zip
FreeBSD-src-b82e58ea7a8199a9fdab1f5657b6b31f22d5644c.tar.gz
MFC r321949,r321950,r322101:
r321949: Add expected failures for ZFS - :f_flag fails on ZFS because UF_IMMUTABLE isn't supported [1]. - :v_flag fails on ZFS because the mode for foo is [always] updated unnecessarily. get_filesystem(..) (supporting function that was added to the test script) is based on equivalent logic in usr.bin/extattr/tests/extattr_test.sh . PR: 221189 [1], 221188 [2] r321950: Always use first parameter passed to get_filesystem(..) instead of discarding it and using `.` instead. MFC with: r321949 PR: 221189 [1], 221188 [2] r322101: Don't check result of chflags in f_flag_cleanup() This will prevent false positives from occurring if the test is run on ZFS since ZFS doesn't support fflags throbbing like UFS. PR: 221189 MFC with: r321949
Diffstat (limited to 'bin')
-rwxr-xr-xbin/chmod/tests/chmod_test.sh19
1 files changed, 18 insertions, 1 deletions
diff --git a/bin/chmod/tests/chmod_test.sh b/bin/chmod/tests/chmod_test.sh
index 4a6a6a3..8cd7663 100755
--- a/bin/chmod/tests/chmod_test.sh
+++ b/bin/chmod/tests/chmod_test.sh
@@ -25,6 +25,13 @@
#
# $FreeBSD$
+get_filesystem()
+{
+ local mountpoint=$1
+
+ df -T $mountpoint | tail -n 1 | cut -wf 2
+}
+
atf_test_case RH_flag
RH_flag_head()
{
@@ -94,6 +101,11 @@ f_flag_body()
{
atf_check truncate -s 0 foo bar
atf_check chmod 0750 foo bar
+ case "$(get_filesystem .)" in
+ zfs)
+ atf_expect_fail "ZFS doesn't support UF_IMMUTABLE; returns EPERM - bug 221189"
+ ;;
+ esac
atf_check chflags uchg foo
atf_check -e not-empty -s not-exit:0 chmod 0700 foo bar
atf_check -o inline:'100750\n100700\n' stat -f '%p' foo bar
@@ -103,7 +115,7 @@ f_flag_body()
f_flag_cleanup()
{
- atf_check chflags 0 foo
+ chflags 0 foo || :
}
atf_test_case h_flag
@@ -140,6 +152,11 @@ v_flag_body()
atf_check truncate -s 0 foo bar
atf_check chmod 0600 foo
atf_check chmod 0750 bar
+ case "$(get_filesystem .)" in
+ zfs)
+ atf_expect_fail "ZFS updates mode for foo unnecessarily - bug 221188"
+ ;;
+ esac
atf_check -o 'inline:bar\n' chmod -v 0600 foo bar
atf_check chmod -v 0600 foo bar
for f in foo bar; do
OpenPOWER on IntegriCloud