3 # Units from summary botched after avg_host added to metric declaration.
5 # From a report by Jun Wang, junwang123@gmail.com
7 # Copyright (c) 2013 Ken McDonell. All Rights Reserved.
8 # Copyright (c) 2015 Red Hat.
12 echo "QA output created by $seq"
14 # get standard environment, filters and checks
19 [ -f $PCP_PMDAS_DIR/summary
/pmdasummary
] || _notrun
"summary pmda not installed"
21 status
=1 # failure is the default!
22 $sudo rm -rf $tmp.
* $seq.full
23 trap "_cleanup; exit \$status" 0 1 2 3 15
25 # check if summary PMDA already installed
27 eval `pmprobe summary 2>&1 | awk '
28 BEGIN { sts = "false" }
29 $2 > 0 { sts = "true"; exit }
30 END { print "reinstall=" sts }'`
34 cd $PCP_VAR_DIR/pmdas
/summary
35 for file in pmns
expr.pmie
help
37 [ -f $file.
$seq ] && $sudo mv $file.
$seq $file
41 $sudo .
/Install
</dev
/null
>>$here/$seq.full
2>&1
43 $sudo .
/Remove
>>$here/$seq.full
2>&1
49 cat >$tmp.pmns
<<End-of-File
53 avg_mem SYSSUMMARY:0:1
66 cat >$tmp.
expr.pmie
<<End-of-File
67 summary.mem = sample.kbyte_ctr;
68 summary.avg_mem = avg_host sample.kbyte_ctr :'localhost' :'127.0.0.1';
69 // now some extra tests after pmie has been fixed
70 summary.qa.t01 = sample.kbyte_ctr + 1;
71 summary.qa.t02 = sample.kbyte_ctr + 1 Kbyte / sec;
72 summary.qa.t03 = some_inst sample.long.bin_ctr > 0;
73 summary.qa.t04 = all_inst sample.long.bin_ctr > 0;
74 summary.qa.t05 = min_inst sample.long.bin_ctr;
75 summary.qa.t06 = max_inst sample.long.bin_ctr;
80 cd $PCP_VAR_DIR/pmdas
/summary
82 for file in pmns
expr.pmie
help
84 $sudo mv $file $file.
$seq
85 $sudo mv $tmp.
$file $file
87 $sudo .
/Install
</dev
/null | _filter_pmda_install
89 # real QA test starts here
90 pminfo
-d summary |
tee -a $here/$seq.full
91 pminfo
-f summary
>>$here/$seq.full
93 cat $PCP_LOG_DIR/pmcd
/summary.log
>>$here/$seq.full
95 echo >>$here/$seq.full
96 echo "--- pmie directly ---" >>$here/$seq.full
97 pmie
-v -t 1 -T +2 -c expr.pmie
>>$here/$seq.full
2>&1