Drop unused condition check
[pcp.git] / qa / 969
blobb6ea7f2a8cca3804dcfe518ee0efae1ce25ee6eb
1 #!/bin/sh
2 # PCP QA Test No. 969
3 # Error handling below pmLoadDerivedConfig.
5 # Copyright (c) 2016 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 $tmp.* $seq.full
18 trap "cd $here; rm -rf $tmp $tmp.*; exit \$status" 0 1 2 3 15
20 _filter()
22 sed \
23 -e "s@$tmp@TMP@g" \
24 # end
27 # for dir args, file order and hence derived metric order is not
28 # deterministic
30 _filter2()
32 _filter \
33 | sed \
34 -e 's/metric\[[0-9][0-9]*]/metric[N]/' \
35 | LC_COLLATE=POSIX sort
38 mkdir $tmp
39 echo "x = no-such-metric" >$tmp/a
40 echo "y = sample.lights" >>$tmp/a
41 echo "z = hinv.ncpu + hinv.ndisk" >>$tmp/a
43 echo "a = sample.lights" >$tmp/b
44 echo "b = bozo!" >>$tmp/b
45 echo "c=sample.bin*hinv.ncpu" >>$tmp/b
46 echo "d = +" >>$tmp/b
48 # real QA test starts here
50 # Don't load any global derived metric configs by default
51 export PCP_DERIVED_CONFIG=""
53 for debug in -Dderive ""
55 echo "+++ debug=$debug +++"
56 src/loadderived $debug no-such-file
57 echo
58 src/loadderived $debug $tmp/a 2>&1 | _filter
59 echo
60 src/loadderived $debug $tmp/b 2>&1 | _filter
61 echo
62 src/loadderived $debug $tmp/a:$tmp/b 2>&1 | _filter
63 echo
64 src/loadderived $debug $tmp 2>&1 | _filter2
65 echo
66 src/loadderived $debug $tmp/a:no-such-file:$tmp/b 2>&1 | _filter
67 echo
68 chmod 0 $tmp
69 src/loadderived $debug $tmp 2>&1 | _filter2
70 chmod 755 $tmp
71 echo
72 chmod 0 $tmp/b
73 src/loadderived $debug $tmp/a:$tmp/b:$tmp/c 2>&1 | _filter
74 chmod 644 $tmp/b
75 echo
76 done
78 # success, all done
79 status=0
81 exit