blob: f58a3ad5bc7fd3e2189b8fa3647ecf7cd17d0d50 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
#!/bin/sh
# PCP QA Test No. 382
# check dbpmda does the right thing when contexts are opened and
# closed
#
# Copyright (c) 2010 Ken McDonell. All Rights Reserved.
#
seq=`basename $0`
echo "QA output created by $seq"
# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check
rm -f $seq.out
if [ $PCP_VER -lt 3600 ]
then
ln $seq.out.1 $seq.out
else
ln $seq.out.2 $seq.out
fi
status=0 # success is the default!
username=`id -u -n`
$sudo rm -rf $tmp.* $seq.full
trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
_filter()
{
sed \
-e "s;$PCP_VAR_DIR;\$PCP_VAR_DIR;g" \
-e 's/\.'"$DSO_SUFFIX"'/.$DSO_SUFFIX/g' \
-e "s;$tmp;\$tmp;g" \
-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/' \
-e "s/`hostname`/LOCALHOST/" \
-e "s/ -U $username//g" \
-e '/pmResult/s/ from .*/ .../' \
-e 's/\(value.*\) 0x[0-9a-f][0-9a-f]*/\1/' \
-e 's/\(value.*\) [0-9][0-9]*\.[0-9]*e[-+][0-9][0-9]*/\1/' \
}
# real QA test starts here
pipeargs="-d 29 -D appl1"
id pcp >/dev/null 2>&1 && pipeargs="$pipeargs -U $username"
for cmds in \
close \
'fetch sample.percontext.pdu;close' \
'fetch sample.percontext.pdu;quit' \
'fetch sample.percontext.pdu;exit' \
'fetch sample.percontext.pdu' \
'fetch sample.percontext.pdu;fetch sample.percontext.pdu;fetch sample.percontext.pdu' \
do
echo "open pipe $PCP_VAR_DIR/pmdas/sample/pmdasample $pipeargs -l $tmp.log" >$tmp.cmd
echo "$cmds" | tr ';' '\012' >>$tmp.cmd
rm -f $tmp.log
dbpmda -ei <$tmp.cmd 2>&1 | _filter
# let daemon PMDA exit and flush stdio buffer to $tmp.log
sleep 2
_filter <$tmp.log \
| _filter_dumpresult
echo "open dso $PCP_VAR_DIR/pmdas/sample/pmda_sample.$DSO_SUFFIX sample_init 30" >$tmp.cmd
echo "$cmds" | tr ';' '\012' >>$tmp.cmd
dbpmda -D appl1 -ei <$tmp.cmd 2>&1 | _filter \
| _filter_dumpresult
done
# success, all done
exit
|