4 # exercise __pmLocalPMDA functionality
6 # Copyright (c) 2010 Ken McDonell. All Rights Reserved.
10 echo "QA output created by $seq"
12 # get standard filters
17 status
=0 # success is the default!
19 $sudo rm -rf $tmp.
* $seq.full
20 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
22 cat <<End-of-File >$tmp.pmns
65 -e "/^pmWhichContext/d" \
66 -e "/^pmNewContext/d" \
69 -e "/^Local Context PMDA Table/d" \
71 -e "s/host: @/host: HOST/g" \
72 -e "s/host: $host/host: HOST/g" \
73 -e "s;$PCP_PMCDCONF_PATH;\$PCP_PMCDCONF_PATH;" \
74 -e "s;$PCP_VAR_DIR;\$PCP_VAR_DIR;" \
75 -e "s/\.$DSO_SUFFIX/.\$DSO_SUFFIX/g" \
76 -e '/^0*x*[0-9a-f][0-9a-f]* /d' \
77 -e '/^\[[0-9][0-9]*]/d' \
78 -e '/^__pmLocalPMDA(/d' \
79 -e '/^__pmSetSocketIPC:/d' \
80 -e '/NotifyEndLocalContext: .*pmda_linux/d' \
81 -e '/^IPC table fd(/d' \
85 # -e "s;$PCP_PMDAS_DIR;\$PCP_PMDAS_DIR;" \
86 # -e "s;$PCP_VAR_DIR;\$PCP_VAR_DIR;g" \
88 # real QA test starts here
89 pminfo
-fL -n $tmp.pmns
-K clear -K add
,400,$PCP_VAR_DIR/pmdas
/sample
/pmda_sample.
$DSO_SUFFIX,sample_init qa.colour
92 pminfo
-fL -n $tmp.pmns
-K clear -K add
,400,$PCP_VAR_DIR/pmdas
/sample
/pmda_sample
,sample_init qa.pid
>$tmp.out
&
95 got
=`sed -n -e '/value/s/.*value //p' $tmp.out`
96 if [ "$got" != "$expect" ]
98 echo "Error: expecting pid $expect, got $got from"
101 echo "PID check passes"
105 echo "=== expect no sample metrics ==="
106 pminfo
-fmL -n $tmp.pmns
-K clear -K add
,400,sample
/pmda_sample.
$DSO_SUFFIX,sample_init qa.colour sample.colour
109 echo "=== sample metrics this time ==="
110 # need to copy DSO so running sample_init() only once per DSO
111 cp $PCP_VAR_DIR/pmdas
/sample
/pmda_sample.
$DSO_SUFFIX $tmp.
$DSO_SUFFIX
112 export PMDA_LOCAL_SAMPLE
=yes
113 $sudo pminfo
-fmL -n $tmp.pmns
-K add
,400,$tmp.
$DSO_SUFFIX,sample_init qa.colour sample.colour
116 echo "=== -K spec parsing in pminfo ==="
118 clear clear, clear,400 clear,400, clear,400,$tmp.
$DSO_SUFFIX clear,400,$tmp.
$DSO_SUFFIX, \
119 clear,400,$tmp.
$DSO_SUFFIX,sample_init
clear,,$tmp.
$DSO_SUFFIX,sample_init
clear,,,sample_init \
120 clear,,$tmp.
$DSO_SUFFIX,sample_init
clear,400,,sample_init \
121 add add
, add
,400 add
,400, add
,400,$tmp.
$DSO_SUFFIX add
,400,$tmp.
$DSO_SUFFIX, \
122 add
,400,$tmp.
$DSO_SUFFIX,sample_init \
123 del del
, del
,30 del
,30, del
,,sample
/pmda_sample.
$DSO_SUFFIX \
124 del
,30,sample
/pmda_sample.
$DSO_SUFFIX, \
125 del
,30,sample
/pmda_sample.
$DSO_SUFFIX,sample_init \
126 del
,, del
,,, del
,,,sample_init
128 echo "+++ -K $spec +++" | _filter
129 $sudo pminfo
-Dcontext -fmL -n $tmp.pmns
-K $spec \
130 sample.string.write_me qa.string.write_me
2>&1 \
135 echo "=== some __pmLocalPMDA() exercises ==="
136 pminfo
-Dcontext -fmL -n $tmp.pmns
-K clear \
137 -K add
,30,$PCP_VAR_DIR/pmdas
/sample
/pmda_sample.
$DSO_SUFFIX,sample_init \
138 -K add
,400,$tmp.
$DSO_SUFFIX,sample_init \
141 -K add
,30,$PCP_VAR_DIR/pmdas
/sample
/pmda_sample.
$DSO_SUFFIX,sample_init \
142 -K del
,0,$PCP_VAR_DIR/pmdas
/sample
/pmda_sample.
$DSO_SUFFIX,0 \
143 -K add
,130,$PCP_VAR_DIR/pmdas
/sample
/pmda_sample.
$DSO_SUFFIX,sample_init \
144 -K add
,400,$tmp.
$DSO_SUFFIX,sample_init \
149 echo "=== other tools than know about -K ..."
150 pmval
-s 3 -t 0.1 -K clear -K add
,30,$PCP_PMDAS_DIR/sample
/pmda_sample.
$DSO_SUFFIX,sample_init
'@:sampledso.bin["bin-100","bin-900"]' | _filter
152 pmprobe
-K clear -K add
,30,$PCP_PMDAS_DIR/sample
/pmda_sample.
$DSO_SUFFIX,sample_init
-I sampledso.bin