summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgjb <gjb@FreeBSD.org>2017-08-24 13:37:22 +0000
committergjb <gjb@FreeBSD.org>2017-08-24 13:37:22 +0000
commit587b1e174dc86768af7c246ff222731ff110adca (patch)
tree561f0a8e815d119e65da0e7febbb9939879de119
parent99bef6731786129c2ff6c789a8b5d6e4f619be70 (diff)
downloadFreeBSD-src-587b1e174dc86768af7c246ff222731ff110adca.zip
FreeBSD-src-587b1e174dc86768af7c246ff222731ff110adca.tar.gz
MFC r322770, r322796:
r322770: Apply changes from bin/chmod/tests/chmod_test.sh, adding atf_expect_fail() before chflags(8) is invoked if the filesystem is ZFS, which does not support UF_IMMUTABLE. r322796: Revert part of r322770 in usr.sbin/chown/tests/chown_test.sh, which incorrectly adds atf_expect_fail() where there is no failure case. Sponsored by: The FreeBSD Foundation
-rwxr-xr-xusr.sbin/chown/tests/chown_test.sh14
1 files changed, 13 insertions, 1 deletions
diff --git a/usr.sbin/chown/tests/chown_test.sh b/usr.sbin/chown/tests/chown_test.sh
index a5e55f9..b8b85ab 100755
--- a/usr.sbin/chown/tests/chown_test.sh
+++ b/usr.sbin/chown/tests/chown_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()
{
@@ -98,6 +105,11 @@ f_flag_body()
{
atf_check truncate -s 0 foo bar
atf_check chown 0:0 foo bar
+ case "$(get_filesystem .)" in
+ zfs)
+ atf_expect_fail "ZFS does not support UF_IMMUTABLE; returns EPERM"
+ ;;
+ esac
atf_check chflags uchg foo
atf_check -e not-empty -s not-exit:0 chown 42:42 foo bar
atf_check -o inline:'0:0\n42:42\n' stat -f '%u:%g' foo bar
@@ -107,7 +119,7 @@ f_flag_body()
f_flag_cleanup()
{
- atf_check chflags 0 foo
+ chflags 0 foo || :
}
atf_test_case h_flag
OpenPOWER on IntegriCloud