generic/402: Drop useless fail message
[xfstests-dev.git] / tests / generic / 396
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2016 Google, Inc.  All Rights Reserved.
4 #
5 # FS QA Test generic/396
6 #
7 # Test that FS_IOC_SET_ENCRYPTION_POLICY correctly validates the fscrypt_policy
8 # structure that userspace passes to it.
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/filter
28 . ./common/encrypt
29
30 # remove previous $seqres.full before test
31 rm -f $seqres.full
32
33 # real QA test starts here
34 _supported_fs generic
35 _require_scratch_encryption
36
37 _scratch_mkfs_encrypted &>> $seqres.full
38 _scratch_mount
39 dir=$SCRATCH_MNT/dir
40 mkdir $dir
41
42 echo -e "\n*** Invalid contents encryption mode ***"
43 _set_encpolicy $dir -c 0xFF |& _filter_scratch
44
45 echo -e "\n*** Invalid filenames encryption mode ***"
46 _set_encpolicy $dir -n 0xFF |& _filter_scratch
47
48 echo -e "\n*** Invalid flags ***"
49 _set_encpolicy $dir -f 0xFF |& _filter_scratch
50
51 echo -e "\n*** Invalid policy version ***"
52 _set_encpolicy $dir -v 0xFF |& _filter_scratch
53
54 # Currently, the only supported combination of modes is AES-256-XTS for contents
55 # and AES-256-CTS for filenames.  Nothing else should be accepted.
56 echo -e "\n*** Invalid combinations of modes ***"
57 _set_encpolicy $dir -c AES-256-CTS -n AES-256-CTS |& _filter_scratch
58 _set_encpolicy $dir -c AES-256-CTS -n AES-256-XTS |& _filter_scratch
59 _set_encpolicy $dir -c AES-256-XTS -n AES-256-XTS |& _filter_scratch
60
61 # success, all done
62 status=0
63 exit