summaryrefslogtreecommitdiff
path: root/qa/468
blob: 57fa85cba122a699a4994d0edbc64a0034602fe4 (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
#!/bin/sh
# PCP QA Test No. 468
# Check dynamic metrics work with PMAPI clients - DAEMON PMDA version
# pmdumptext test from 211
#
# Copyright (c) 2009,2011 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

grep -q ' RESERVED_DO_NOT_USE[ 	]*511' $PCP_VAR_DIR/pmns/stdpmid || \
    _notrun "No support for dynamic PMNS entries"
which pmdumptext >/dev/null 2>&1 || _notrun "pmdumptext not installed"

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_dumptext()
{
    _filter_pmdumptext \
    | sed -e '/^Time[ 	]/s/[ 	][^:]*:/ HOST:/g' \
    | $PCP_AWK_PROG '
NR == 1		{ for (i = 1; i <= NF; i++) {
		    if ($i ~ /\.max\.redirect/)
			state[i] = 0
		    else
			state[i] = 1
		  }
		}
		{ for (i = 1; i <= NF; i++) {
		    if (state[i]) printf "%s ",$i
		  }
		  print ""
		}'
}

_do() {
    echo
    echo "== $* =="
    pmdumptext -H -s 3 $* | _filter_dumptext
}

# real QA test starts here

echo "PMNS traversal tests ..."
pminfo sample | grep '\.secret\.' | LC_COLLATE=POSIX sort
_do sample.secret
_do sample.secret.bar sample.secret.foo
_do sample.secret.foo.bar.grunt

exit