XFSQA test 144 fails again on tot linux_xfs
[xfstests-dev.git] / 131
1 #! /bin/sh
2 # FSQA Test No. 131
3 #
4 # lock test created from CXFSQA test lockfile_simple
5 #
6 #-----------------------------------------------------------------------
7 #  Copyright (c) 2006 Silicon Graphics, Inc.  All Rights Reserved.
8 #-----------------------------------------------------------------------
9 #
10 # creator
11 owner=allanr@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 "_cleanup; exit \$status" 0 1 2 3 15
20
21 _cleanup()
22 {
23     _cleanup_testdir
24 }
25
26 # get standard environment, filters and checks
27 . ./common.rc
28 . ./common.filter
29
30 # real QA test starts here
31 _supported_fs xfs udf nfs
32 _supported_os Linux
33
34 _require_user
35 _setup_testdir
36
37 TESTFILE=$testdir/lock_file
38
39 # Grab a port which is hopefully unused
40 if [ $$ -gt 1024 -a $$ -lt 32000 ]; then
41     PORT=$$
42 elif [ $$ -lt 1024 ]; then
43     PORT=$(($$+1024))
44 elif [ $$ -gt 32000 ]; then
45     PORT=$(($$%30000+1024))
46 fi
47
48 # Start the server
49 src/locktest -p $PORT $TESTFILE > $testdir/server.out 2>&1 &
50
51 sleep 1
52
53 # Start the client
54 src/locktest -p $PORT -h localhost $TESTFILE > $testdir/client.out 2>&1
55 result=$?
56 if [ $result -eq 0 ]; then
57     echo success!
58 else
59     echo "Client reported failure ($result)"
60     cat $testdir/*.out
61     _cleanup
62     exit $status
63 fi
64
65 status=0
66 exit