Merge branch 'master' of https://github.com/kmcdonell/pcp into kenj-merge
[pcp.git] / qa / 510
blob439c72798a30413c4903fefe98bfd2e374856036
1 #!/bin/sh
2 # PCP QA Test No. 510
3 # pmlogger -Dall calls __pmDumpResult() which fails for usage with
4 # pmlc control requests
6 # Copyright (c) 2012 Ken McDonell. All Rights Reserved.
8 # check-group-include: pmlogger
10 seq=`basename $0`
11 echo "QA output created by $seq"
13 # get standard environment, filters and checks
14 . ./common.product
15 . ./common.filter
16 . ./common.check
18 status=1
19 $sudo rm -rf $tmp.* $seq.full
20 trap "_cleanup" 0 1 2 3 15
21 needclean=true
23 _cleanup()
25 if $needclean
26 then
27 _restore_config $control
28 needclean=false
29 _restore_primary_logger
30 _service pcp restart | _filter_pcp_start
31 _wait_for_pmcd
33 $sudo rm -f $tmp.*
34 exit $status
37 _filter()
39 sed \
40 -e 's/Version [0-9].*/Version VERSION/'
43 control=$PCP_PMLOGGERCONTROL_PATH
44 [ -f $PCP_PMLOGGERCONTROL_PATH.d/local ] && \
45 control=$PCP_PMLOGGERCONTROL_PATH.d/local
47 # stop primary logger, add -Dall to config file and restart pmlogger
48 _service pcp stop >/dev/null 2>&1
49 sed -e '/^LOCALHOSTNAME/s/$/ -Dall/' < $control >$tmp.control
50 _save_config $control
51 $sudo cp $tmp.control $control
52 _writable_primary_logger
53 _service pcp restart | _filter_pcp_start
54 _wait_for_pmcd
55 _wait_for_pmlogger
57 # real QA test starts here
58 pmlc -ie <<End-of-File | _filter
59 connect primary
60 query sample.event
61 log mandatory on once sample.event.records
62 query sample.event
63 End-of-File
65 # success, all done
66 status=0
67 exit