generic/611: Use _getfattr instead of GETFATTR_PROG
[xfstests-dev.git] / tests / generic / 339
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2014 Hannes Frederic Sowa.  All Rights Reserved.
4 #
5 # FS QA Test No. 339
6 #
7 # Test that directory hash entries are place in the correct order.
8 # commit f5ea110 ("xfs: add CRCs to dir2/da node blocks") left the
9 # directory with incorrect hash ordering.
10 #
11 seq=`basename $0`
12 seqres=$RESULT_DIR/$seq
13 echo "QA output created by $seq"
14
15 here=`pwd`
16 tmp=/tmp/$$
17 status=1        # failure is the default!
18 trap "_cleanup; exit \$status" 0 1 2 3 15
19
20 _cleanup()
21 {
22         cd /
23         rm -f $tmp.*
24 }
25
26 # get standard environment, filters and checks
27 . ./common/rc
28 . ./common/filter
29
30 # real QA test starts here
31 _supported_fs generic
32 _require_scratch
33 _require_test_program "dirhash_collide"
34
35 rm -f $seqres.full
36 _scratch_mkfs >>$seqres.full 2>&1
37 _scratch_mount
38
39 echo "Silence is golden"
40
41 testdir=$SCRATCH_MNT/$seq.$$
42 mkdir -p $testdir
43 $here/src/dirhash_collide -d -n 10000 $testdir >>$seqres.full 2>&1
44
45 # check the scratch device
46 _scratch_unmount
47 _check_scratch_fs
48
49 # remove all test dirs and let test harness check scratch fs again
50 _scratch_mount
51 rm -rf $testdir
52
53 # success, all done
54 status=0
55 exit