Merge branch 'master' of git://git.pcp.io/pcp into qt
[pcp.git] / qa / 323
blobe19549dc54de85e6662bdbbd6c71be3a7b85c61a
1 #!/bin/sh
2 # PCP QA Test No. 323
3 # validate some values for pmdashping
5 # Copyright (c) 2015 Red Hat.
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 filters
13 . ./common.product
14 . ./common.filter
15 . ./common.check
17 [ -f $PCP_PMDAS_DIR/shping/pmdashping ] || _notrun "shping pmda not installed"
18 which nslookup >/dev/null 2>&1 || _notrun "nslookup is not installed"
20 _cleanup()
22 _restore_pmda_install $iam
23 $sudo rm -f $tmp.*
24 exit $status
27 iam=shping
28 status=1
29 trap "_cleanup" 0 1 2 3 15
30 rm -f $seq.full
31 here=`pwd`
33 _filter_info()
35 sed \
36 -e 's/value -[0-9][0-9]*\.[0-9]*/value NEGATIVE NUMBER/' \
37 -e 's/value -[0-9][0-9]*/value NEGATIVE NUMBER/' \
38 -e 's/value [0-9][0-9]*\.[0-9]*/value NUMBER/' \
39 -e 's/value [0-9][0-9]*/value NUMBER/'
42 # real QA test starts here
43 _prepare_pmda_install $iam
45 # make sure no old config file is hanging about, otherwise the "3" answer
46 # below would need to be "4" !
48 $sudo rm -f $PCP_VAR_DIR/config/$iam/$iam.conf
50 # timing is real tricky here ...
51 echo
52 echo "=== install $iam agent ===" | tee -a $here/$seq.full
53 echo 'b
56 null exit 0
57 slow sleep 3
58 timeout sleep 10
61 6' \
62 | $sudo ./Install >$tmp.out 2>&1
63 _filter_pmda_install <$tmp.out
64 cat $tmp.out >>$here/$seq.full
66 if pminfo -v $iam
67 then
69 else
70 echo "... failed! ... here is the Install log ..."
71 cat $tmp.out
74 echo
75 echo "=== check values ==="
76 pminfo -f shping.status shping.error shping.cmd
77 pminfo -f shping.control.cycletime shping.control.timeout
78 pminfo -f shping.time.real shping.time.cpu_usr shping.time.cpu_sys 2>&1 \
79 | _filter_info
81 echo | tee -a $here/$seq.full
82 echo "=== remove $iam agent ===" | tee -a $here/$seq.full
83 $sudo ./Remove >$tmp.out 2>&1
84 _filter_pmda_remove <$tmp.out
85 cat $tmp.out >>$here/$seq.full
87 echo >>$here/$seq.full
88 ls -l $PCP_LOG_DIR/pmcd/shping.log >>$here/$seq.full
89 cat $PCP_LOG_DIR/pmcd/shping.log >>$here/$seq.full
90 echo >>$here/$seq.full
91 ls -l $PCP_LOG_DIR/pmcd/pmcd.log >>$here/$seq.full
92 cat $PCP_LOG_DIR/pmcd/pmcd.log >>$here/$seq.full
94 status=0
95 exit