fstests: use _require_symlinks on all necessary tests
[xfstests-dev.git] / tests / generic / 389
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2016 Red Hat, Inc.  All Rights Reserved.
4 #
5 # FS QA Test 389
6 #
7 # Test if O_TMPFILE files inherit POSIX Default ACLs when they are linked into
8 # the namespace.
9 #
10 seq=`basename $0`
11 seqres=$RESULT_DIR/$seq
12 echo "QA output created by $seq"
13
14 here=`pwd`
15 tmp=/tmp/$$
16 status=1        # failure is the default!
17 trap "_cleanup; exit \$status" 0 1 2 3 15
18
19 _cleanup()
20 {
21         cd /
22         rm -f $tmp.*
23 }
24
25 # get standard environment, filters and checks
26 . ./common/rc
27 . ./common/attr
28 . ./common/filter
29
30 # real QA test starts here
31 _supported_fs generic
32 _supported_os Linux
33
34 _require_test
35 _require_xfs_io_command "-T"
36 _require_xfs_io_command "flink"
37 _require_acls
38
39 # remove previous $seqres.full before test
40 rm -f $seqres.full
41
42 testdir="${TEST_DIR}/d.$seq"
43 testfile="${testdir}/tst-tmpfile-flink"
44
45 umask 022
46 rm -rf ${testdir}
47 mkdir -p ${testdir}
48 setfacl -d -m u::rwx,g::rwx,o::rx ${testdir}
49 $XFS_IO_PROG -T -m 0666 \
50         -c "pwrite 0 4096" \
51         -c "pread 0 4096" \
52         -c "flink ${testfile}" \
53         ${testdir} | _filter_xfs_io
54 stat -c '%a' ${testfile}
55
56 # success, all done
57 status=0
58 exit