python api: fix syntax error in recent context changes
[pcp.git] / qa / 790
blob13b37195b7e0e05a46b954c3bffa89e72d3ea179
1 #!/bin/sh
2 # PCP QA Test No. 790
3 # pmlogextract error handling
5 # Copyright (c) 2015 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=1 # failure is the default!
17 $sudo rm -rf $tmp.* $seq.full
18 trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
20 _do()
22 rm -f $tmp.0 $tmp.meta $tmp.index
23 pmlogextract -c $tmp.config tmparch/foo $tmp >$tmp.out 2>$tmp.err
24 cat $tmp.out $tmp.err \
25 | sed \
26 -e "s;$tmp;TMP;g" \
30 # real QA test starts here
31 echo "=== metric name cases ==="
32 cat <<End-of-File >$tmp.config
33 sample.bad.name [ one, two, three ]
34 sample.mumble
35 sample.another.bad.name [
36 one
37 two
38 three
40 sample.fumble
41 sample.xyz?
42 End-of-File
43 _do
45 echo
46 echo "=== instance name cases ==="
47 cat <<End-of-File >$tmp.config
48 # instance names bin-101 and bin101 and 101 are all bad
49 sample.bin [ 'bin-100',
50 'bin-101',
51 'bin-200',
52 bin101,
53 "bin-300",
54 101,
55 "bin-400"
57 # sample.seconds is a singular metric
58 sample.seconds [ any ]
59 # all instances are bad
60 sample.colour [ purple, white, yellow, brown ]
61 End-of-File
62 _do
63 pminfo -a $tmp -f sample.bin sample.seconds sample.colour
65 echo
66 echo "=== syntax errors =="
67 cat <<End-of-File >$tmp.config
68 sample.drift [ ]
69 End-of-File
70 _do
71 cat <<End-of-File >$tmp.config
72 sample.colour [
73 End-of-File
74 _do
76 # success, all done
77 status=0
79 exit