Date: Thu, 24 Aug 2017 13:39:24 +0000 (UTC) From: Glen Barber <gjb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322835 - stable/10/usr.sbin/chown/tests Message-ID: <201708241339.v7ODdOIU097292@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: gjb Date: Thu Aug 24 13:39:24 2017 New Revision: 322835 URL: https://svnweb.freebsd.org/changeset/base/322835 Log: 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. Approved by: re (marius) Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/chown/tests/chown_test.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/chown/tests/chown_test.sh ============================================================================== --- stable/10/usr.sbin/chown/tests/chown_test.sh Thu Aug 24 13:37:22 2017 (r322834) +++ stable/10/usr.sbin/chown/tests/chown_test.sh Thu Aug 24 13:39:24 2017 (r322835) @@ -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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201708241339.v7ODdOIU097292>