svn commit: r322770 - head/usr.sbin/chown/tests

Glen Barber gjb at FreeBSD.org
Mon Aug 21 20:23:07 UTC 2017


Author: gjb
Date: Mon Aug 21 20:23:05 2017
New Revision: 322770
URL: https://svnweb.freebsd.org/changeset/base/322770

Log:
  Apply changes from bin/chmod/tests/chmod_test.sh (r321949, r321950,
  and r322101), adding atf_expect_fail() before chflags(8) is invoked
  if the filesystem is ZFS, which does not support UF_IMMUTABLE.
  
  MFC after:	3 days
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/usr.sbin/chown/tests/chown_test.sh

Modified: head/usr.sbin/chown/tests/chown_test.sh
==============================================================================
--- head/usr.sbin/chown/tests/chown_test.sh	Mon Aug 21 18:12:32 2017	(r322769)
+++ head/usr.sbin/chown/tests/chown_test.sh	Mon Aug 21 20:23:05 2017	(r322770)
@@ -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
@@ -144,6 +156,11 @@ v_flag_body()
 	atf_check truncate -s 0 foo bar
 	atf_check chown 0:0 foo
 	atf_check chown 42:42 bar
+	case "$(get_filesystem .)" in
+	zfs)
+		atf_expect_fail "ZFS updates mode for foo unnecessarily"
+		;;
+	esac
 	atf_check -o 'inline:bar\n' chown -v 0:0 foo bar
 	atf_check chown -v 0:0 foo bar
 	for f in foo bar; do


More information about the svn-src-all mailing list