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" \
70 -e "/^Local Context PMDA Table/d" \
72 -e "s/host: @/host: HOST/g" \
73 -e "s/host: $host/host: HOST/g" \
74 -e "s;$PCP_PMCDCONF_PATH;\$PCP_PMCDCONF_PATH;" \
75 -e "s;$PCP_VAR_DIR;\$PCP_VAR_DIR;" \
76 -e "s/\.$DSO_SUFFIX/.\$DSO_SUFFIX/g" \
77 -e '/^0*x*[0-9a-f][0-9a-f]* /d' \
78 -e '/^\[[0-9][0-9]*]/d' \
79 -e '/^__pmLocalPMDA(/d' \
80 -e '/^__pmSetSocketIPC:/d' \
81 -e '/NotifyEndLocalContext: .*pmda_linux/d' \
82 -e '/^IPC table fd(/d' \
86 # -e "s;$PCP_PMDAS_DIR;\$PCP_PMDAS_DIR;" \
87 # -e "s;$PCP_VAR_DIR;\$PCP_VAR_DIR;g" \
89 # real QA test starts here
90 pminfo
-fL -n $tmp.pmns
-K clear -K add
,400,$PCP_VAR_DIR/pmdas
/sample
/pmda_sample.
$DSO_SUFFIX,sample_init qa.colour
93 pminfo
-fL -n $tmp.pmns
-K clear -K add
,400,$PCP_VAR_DIR/pmdas
/sample
/pmda_sample
,sample_init qa.pid
>$tmp.out
&
96 got
=`sed -n -e '/value/s/.*value //p' $tmp.out`
97 if [ "$got" != "$expect" ]
99 echo "Error: expecting pid $expect, got $got from"
102 echo "PID check passes"
106 echo "=== expect no sample metrics ==="
107 pminfo
-fmL -n $tmp.pmns
-K clear -K add
,400,sample
/pmda_sample.
$DSO_SUFFIX,sample_init qa.colour sample.colour
110 echo "=== sample metrics this time ==="
111 # need to copy DSO so running sample_init() only once per DSO
112 cp $PCP_VAR_DIR/pmdas
/sample
/pmda_sample.
$DSO_SUFFIX $tmp.
$DSO_SUFFIX
113 export PMDA_LOCAL_SAMPLE
=yes
114 $sudo pminfo
-fmL -n $tmp.pmns
-K add
,400,$tmp.
$DSO_SUFFIX,sample_init qa.colour sample.colour
117 echo "=== -K spec parsing in pminfo ==="
119 clear clear, clear,400 clear,400, clear,400,$tmp.
$DSO_SUFFIX clear,400,$tmp.
$DSO_SUFFIX, \
120 clear,400,$tmp.
$DSO_SUFFIX,sample_init
clear,,$tmp.
$DSO_SUFFIX,sample_init
clear,,,sample_init \
121 clear,,$tmp.
$DSO_SUFFIX,sample_init
clear,400,,sample_init \
122 add add
, add
,400 add
,400, add
,400,$tmp.
$DSO_SUFFIX add
,400,$tmp.
$DSO_SUFFIX, \
123 add
,400,$tmp.
$DSO_SUFFIX,sample_init \
124 del del
, del
,30 del
,30, del
,,sample
/pmda_sample.
$DSO_SUFFIX \
125 del
,30,sample
/pmda_sample.
$DSO_SUFFIX, \
126 del
,30,sample
/pmda_sample.
$DSO_SUFFIX,sample_init \
127 del
,, del
,,, del
,,,sample_init
129 echo "+++ -K $spec +++" | _filter
130 $sudo pminfo
-Dcontext -fmL -n $tmp.pmns
-K $spec \
131 sample.string.write_me qa.string.write_me
2>&1 \
136 echo "=== some __pmLocalPMDA() exercises ==="
137 pminfo
-Dcontext -fmL -n $tmp.pmns
-K clear \
138 -K add
,30,$PCP_VAR_DIR/pmdas
/sample
/pmda_sample.
$DSO_SUFFIX,sample_init \
139 -K add
,400,$tmp.
$DSO_SUFFIX,sample_init \
142 -K add
,30,$PCP_VAR_DIR/pmdas
/sample
/pmda_sample.
$DSO_SUFFIX,sample_init \
143 -K del
,0,$PCP_VAR_DIR/pmdas
/sample
/pmda_sample.
$DSO_SUFFIX,0 \
144 -K add
,130,$PCP_VAR_DIR/pmdas
/sample
/pmda_sample.
$DSO_SUFFIX,sample_init \
145 -K add
,400,$tmp.
$DSO_SUFFIX,sample_init \
150 echo "=== other tools than know about -K ..."
151 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
153 pmprobe
-K clear -K add
,30,$PCP_PMDAS_DIR/sample
/pmda_sample.
$DSO_SUFFIX,sample_init
-I sampledso.bin