generic: test adding filesystem-level fscrypt key via key_id
[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 _supported_os Linux
33 _require_scratch
34 _require_test_program "dirhash_collide"
35
36 rm -f $seqres.full
37 _scratch_mkfs >>$seqres.full 2>&1
38 _scratch_mount
39
40 echo "Silence is golden"
41
42 testdir=$SCRATCH_MNT/$seq.$$
43 mkdir -p $testdir
44 $here/src/dirhash_collide -d -n 10000 $testdir >>$seqres.full 2>&1
45
46 # check the scratch device
47 _scratch_unmount
48 _check_scratch_fs
49
50 # remove all test dirs and let test harness check scratch fs again
51 _scratch_mount
52 rm -rf $testdir
53
54 # success, all done
55 status=0
56 exit