btrfs: convert tests to SPDX license tags
[xfstests-dev.git] / tests / btrfs / 090
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2015 Fujitsu, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. btrfs/090
6 #
7 # Check return value of "btrfs filesystem show" command executed on
8 # umounted device.
9 # It should return 0 if nothing wrong happens.
10 #
11 # Regression in v3.18 btrfs-progs and fixed by the following patch:
12 #
13 #    btrfs-progs: Fix wrong return value when executing 'fi show' on
14 #    umounted device.
15 #
16 seq=`basename $0`
17 seqres=$RESULT_DIR/$seq
18 echo "QA output created by $seq"
19
20 here=`pwd`
21 tmp=/tmp/$$
22 status=1        # failure is the default!
23 trap "_cleanup; exit \$status" 0 1 2 3 15
24
25 _cleanup()
26 {
27     cd /
28     rm -f $tmp.*
29 }
30
31 # get standard environment, filters and checks
32 . ./common/rc
33 . ./common/filter.btrfs
34
35 # real QA test starts here
36
37 # Modify as appropriate.
38 _supported_fs btrfs
39 _supported_os Linux
40 _require_scratch
41 _require_scratch_dev_pool
42
43 rm -f $seqres.full
44
45 FIRST_POOL_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $1}'`
46 TOTAL_DEVS=`echo $SCRATCH_DEV_POOL | wc -w`
47
48 _scratch_pool_mkfs >> $seqres.full 2>&1 || _fail "mkfs failed"
49
50 _run_btrfs_util_prog filesystem show $FIRST_POOL_DEV | \
51         _filter_btrfs_filesystem_show $TOTAL_DEVS
52
53 # success, all done
54 echo "Silence is golden"
55 status=0
56 exit