summaryrefslogtreecommitdiff
path: root/qa/341
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/341
downloadpcp-47e6e7c84f008a53061e661f31ae96629bc694ef.tar.gz
Debian 3.9.10debian/3.9.10debian
Diffstat (limited to 'qa/341')
-rwxr-xr-xqa/34159
1 files changed, 59 insertions, 0 deletions
diff --git a/qa/341 b/qa/341
new file mode 100755
index 0000000..b06c692
--- /dev/null
+++ b/qa/341
@@ -0,0 +1,59 @@
+#!/bin/sh
+# PCP QA Test No. 341
+#
+# exercise corner cases for pmdaCacheOp(...LOAD...)
+#
+# Copyright (c) 2010 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=0 # success is the default!
+$sudo rm -rf $tmp.* $seq.full
+trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+
+# [Tue Jan 26 09:10:16] pmdacache(22270) Warning: pmdaCacheOp: /var/lib/pcp/config/pmda/0.123: loading instance 0 ("eek") ignored, already in cache as 0 ("urk")
+_filter()
+{
+ sed \
+ -e 's/^\[[A-Z].. [A-Z].. *[0-9][0-9]* ..:..:..]/[DATE]/' \
+ -e 's/cache([0-9][0-9]*)/cache(PID)/' \
+ -e 's/ 0x0 / (nil) /g' \
+ -e "s;$PCP_VAR_DIR;\$PCP_VAR_DIR;"
+}
+
+# note - need to do everything as sudo because $PCP_VAR_DIR/config/pmda
+# is not world writeable
+#
+
+$sudo rm -f $PCP_VAR_DIR/config/pmda/0.123
+
+# real QA test starts here
+
+echo "load without save, store a couple and save ..." | tee -a $seq.full
+$sudo src/pmdacache -D indom -L -s eek -s urk -S 2>&1 | _filter
+$sudo cat $PCP_VAR_DIR/config/pmda/0.123 >>$seq.full
+
+echo
+echo "store one, load, store another couple and save ..." | tee -a $seq.full
+$sudo src/pmdacache -D indom -s eek -L -s urk -s foo -S -d 2>&1 | _filter
+$sudo cat $PCP_VAR_DIR/config/pmda/0.123 >>$seq.full
+
+echo
+echo "store some, hide some, load ..." | tee -a $seq.full
+$sudo src/pmdacache -D indom -s eek -s urk -s foo -s 'fumble mumble' -h eek -h foo -s bar -L -d 2>&1 | _filter
+$sudo cat $PCP_VAR_DIR/config/pmda/0.123 >>$seq.full
+
+echo
+echo "error case ..." | tee -a $seq.full
+$sudo src/pmdacache -D indom -s 'urk a bit tricky' -s foo -L -d 2>&1 | _filter
+$sudo cat $PCP_VAR_DIR/config/pmda/0.123 >>$seq.full
+
+# success, all done
+exit