2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2013 Oracle. All Rights Reserved.
7 # Test to verify if the group profile is created
9 # The test aims to create the raid and verify that its created
12 seqres=$RESULT_DIR/$seq
13 echo "QA output created by $seq"
17 status=1 # failure is the default!
18 trap "_cleanup; exit \$status" 0 1 2 3 15
26 # get standard environment, filters and checks
30 # real QA test starts here
33 _require_scratch_dev_pool 4
36 create_group_profile()
38 local mkfs_options="-d$1 -m$1"
40 _scratch_pool_mkfs $mkfs_options >> $seqres.full 2>&1 || _fail "mkfs failed"
48 $BTRFS_UTIL_PROG filesystem df $SCRATCH_MNT > $tmp.tmp 2>&1
50 cat $tmp.tmp >> $seqres.full
51 grep Data $tmp.tmp | grep -q "${test_raid}:"
52 [ $? -eq 0 ] || _fail "$test_raid not found for Data"
53 grep Metadata $tmp.tmp | grep -q "${test_raid}:"
54 [ $? -eq 0 ] || _fail "$test_raid not found for Metadata"
57 create_group_profile "raid0"
58 check_group_profile "RAID0"
60 create_group_profile "raid1"
61 check_group_profile "RAID1"
63 create_group_profile "raid10"
64 check_group_profile "RAID10"
66 if [ -e "/sys/fs/btrfs/features/raid56" ]; then
67 create_group_profile "raid5"
68 check_group_profile "RAID5"
70 create_group_profile "raid6"
71 check_group_profile "RAID6"
75 echo "Silence is golden"