docs: tweak formatting in pmrep(1) archive folio example
[pcp.git] / qa / 152
blob293e2ee860ff30a76cc92a08ac989394b5d1d354
1 #! /bin/sh
2 # PCP QA Test No. 152
3 # pmcd.numclients was incorrect
5 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
8 seq=`basename $0`
9 echo "QA output created by $seq"
11 # get standard filters
12 . ./common.product
13 . ./common.filter
15 trap "rm -f $tmp.*; exit" 0 1 2 3 15
17 # real QA test starts here
18 ( date; pminfo -f pmcd.client ) >$tmp.before
19 pminfo -f pmcd.numclients | tee $here/$seq.full | sed -e '/^$/d' >$tmp.out
20 N=`sed -n '/value/s/ value //p' $tmp.out`
21 echo "N=$N" >>$here/$seq.full
22 sed "s/$N/N/" $tmp.out
23 # expect N+4, but pmie processes come and go, so N+4 +/- 1 seems
24 # about right
26 N=`expr $N + 4`
27 MIN=`expr $N - 1`
28 MAX=`expr $N + 1`
29 PAT="($MIN|$N|$MAX)"
30 echo "PAT=$PAT" >>$here/$seq.full
32 for i in 1 2 3 4
34 pmval -s3 -t5 pmcd.numagents >$tmp.$i 2>&1 &
35 done
37 while true
39 touch $tmp.started
40 for i in 1 2 3 4
42 [ -s $tmp.$i ] || rm -f $tmp.started
43 done
44 [ -f $tmp.started ] && break
45 sleep 2
46 done
48 pminfo -f pmcd.numclients | tee -a $here/$seq.full | sed -e '/^$/d' >$tmp.out
49 ( date; pminfo -f pmcd.client ) >$tmp.after
51 if egrep "value $PAT" $tmp.out >/dev/null
52 then
53 sed <$tmp.out \
54 -e "s/$MIN/N+4/" \
55 -e "s/$N/N+4/" \
56 -e "s/$MAX/N+4/"
57 else
58 echo
59 echo "Error: expected value $N"
60 cat $tmp.out
61 echo "--- before"
62 cat $tmp.before
63 echo
64 echo "--- after"
65 cat $tmp.after
68 exit 0