blob: 4d49b8fa3ce12588238d476174d1d125b3b7d0d0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
#! /bin/sh
# PCP QA Test No. 210
# Check dynamic metrics work with PMAPI clients - DSO PMDA version
# See also 467 for the related tests using pmdumptext
#
# 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 ' RESERVED_DO_NOT_USE[ ]*511' $PCP_VAR_DIR/pmns/stdpmid
then
:
else
echo "No support for dynamic PMNS entries" >$seq.notrun
echo "$seq: [not run] `cat $seq.notrun`"
exit 0
fi
status=0 # success is the default!
$sudo rm -rf $tmp.*
trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
rm -f $seq.full
_filter_probe()
{
$PCP_AWK_PROG '
# sample ... sampledso.secret.foo.bar.max.redirect 8 0 0 0 0 0 0 4 0
/secret\.foo\.bar\.max\.redirect/ { if ($2 > 3 )
print $1,"> 3 values ..."
else
print
next
}
{ print }'
}
_do() {
echo
echo "== $* =="
pminfo $* | LC_COLLATE=POSIX sort
pmprobe -v $* | _filter_probe | LC_COLLATE=POSIX sort
}
# real QA test starts here
echo "PMNS traversal tests ..."
pminfo sampledso | grep '\.secret\.' | LC_COLLATE=POSIX sort
_do sampledso.secret
_do sampledso.secret.bar sampledso.secret.foo
_do sampledso.secret.foo.bar.grunt
echo
echo "pmval ..."
pmval -s 3 -t 0.1 sampledso.secret.foo.bar.grunt.five \
| sed -e '/^host:.*$/s/.*/HOST/'
echo
echo "pmie ..."
echo 'sampledso.secret.foo.bar.four == 4 -> print "Bingo!"' \
| pmie -t 0.1 -T 0.3 2>&1 \
| _filter_pmie_log \
| sed -e '/.* Info: evaluator exiting/d' \
| sort -u
echo
echo "pmlogger ..."
cat <<'End-of-File' >$tmp.config
log mandatory on 100 msec {
sampledso.secret.bar
sampledso.secret.foo.one
sampledso.secret.foo.two
sampledso.secret.foo.bar.three
sampledso.secret.foo.bar.four
sampledso.secret.foo.bar.grunt
}
End-of-File
echo "+ pmlogger -T 0.3 -c $tmp.config -l $tmp.log $tmp" >>$seq.full
pmlogger -T 0.3 -c $tmp.config -l $tmp.log $tmp
cat $tmp.log >>$seq.full
pmdumplog $tmp 2>&1 \
| tee -a $seq.full \
| _filter_pmdumplog \
| sed -e 1,4d
exit
|