summaryrefslogtreecommitdiff
path: root/qa/525
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2014-10-26 12:33:50 +0400
committerIgor Pashev <pashev.igor@gmail.com>2014-10-26 12:33:50 +0400
commit47e6e7c84f008a53061e661f31ae96629bc694ef (patch)
tree648a07f3b5b9d67ce19b0fd72e8caa1175c98f1a /qa/525
downloadpcp-47e6e7c84f008a53061e661f31ae96629bc694ef.tar.gz
Debian 3.9.10debian/3.9.10debian
Diffstat (limited to 'qa/525')
-rwxr-xr-xqa/52599
1 files changed, 99 insertions, 0 deletions
diff --git a/qa/525 b/qa/525
new file mode 100755
index 0000000..ebceba0
--- /dev/null
+++ b/qa/525
@@ -0,0 +1,99 @@
+#!/bin/sh
+# PCP QA Test No. 525
+# Units from summary botched after avg_host added to metric declaration.
+#
+# From a report by Jun Wang, junwang123@gmail.com
+#
+# Copyright (c) 2013 Ken McDonell. All Rights Reserved.
+#
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+# get standard environment, filters and checks
+. ./common.product
+. ./common.filter
+. ./common.check
+
+status=1 # failure is the default!
+$sudo rm -rf $tmp.* $seq.full
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+# check if summary PMDA already installed
+#
+eval `pmprobe summary 2>&1 | awk '
+BEGIN { sts = "false" }
+$2 > 0 { sts = "true"; exit }
+END { print "reinstall=" sts }'`
+
+_cleanup()
+{
+ cd $PCP_VAR_DIR/pmdas/summary
+ for file in pmns expr.pmie help
+ do
+ [ -f $file.$seq ] && $sudo mv $file.$seq $file
+ done
+ if $reinstall
+ then
+ $sudo ./Install </dev/null >>$here/$seq.full 2>&1
+ else
+ $sudo ./Remove >>$here/$seq.full 2>&1
+ fi
+ cd $here
+ rm -rf $tmp.*
+}
+
+cat >$tmp.pmns <<End-of-File
+/* for QA $seq */
+summary {
+ mem SYSSUMMARY:0:0
+ avg_mem SYSSUMMARY:0:1
+ qa
+}
+summary.qa {
+ t01 SYSSUMMARY:1:1
+ t02 SYSSUMMARY:1:2
+ t03 SYSSUMMARY:1:3
+ t04 SYSSUMMARY:1:4
+ t05 SYSSUMMARY:1:5
+ t06 SYSSUMMARY:1:6
+}
+End-of-File
+
+cat >$tmp.expr.pmie <<End-of-File
+summary.mem = sample.kbyte_ctr;
+summary.avg_mem = avg_host sample.kbyte_ctr :'localhost' :'127.0.0.1';
+// now some extra tests after pmie has been fixed
+summary.qa.t01 = sample.kbyte_ctr + 1;
+summary.qa.t02 = sample.kbyte_ctr + 1 Kbyte / sec;
+summary.qa.t03 = some_inst sample.long.bin_ctr > 0;
+summary.qa.t04 = all_inst sample.long.bin_ctr > 0;
+summary.qa.t05 = min_inst sample.long.bin_ctr;
+summary.qa.t06 = max_inst sample.long.bin_ctr;
+End-of-File
+
+echo >$tmp.help
+
+cd $PCP_VAR_DIR/pmdas/summary
+
+for file in pmns expr.pmie help
+do
+ $sudo mv $file $file.$seq
+ $sudo mv $tmp.$file $file
+done
+$sudo ./Install </dev/null | _filter_pmda_install
+
+# real QA test starts here
+pminfo -d summary | tee -a $here/$seq.full
+pminfo -f summary >>$here/$seq.full
+
+cat $PCP_LOG_DIR/pmcd/summary.log >>$here/$seq.full
+
+echo >>$here/$seq.full
+echo "--- pmie directly ---" >>$here/$seq.full
+pmie -v -t 1 -T +2 -c expr.pmie >>$here/$seq.full 2>&1
+
+# success, all done
+status=0
+
+exit