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
32 _require_scratch_dev_pool 4
35 create_group_profile()
37 local mkfs_options="-d$1 -m$1"
39 _scratch_pool_mkfs $mkfs_options >> $seqres.full 2>&1 || _fail "mkfs failed"
47 $BTRFS_UTIL_PROG filesystem df $SCRATCH_MNT > $tmp.tmp 2>&1
49 cat $tmp.tmp >> $seqres.full
50 grep Data $tmp.tmp | grep -q "${test_raid}:"
51 [ $? -eq 0 ] || _fail "$test_raid not found for Data"
52 grep Metadata $tmp.tmp | grep -q "${test_raid}:"
53 [ $? -eq 0 ] || _fail "$test_raid not found for Metadata"
56 create_group_profile "raid0"
57 check_group_profile "RAID0"
59 create_group_profile "raid1"
60 check_group_profile "RAID1"
62 create_group_profile "raid10"
63 check_group_profile "RAID10"
65 if [ -e "/sys/fs/btrfs/features/raid56" ]; then
66 create_group_profile "raid5"
67 check_group_profile "RAID5"
69 create_group_profile "raid6"
70 check_group_profile "RAID6"
74 echo "Silence is golden"