Merge branch 'master' of git://git.pcp.io/pcp into qt
[pcp.git] / qa / 434
blob079d607517a22a6119f5ef5bc4dc8905d7b867eb
1 #!/bin/sh
2 # PCP QA Test No. 434
3 # pmval exit status
5 # Copyright (c) 2010 Ken McDonell. All Rights Reserved.
8 seq=`basename $0`
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
12 . ./common.product
13 . ./common.filter
14 . ./common.check
16 status=0 # success is the default!
17 $sudo rm -rf $tmp.* $seq.full
18 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
20 _filter()
22 sed <$1 \
23 -e '/^ *[0-9][0-9.]* *$/s/.*/NUMBER/' \
24 -e '/^host:.*$/s/.*/HOST/'
27 # real QA test starts here
28 pmval -h no.such.host.pcp.io any.old.metric
29 sts=$?
30 echo "no.such.host.pcp.io - exit status $sts"
31 pmval -a no.such.archive any.old.metric
32 sts=$?
33 echo "no.such.archive - exit status $sts"
34 pmval no.such.metric
35 sts=$?
36 echo "no.such.metric - exit status $sts"
37 pmval -i no.such.instance sample.bin
38 sts=$?
39 echo "no.such.instance - exit status $sts"
40 pmval
41 sts=$?
42 echo "usage - exit status $sts"
44 for s in 0 1 2
46 pmval -t 0.1 -s $s sample.seconds >$tmp.out
47 sts=$?
48 _filter $tmp.out
49 echo "counter -s $s - exit status $sts"
50 done
52 for s in 0 1 2
54 pmval -r -t 0.1 -s $s sample.seconds >$tmp.out
55 sts=$?
56 _filter $tmp.out
57 echo "counter -r -s $s - exit status $sts"
58 done
60 for s in 0 1 2
62 pmval -t 0.1 -s $s sample.long.ten >$tmp.out
63 sts=$?
64 _filter $tmp.out
65 echo "instantaneuos -s $s - exit status $sts"
66 done