3 # Exercise the named PMDA.
5 # Copyright (c) 2016 Red Hat.
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
16 [ -d "$PCP_PMDAS_DIR/named" ] || _notrun
"named PMDA not installed"
17 perl
-e "use PCP::PMDA" >/dev
/null
2>&1
18 [ $?
-eq 0 ] || _notrun
"perl PCP::PMDA module not installed"
20 status
=1 # failure is the default!
21 $sudo rm -rf $tmp $tmp.
* $seq.full
25 $sudo rm -f $here/named.log
28 trap "_cleanup; exit \$status" 0 1 2 3 15
30 # PMNS order is non-deterministic
32 # non-leaf nameserver <--- sort
33 # leaf interval <--- sort
34 # dbpmda> desc named.interval
40 state == 1 && $1 == "dbpmda>" { state = 2 }
41 { outname = "'$tmp'." state; print >outname }
42 $1 == "Metric:" { state = 1 }'
43 ( cat $tmp.0 ; LC_COLLATE
=POSIX
sort $tmp.1; cat $tmp.2 ) \
45 -e "s;$PCP_PMDAS_DIR;\$PCP_PMDAS_DIR;" \
46 -e "s;$script;pmdanamed.pl;" \
47 -e '/Direct mapping for metrics disabled/d' \
54 -e 's/^\(Log for pmda[^ ]* on\) .*/\1 HOST .../' \
55 -e 's/^\(Log finished\) .*/\1 .../' \
61 # real QA test starts here
62 script=$PCP_PMDAS_DIR/named
/pmdanamed.pl
64 # create a set of commands for dbpmda
65 cat >$tmp.cmds
<<End-of-File
66 open pipe /usr/bin/env perl $script
72 export NAMED_STATS_USER
=`id -u -n`
73 export NAMED_STATS_PROG
=`which true`
75 # iterate over all of the pre-canned staticstics files
77 for file in $test/*.txt
79 export NAMED_STATS_FILE
="$file"
80 PCP_PERL_PMNS
=root
/usr
/bin
/env perl
$script > $tmp.root
82 echo === Test
case: `basename $file`
84 dbpmda
-n $tmp.root
-ie < $tmp.cmds
2>&1 | _filter
85 _filter_pmda_log
< named.log