pmrep: update TODO, man page
[pcp.git] / qa / 382
blob279cadf2920d24ab946f255a05f7b078bb25b858
1 #!/bin/sh
2 # PCP QA Test No. 382
3 # check dbpmda does the right thing when contexts are opened and
4 # closed
6 # Copyright (c) 2010 Ken McDonell. 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 rm -f $seq.out
18 if [ $PCP_VER -lt 30600 ]
19 then
20 ln $seq.out.1 $seq.out
21 else
22 ln $seq.out.2 $seq.out
25 status=0 # success is the default!
26 username=`id -u -n`
27 $sudo rm -rf $tmp.* $seq.full
28 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
30 _filter()
32 sed \
33 -e "s;$PCP_VAR_DIR;\$PCP_VAR_DIR;g" \
34 -e 's/\.'"$DSO_SUFFIX"'/.$DSO_SUFFIX/g' \
35 -e "s;$tmp;\$tmp;g" \
36 -e 's/[A-Z][a-z][a-z] [A-Z][a-z][a-z] *[0-9][0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9] [0-9][0-9][0-9][0-9]$/DATE/' \
37 -e "s/`hostname`/LOCALHOST/" \
38 -e "s/ -U $username//g" \
39 -e '/pmResult/s/ from .*/ .../' \
40 -e 's/\(value.*\) 0x[0-9a-f][0-9a-f]*/\1/' \
41 -e 's/\(value.*\) [0-9][0-9]*\.[0-9]*e[-+][0-9][0-9]*/\1/' \
45 # real QA test starts here
46 pipeargs="-d 29 -D appl1"
47 id pcp >/dev/null 2>&1 && pipeargs="$pipeargs -U $username"
48 for cmds in \
49 close \
50 'fetch sample.percontext.pdu;close' \
51 'fetch sample.percontext.pdu;quit' \
52 'fetch sample.percontext.pdu;exit' \
53 'fetch sample.percontext.pdu' \
54 'fetch sample.percontext.pdu;fetch sample.percontext.pdu;fetch sample.percontext.pdu' \
57 echo "open pipe $PCP_VAR_DIR/pmdas/sample/pmdasample $pipeargs -l $tmp.log" >$tmp.cmd
58 echo "$cmds" | tr ';' '\012' >>$tmp.cmd
59 rm -f $tmp.log
60 dbpmda -ei <$tmp.cmd 2>&1 | _filter
61 # let daemon PMDA exit and flush stdio buffer to $tmp.log
62 sleep 2
63 _filter <$tmp.log \
64 | _filter_dumpresult
66 echo "open dso $PCP_VAR_DIR/pmdas/sample/pmda_sample.$DSO_SUFFIX sample_init 30" >$tmp.cmd
67 echo "$cmds" | tr ';' '\012' >>$tmp.cmd
68 dbpmda -D appl1 -ei <$tmp.cmd 2>&1 | _filter \
69 | _filter_dumpresult
71 done
73 # success, all done
74 exit