xfs/{263,106}: erase max warnings printout
[xfstests-dev.git] / tests / btrfs / 216
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2020 Oracle.  All Rights Reserved.
4 #
5 # FS QA Test 216
6 #
7 # Test if the show_devname() returns sprout device instead of seed device.
8 #
9 # Fixed in kernel patch:
10 #   btrfs: btrfs_show_devname don't traverse into the seed fsid
11
12 seq=`basename $0`
13 seqres=$RESULT_DIR/$seq
14 echo "QA output created by $seq"
15
16 here=`pwd`
17 tmp=/tmp/$$
18 status=1        # failure is the default!
19 trap "_cleanup; exit \$status" 0 1 2 3 15
20
21 _cleanup()
22 {
23         cd /
24         rm -f $tmp.*
25 }
26
27 # get standard environment, filters and checks
28 . ./common/rc
29 . ./common/filter
30
31 # remove previous $seqres.full before test
32 rm -f $seqres.full
33
34 # real QA test starts here
35 _supported_fs btrfs
36 _supported_os Linux
37 _require_scratch_dev_pool 2
38
39 _scratch_dev_pool_get 2
40
41 seed=$(echo $SCRATCH_DEV_POOL | awk '{print $1}')
42 sprout=$(echo $SCRATCH_DEV_POOL | awk '{print $2}')
43
44 _mkfs_dev $seed
45 $BTRFS_TUNE_PROG -S 1 $seed
46 _mount $seed $SCRATCH_MNT >> $seqres.full 2>&1
47 cat /proc/self/mounts | grep $seed >> $seqres.full
48 $BTRFS_UTIL_PROG device add -f $sprout $SCRATCH_MNT
49 cat /proc/self/mounts | grep $sprout >> $seqres.full
50
51 # check if the show_devname() returns the sprout device instead of seed device.
52 dev=$(grep $SCRATCH_MNT /proc/self/mounts | $AWK_PROG '{print $1}')
53
54 if [ "$sprout" != "$dev" ]; then
55         echo "Unexpected device: $dev, expected $sprout"
56 fi
57 echo "Silence is golden"
58
59 _scratch_dev_pool_put
60
61 # success, all done
62 status=0
63 exit