qa: revert some change to expected 244 outputs (from pmda-restart)
[pcp.git] / qa / 107
blob43d487de45f51f0c668a89787e0ced7d44db350e
1 #! /bin/sh
2 # PCP QA Test No. 107
3 # Check pmlc "query" command against the primary pmlogger
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 _filter()
17 # Note
18 # ... already using all instances ... line comes from dynamic PMNS
19 # support where sample.secret.foo.bar.max.redirect and
20 # sampledso.secret.foo.bar.max.redirect are aliases (i.e. have the
21 # same PMID) for pmcd.agent.status ... so the Warning is expected
23 echo "Checking for errors in $1 ..."
24 sed <$1 \
25 -e '/Warning: already using all instances for pmcd.agent.status/d' \
26 -e '/^$/d' \
27 -e '/^disk[^:]*$/d' \
28 -e '/^network[^:]*$/d' \
29 -e '/^kernel[^:]*$/d' \
30 -e '/^pmcd[^:]*$/d' \
31 -e '/^sample[^:]*$/d' \
32 -e '/^sampledso[^:]*$/d' \
33 -e '/^ mand on /d' \
34 -e '/^ mand off /d' \
35 -e '/^ adv off /d' \
36 -e '/^ adv on /d' \
37 -e '/^ (no instances)/d' \
38 -e '=' \
39 -e 's/^/ /' \
40 | sed -e '/^[0-9][0-9]*$/s//line &:/'
43 trap "rm -f $tmp.*; exit" 0 1 2 3 15
45 # real QA test starts here
46 pmlc <<End-of-File >$seq.full 2>&1
47 connect primary
48 query { disk network kernel pmcd sample sampledso }
49 End-of-File
51 $PCP_ECHO_PROG $PCP_ECHO_N "Expect at least one metric with logging state \"on\" ...""$PCP_ECHO_C"
52 if egrep '^ (mand on )|(adv on )' $seq.full >/dev/null
53 then
54 echo " PASS"
55 else
56 echo " FAIL"
59 $PCP_ECHO_PROG $PCP_ECHO_N "Expect at least 250 metrics to be reported ...""$PCP_ECHO_C"
60 num=`egrep '^(disk|network|kernel|pmcd|sample|sampledso)\.' $seq.full | wc -l | sed -e 's/ //g'`
61 if [ $num -ge 250 ]
62 then
63 echo " PASS"
64 else
65 echo " FAIL (found $num)"
68 _filter $seq.full