Date: Tue, 26 Jan 2016 20:45:41 +0000 (UTC) From: Alan Somers <asomers@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: r294850 - stable/10/usr.bin/truncate/tests Message-ID: <201601262045.u0QKjfvd059675@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: asomers Date: Tue Jan 26 20:45:41 2016 New Revision: 294850 URL: https://svnweb.freebsd.org/changeset/base/294850 Log: MFC r294347 Fix usr.bin.truncate.truncate_test.bad_truncate with ZFS /tmp. The bad_truncate test sets the uimmutable flag to produce an error in truncate, but that flag isn't supported by ZFS. If /tmp is on a ZFS filesystem, the test will fail. Change it to use readonly permissions and an unpriveleged user instead. Modified: stable/10/usr.bin/truncate/tests/truncate_test.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/truncate/tests/truncate_test.sh ============================================================================== --- stable/10/usr.bin/truncate/tests/truncate_test.sh Tue Jan 26 19:07:09 2016 (r294849) +++ stable/10/usr.bin/truncate/tests/truncate_test.sh Tue Jan 26 20:45:41 2016 (r294850) @@ -173,26 +173,23 @@ bad_refer_body() [ ! -e afile ] || atf_fail "afile should not exist" } -atf_test_case bad_truncate cleanup +atf_test_case bad_truncate bad_truncate_head() { atf_set "descr" "Verifies that truncate reports an error during" \ "truncation" + atf_set "require.user" "unprivileged" } bad_truncate_body() { - create_stderr_file "truncate: exists.txt: Operation not permitted" + create_stderr_file "truncate: exists.txt: Permission denied" # Trying to get the ftruncate() call to return -1. > exists.txt - atf_check chflags uimmutable exists.txt + atf_check chmod 444 exists.txt atf_check -s not-exit:0 -e file:stderr.txt truncate -s1 exists.txt } -bad_truncate_cleanup() -{ - chflags 0 exists.txt -} atf_test_case new_absolute_grow new_absolute_grow_head()
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601262045.u0QKjfvd059675>