2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
7 # lock test created from CXFSQA test lockfile_simple
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
15 status=1 # failure is the default!
16 trap "_cleanup; exit \$status" 0 1 2 3 15
20 kill $locktest_pid2 > /dev/null 2>&1
21 kill $locktest_pid1 > /dev/null 2>&1
24 # get standard environment, filters and checks
28 # real QA test starts here
32 _require_test_fcntl_advisory_locks
34 TESTFILE=$TEST_DIR/lock_file
36 rm -f $TEST_DIR/server.out
37 touch $TEST_DIR/server.out
40 src/locktest $TESTFILE 2>&1 > $TEST_DIR/server.out &
44 while [ $timeout -gt 0 ]; do
47 PORT=$(cat $TEST_DIR/server.out | grep "^server port: " | awk '{print $3}')
48 if [ -n "$PORT" ]; then
52 # check the existence of server process
53 if ! kill -s 0 $locktest_pid1 >/dev/null 2>&1; then
54 echo "Server died abnormally"
61 if [ -z "$PORT" ]; then
62 echo "Could not get server port"
67 src/locktest -p $PORT -h localhost $TESTFILE 2>&1 > $TEST_DIR/client.out
70 if [ $result -eq 0 ]; then
74 echo "Client reported failure ($result)"