Make xfstests build use -O2 by default.
[xfstests-dev.git] / 045
1 #! /bin/sh
2 # FS QA Test No. 045
3 #
4 # test mount of two FSes with identical UUID and mount with unknown option
5 #
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
8 #-----------------------------------------------------------------------
9 #
10 # creator
11 owner=dxm@sgi.com
12
13 seq=`basename $0`
14 echo "QA output created by $seq"
15
16 here=`pwd`
17 tmp=/tmp/$$
18 status=1        # failure is the default!
19 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
20
21 # get standard environment, filters and checks
22 . ./common.rc
23 . ./common.filter
24
25 _get_existing_uuid()
26 {
27     xfs_db -r $TEST_DEV -c "uuid" | $AWK_PROG '/^UUID/ { print $3 }'
28 }
29
30 # real QA test starts here
31 _supported_fs xfs
32 _supported_os Linux
33
34 _require_scratch
35
36 echo "*** get uuid"
37 uuid=`_get_existing_uuid`
38 echo "*** mkfs"
39 if ! _scratch_mkfs_xfs >$tmp.out 2>&1
40 then
41     cat $tmp.out
42     echo "!!! failed to mkfs on $SCRATCH_DEV"
43     exit
44 fi
45
46 echo "*** mount fs with bad mount option (expect failure)"
47 if _scratch_mount -o foobar >$tmp.out 2>&1
48 then
49     cat $tmp.out
50     echo "!!! mount succeeded (expecting failure)"
51     exit
52 fi
53
54 echo "*** duplicate uuid"
55 xfs_db -x -c "uuid $uuid" `_scratch_xfs_db_options` >/dev/null
56
57 echo "*** mount fs with duplicate uuid (expect failure)"
58 if _scratch_mount >$tmp.out 2>&1
59 then
60     cat $tmp.out
61     echo "!!! mount succeeded (expecting failure)"
62     exit
63 fi
64
65 echo "*** ok!"
66 # success, all done
67 status=0
68 exit