3 # pmlogger local context functionality
5 # Copyright (c) 2015 Red Hat. All Rights Reserved.
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
20 $sudo $PCP_RC_DIR/pcp start | _filter_pcp_start
23 status
=1 # failure is the default!
24 $sudo rm -rf $tmp.
* $seq.full
25 trap "_cleanup; exit \$status" 0 1 2 3 15
27 cat <<End-of-File >$tmp.config
28 log mandatory on 1 sec {
31 sampledso.long.million
38 -e "s/value $hertz$/value HZ/g" \
39 -e "s/value $pagesz$/value PAGESZ/g" \
40 -e 's/TIMESTAMP / /g' \
53 # Unable to connect to pmlogger pid 28124 at local:: Connection refused
54 # Connected to pmlogger pid 25625 at local:
58 -e "/^Unable/s/ $pid / PID /" \
59 -e "/^Connected/s/ $pid / PID /" \
63 # real QA test starts here
64 echo "=== error cases ===" |
tee -a $seq.full
65 rm -f $tmp.0 $tmp.meta
$tmp.index
$tmp.log
66 pmlogger
-c /dev
/null
-o -h localhost
$tmp -l $tmp.log
2>&1 | _filter_usage
67 [ -f $tmp.log
] && cat $tmp.log
>>$seq.full
69 echo |
tee -a $seq.full
70 echo "=== linger tests ===" |
tee -a $seq.full
71 echo "--- expect error from pmlc ---" |
tee -a $seq.full
72 rm -f $tmp.0 $tmp.meta
$tmp.index
$tmp.log
73 pmlogger
-c /dev
/null
-o -l $tmp.log
$tmp &
75 echo "pid=$pid" >>$seq.full
76 cat <<End-of-File >$tmp.pmlc
80 pmlc
-e <$tmp.pmlc $
! 2>&1 | _filter_pmlc
81 if ps
-p $pid >/dev
/null
83 echo "Error: pmlogger still alive!"
86 [ -f $tmp.log
] && cat $tmp.log
>>$seq.full
88 echo "--- expect success from pmlc ---" |
tee -a $seq.full
89 rm -f $tmp.0 $tmp.meta
$tmp.index
$tmp.log
90 pmlogger
-c /dev
/null
-L -o -l $tmp.log
$tmp &
92 echo "pid=$pid" >>$seq.full
94 pmlc
-e <$tmp.pmlc $
! 2>&1 | _filter_pmlc
95 if ps
-p $pid >/dev
/null
99 echo "Error: pmlogger has died!"
101 [ -f $tmp.log
] && cat $tmp.log
>>$seq.full
103 echo |
tee -a $seq.full
104 echo "=== OK case ===" |
tee -a $seq.full
105 hertz
=`pmprobe -v kernel.all.hz | $PCP_AWK_PROG '{ print $3 }'`
106 pagesz
=`pmprobe -v hinv.pagesize | $PCP_AWK_PROG '{ print $3 }'`
108 # ensure pmcd is unavailable while this test is running
109 $sudo $PCP_RC_DIR/pcp stop | _filter_pcp_stop
110 rm -f $tmp.0 $tmp.meta
$tmp.index
$tmp.log
111 pmlogger
-c $tmp.config
-l $tmp.log
-T 5 --local-PMDA -K add
,30,$PCP_PMDAS_DIR/sample
/pmda_sample.
$DSO_SUFFIX,sample_init
$tmp >$tmp.err
2>&1
113 _filter_pmlogger_log
<$tmp.log
115 echo "verifying the archive"
118 # expect 4, 5 or 6 sample lines for each metric
121 | _filter_pmdumplog \
122 |
grep 'hinv.pagesize' \
127 | _filter_pmdumplog \
128 |
grep 'kernel.all.hz' \
131 echo MILLION samples
:
133 | _filter_pmdumplog \
134 |
grep 'sampledso.long.million' \
138 echo "Full log dump:" >> $seq.full
139 pmdumplog
$tmp >> $seq.full