4 # Nested seed device test
6 # Create a sprout device
7 # Make the sprout device a seed device and create a sprout device again
9 #-----------------------------------------------------------------------
10 # Copyright (c) 2018 Oracle. All Rights Reserved.
12 # This program is free software; you can redistribute it and/or
13 # modify it under the terms of the GNU General Public License as
14 # published by the Free Software Foundation.
16 # This program is distributed in the hope that it would be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write the Free Software Foundation,
23 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 #-----------------------------------------------------------------------
28 seqres=$RESULT_DIR/$seq
29 echo "QA output created by $seq"
33 status=1 # failure is the default!
34 trap "_cleanup; exit \$status" 0 1 2 3 15
42 # get standard environment, filters and checks
45 . ./common/filter.btrfs
47 # remove previous $seqres.full before test
50 # real QA test starts here
52 # Modify as appropriate.
55 _require_command "$BTRFS_TUNE_PROG" btrfstune
56 _require_scratch_dev_pool 3
58 _scratch_dev_pool_get 3
60 dev_seed=$(echo $SCRATCH_DEV_POOL | awk '{print $1}')
61 dev_sprout_seed=$(echo $SCRATCH_DEV_POOL | awk '{print $2}')
62 dev_sprout=$(echo $SCRATCH_DEV_POOL | awk '{print $3}')
67 run_check _mount $dev_seed $SCRATCH_MNT
68 $XFS_IO_PROG -f -d -c "pwrite -S 0xab 0 256K" $SCRATCH_MNT/foobar >\
71 od -x $SCRATCH_MNT/foobar
72 _run_btrfs_util_prog filesystem show -m $SCRATCH_MNT
74 $BTRFS_TUNE_PROG -S 1 $dev_seed
79 run_check _mount $dev_seed $SCRATCH_MNT
80 _run_btrfs_util_prog device add -f $dev_sprout_seed $SCRATCH_MNT
82 $BTRFS_TUNE_PROG -S 1 $dev_sprout_seed
87 run_check _mount -o device=$dev_seed $dev_sprout_seed $SCRATCH_MNT
88 _run_btrfs_util_prog device add -f $dev_sprout $SCRATCH_MNT
90 run_check _mount -o device=$dev_seed,device=$dev_sprout_seed \
91 $dev_sprout $SCRATCH_MNT
93 od -x $SCRATCH_MNT/foobar
100 _scratch_dev_pool_put