change emu owner
[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 _setup_testdir
35
36 TESTFILE=$testdir/lock_file
37
38 # Grab a port which is hopefully unused
39 if [ $$ -gt 1024 -a $$ -lt 32000 ]; then
40     PORT=$$
41 elif [ $$ -lt 1024 ]; then
42     PORT=$(($$+1024))
43 elif [ $$ -gt 32000 ]; then
44     PORT=$(($$%30000+1024))
45 fi
46
47 # Start the server
48 src/locktest -p $PORT $TESTFILE > $testdir/server.out 2>&1 &
49
50 sleep 1
51
52 # Start the client
53 src/locktest -p $PORT -h localhost $TESTFILE > $testdir/client.out 2>&1
54 result=$?
55 if [ $result -eq 0 ]; then
56     echo success!
57 else
58     echo "Client reported failure ($result)"
59     cat $testdir/*.out
60     _cleanup
61     exit $status
62 fi
63
64 status=0
65 exit