Drop unused condition check
[pcp.git] / qa / 703
blob23c3cb53b0020068a5f60753171ab08e8990717c
1 #!/bin/sh
2 # PCP QA Test No. 703
3 # weblog PMDA install/remove test
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 . ./common.pcpweb
14 [ -f $PCP_PMDAS_DIR/weblog/pmdaweblog ] || _notrun "weblog PMDA not installed"
16 if [ $PCP_PLATFORM = solaris ]
17 then
18 _notrun "weblog PMDA won't work for Solaris Apache install"
21 status=1 # failure is the default!
23 _cleanup()
25 _restore_state
26 rm -f $tmp.*
27 exit $status
29 trap _cleanup 0 1 2 3 15
31 _pminfo_filter()
33 # *.(cached|uncached|client).* might have no values available
34 sed -e '
35 /\.cached\...* No value(s) available/d
36 /\.uncached\...* No value(s) available/d
37 /\.client\...* No value(s) available/d
41 _filter()
43 sed '
44 s/[ ][ ]*/ /g;
45 s/ weblog metrics / web metrics /;
46 /Updating the Performance Metrics Name /,/of symbol table/d;
47 /Check web metrics have gone away/d;
48 /^---*$/d;
49 /Culling the Performance Metrics Name/,/ done/d;
50 /make: Nothing to be done for .install./d;
51 /Installing files \.\.\./d;
52 /Removing files \.\.\./d;
53 ' | $PCP_AWK_PROG '
54 skip == 1 && /^Found/ { skip = 0 }
55 skip == 2 && /^A configuration file can be automatically generated/ {
56 print ""
57 print
58 skip = 0
59 next
61 skip == 0 && /Do you want a default weblog PMDA installation/ {
62 print
63 skip = 1
64 next
66 skip == 0 && / Server\./ { print "... some server(s) found ..."
67 skip = 2
68 next
70 skip > 0 { next }
71 /Check web metrics have appeared / { next }
72 { print }'
75 # real QA test starts here
77 rm -f $seq.full
78 _save_state
79 _remove_pmda weblog > /dev/null
81 echo "=== install weblog PMDA ===" | tee -a $seq.full
82 _install_pmda weblog | tee -a $seq.full | _filter | $PCP_AWK_PROG '
83 /Installing pmchart view/ { skip = 0; next }
84 /Terminate PMDA if already installed/ { skip = 0 }
85 skip == 1 { next }
86 /^Found / { print "Found at least one server ..."
87 skip = 1
88 next
90 { print }'
92 echo "=== check metrics (expect no output) ==="
94 pminfo -v web | tee -a $seq.full | _pminfo_filter
96 pminfo -v web > /dev/null || _fail "install failed?"
97 [ `_pmcount web` -ge 69 ] || _fail "Too few metrics?"
98 [ `_pmget web.config.numservers` -ge 1 ] || _fail "No servers found?"
100 echo "=== remove weblog PMDA ==="
101 _remove_pmda weblog | _filter
103 echo
104 echo "=== Checking uninstall (expect no output) ==="
105 ps $PCP_PS_ALL_FLAGS | grep '[p]mdaweblog'
106 pmprobe web 2>&1 | $PCP_AWK_PROG '$2 > 0 { print "Oops ...",$0 }'
108 status=0
109 exit