4 # PM_CONTEXT_LOCAL and PMNS operations involving derived and dynamic
7 # Copyright (c) 2010 Ken McDonell. All Rights Reserved.
11 echo "QA output created by $seq"
13 # get standard environment, filters and checks
18 grep 'pmRegisterDerived' $PCP_INC_DIR/pmapi.h
>/dev
/null ||
19 _notrun
"No derived metric support"
20 grep __pmLocalPMDA
$PCP_INC_DIR/impl.h
>/dev
/null ||
21 _notrun
"No libpcp support for __pmLocalPMDA"
23 status
=0 # success is the default!
24 $sudo rm -rf $tmp.
* $seq.full
25 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
27 cat <<End-of-File >$tmp.derive
28 sampledso.secret.derived.eek.eight = 2 * sampledso.secret.foo.bar.four
31 # with -f need to remove "inst" lines for the metric
32 # sampledso.secret.foo.bar.max.redirect as we will never find these
33 # aliased pmcd metrics with -L
34 # also strip blank lines to reduce "diff noise" later
39 $1 == "sampledso.secret.foo.bar.max.redirect" { print; skip = 1; next }
40 NF == 0 { skip = 0; next }
41 skip == 1 && $1 == "inst" { next }
45 # real QA test starts here
47 "sampledso.secret.foo.bar.grunt.five sampledso.secret.derived.eek.eight sampledso.secret.foo.bar.grunt" \
48 sampledso.secret.foo \
54 # -f for all of sampledso will never match ...
55 [ "$metric_args" = sampledso
-a -n "$margs" ] && continue
56 for hargs
in '' '-h localhost' '-L'
61 echo |
tee -a $seq.full
62 echo "=== $args $metric_args ===" |
tee -a $seq.full
63 pminfo
-c $tmp.derive
$args $metric_args >$tmp.raw
64 cat $tmp.raw
>>$seq.full
66 | LC_COLLATE
=POSIX
sort >$tmp.base
68 $sudo pminfo
-c $tmp.derive
$args $metric_args >$tmp.raw
69 echo "=== $args $metric_args" >>$seq.full
70 cat $tmp.raw
>>$seq.full
72 | LC_COLLATE
=POSIX
sort >$tmp.tmp
73 echo "--- $args diffs against baseline ---" |
tee -a $seq.full
74 diff -u $tmp.base
$tmp.tmp \
75 |
sed -e "/---/s/.*/- baseline output/" \
76 -e "/+++/s/.*/+ $args output/" \