Merge branch 'master' of git://git.pcp.io/pcp into qt
[pcp.git] / qa / 539
blobf744a3d5898c40e888701469c4ff82f3e6ff390e
1 #! /bin/sh
2 # PCP QA Test No. 539
3 # pmpost race condition between check modified date and lock
4 # #665984
6 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
9 seq=`basename $0`
10 echo "QA output created by $seq"
12 # get standard environment, filters and checks
13 . ./common.product
14 . ./common.filter
15 . ./common.check
17 status=1 # failure is the default!
18 trap "_cleanup; exit \$status" 0 1 2 3 15
20 _cleanup()
22 [ -f $PCP_LOG_DIR/NOTICES.qa.$seq ] && $sudo mv $PCP_LOG_DIR/NOTICES.qa.$seq $PCP_LOG_DIR/NOTICES
23 rm -f $tmp.*
26 _filter()
28 echo "DATE lines (expect 1) ..."
29 sed -n <$1 \
30 -e '/^DATE:/s/ .*/ .../p'
31 echo "pmpost lines (expect 20) ..."
32 sed -n <$1 \
33 -e "/qa-$seq/s/.*qa/... qa/p"
36 $sudo mv $PCP_LOG_DIR/NOTICES $PCP_LOG_DIR/NOTICES.qa.$seq
37 $sudo touch -t 199701020304.00 $PCP_LOG_DIR/NOTICES
39 # real QA test starts here
40 for i in 1 2 3 4 5
42 $sudo $PCP_BINADM_DIR/pmpost qa-$seq &
43 pmsleep 0.1
44 $sudo $PCP_BINADM_DIR/pmpost qa-$seq &
45 pmsleep 0.1
46 $sudo $PCP_BINADM_DIR/pmpost qa-$seq &
47 pmsleep 0.1
48 $sudo $PCP_BINADM_DIR/pmpost qa-$seq &
49 pmsleep 0.1
50 done
52 wait
54 _filter $PCP_LOG_DIR/NOTICES
56 # success, all done
57 status=0
58 exit