summaryrefslogtreecommitdiff
path: root/qa/334
diff options
context:
space:
mode:
Diffstat (limited to 'qa/334')
-rwxr-xr-xqa/33468
1 files changed, 68 insertions, 0 deletions
diff --git a/qa/334 b/qa/334
new file mode 100755
index 0000000..78974fa
--- /dev/null
+++ b/qa/334
@@ -0,0 +1,68 @@
+#!/bin/sh
+# PCP QA Test No. 334
+#
+# check instance matching for derived metrics
+#
+# Copyright (c) 2009 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
+
+if grep -q 'pmRegisterDerived' $PCP_DIR/usr/include/pcp/pmapi.h
+then
+ :
+else
+ echo "No derived metric support" >$seq.notrun
+ echo "$seq: [not run] `cat $seq.notrun`"
+ exit 0
+fi
+
+status=0 # success is the default!
+$sudo rm -rf $tmp.* $seq.full
+trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+
+export PCP_DERIVED_CONFIG=$tmp.config
+
+# Derived metric expr dump from 0x8513a48...
+# expr node 0x867eb68 type=PLUS left=0x867eb98 right=0x867ed28
+_filter()
+{
+ cat $tmp.out >>$seq.full
+ awk <$tmp.out >$tmp.sed '
+BEGIN { n = 0 }
+$1 == "expr" && $2 == "node" && $3 ~ /^0x/ { print "s/" $3 "/<addr-" n ">/"; n++ }
+ { next }'
+ echo "=== sed ===" >>$seq.full
+ cat $tmp.sed >>$seq.full
+ sed -f $tmp.sed <$tmp.out \
+ | sed \
+ -e '/[0-9][0-9]:[0-9][0-9]:[0-9][0-9]/s/[^ ]*.*numpmid/TIMESTAMP ... numpmid/' \
+ -e 's/=0x0 /=(nil) /g' \
+ -e "s;$tmp;TMP;"
+# -e 's/ val=[0-9][0-9]*/ val=<number>/g'
+}
+
+# real QA test starts here
+
+cat <<End-of-File >$tmp.config
+my.x1 = sample.bin + sample.part_bin
+my.x2 = sample.part_bin + sample.bin
+my.x3 = 2 * sample.part_bin
+my.x4 = sample.part_bin * 2
+my.x5 = (sample.bin + sample.part_bin) - (sample.part_bin + sample.bin)
+End-of-File
+echo
+cat $tmp.config
+
+echo
+pminfo -Dderive,appl2 -df my >$tmp.out 2>&1
+_filter
+
+# success, all done
+exit