]> xenbits.xensource.com Git - people/royger/freebsd.git/commitdiff
Fix ls_tests:o_flag with ZFS TMPDIR master
authorasomers <asomers@FreeBSD.org>
Thu, 15 Dec 2016 16:13:52 +0000 (16:13 +0000)
committerasomers <asomers@FreeBSD.org>
Thu, 15 Dec 2016 16:13:52 +0000 (16:13 +0000)
Unlike UFS or TMPFS, ZFS sets uarch automatically whenever a file is
updated. The test must explicitly clear uarch to be portable across
filesystems. Also, it doesn't need to run as root.

PR: 215179
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D8741

bin/ls/tests/ls_tests.sh

index 32ead03148525639f598df75f0aa340c9073ffdd..14f7895e699c5336614461569f108c3db6ed19fb 100755 (executable)
@@ -697,7 +697,6 @@ atf_test_case o_flag
 o_flag_head()
 {
        atf_set "descr" "Verify that the output from ls -o prints out the chflag values or '-' if none are set"
 o_flag_head()
 {
        atf_set "descr" "Verify that the output from ls -o prints out the chflag values or '-' if none are set"
-       atf_set "require.user" "root"
 }
 
 o_flag_body()
 }
 
 o_flag_body()
@@ -711,6 +710,7 @@ o_flag_body()
        atf_check -e ignore -o empty -s exit:0 dd if=/dev/zero of=b.file \
            bs=$size count=1
        atf_check -e empty -o empty -s exit:0 chflags uarch a.file
        atf_check -e ignore -o empty -s exit:0 dd if=/dev/zero of=b.file \
            bs=$size count=1
        atf_check -e empty -o empty -s exit:0 chflags uarch a.file
+       atf_check -e empty -o empty -s exit:0 chflags 0 b.file
 
        atf_check -e empty -o match:"[[:space:]]+uarch[[:space:]]$size+.+a\\.file" \
            -s exit:0 ls -lo a.file
 
        atf_check -e empty -o match:"[[:space:]]+uarch[[:space:]]$size+.+a\\.file" \
            -s exit:0 ls -lo a.file