From owner-svn-src-stable@freebsd.org Thu Aug 24 13:37:23 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDC2CDDFB7F; Thu, 24 Aug 2017 13:37:23 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B8A157C3C8; Thu, 24 Aug 2017 13:37:23 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7ODbMR3097183; Thu, 24 Aug 2017 13:37:22 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7ODbMev097182; Thu, 24 Aug 2017 13:37:22 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201708241337.v7ODbMev097182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 24 Aug 2017 13:37:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r322834 - stable/11/usr.sbin/chown/tests X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/usr.sbin/chown/tests X-SVN-Commit-Revision: 322834 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Aug 2017 13:37:24 -0000 Author: gjb Date: Thu Aug 24 13:37:22 2017 New Revision: 322834 URL: https://svnweb.freebsd.org/changeset/base/322834 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. Sponsored by: The FreeBSD Foundation Modified: stable/11/usr.sbin/chown/tests/chown_test.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/chown/tests/chown_test.sh ============================================================================== --- stable/11/usr.sbin/chown/tests/chown_test.sh Thu Aug 24 10:57:34 2017 (r322833) +++ stable/11/usr.sbin/chown/tests/chown_test.sh Thu Aug 24 13:37:22 2017 (r322834) @@ -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