#! /bin/sh # PCP QA Test No. 274 # Throw a broken PMDA at PCP 2.0 libpcp_pmda and dbpmda # # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved. # seq=`basename $0` echo "QA output created by $seq" # get standard environment, filters and checks . ./common.product . ./common.filter . ./common.check rm -f $seq.out if [ $PCP_VER -lt 3600 ] then ln $seq.out.1 $seq.out else ln $seq.out.2 $seq.out fi status=1 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 _filter() { # "dbpmda> $" filter for Linux sed \ -e '/pmResult/s/0x[^ ]*/ADDR/g' \ -e '/pmResult/s/amp: 0.000000 .* numpmid:/amp: EPOCH in LOCALTIME numpmid:/' \ -e 's/\/tmp.*/logfile/g' \ -e 's/\(broken_pmda_2_[0-9]\)([0-9][0-9]*)/\1(PID)/' \ -e 's/[A-Z][a-z][a-z] [A-Z][a-z][a-z] *[0-9][0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9]/DATE/' \ -e 's/ [0-9\.]*e-[0-9]* 0x/ REAL 0x/g' \ -e 's/ 0 0x/ REAL 0x/g' \ -e '/dbpmda> $/d' \ -e '/Error PDU:/s/One-line/Oneline/' # last sed substitution thanks to pv:937345 which changed the wording # ... preserving the old form so QA passes } _filter2() { sed \ -e 's/^\[.*\] broken_pmda_2_.([0-9]*)/broken pmda/g' \ -e '/Info: direct map =/d' \ -e '/Info: metric map =/d' \ -e 's/^Log for.*/Log started/g' \ -e 's/^Log finished.*/Log finished/g' } _filter_ins() { sed \ -e 's/.* \(hash table entries\)/ NNN \1/' \ -e 's/.* \(non-leaf nodes\)/ NNN \1/' \ -e 's/.* \(leaf nodes\)/ NNN \1/' \ -e 's/.* \(bytes of symbol table\)/ NNN \1/' } _filterStartBrokenPMDA25 () { # This filter came about as a result of a different ordering of # output in both stdout and stderr from dbpmda in PCP 2.1. This # filter makes it appear as it would in PCP 2.2 onwards so that # the test can detect changes to the text itself rather than the # position of the line "Start broken_pmda_2_5 PMDA..." in the # output for the dbpmda "open" command. $PCP_AWK_PROG ' BEGIN { found = false } /Start broken_pmda_2_5 PMDA: / { if (found = false) found = $0 else found = found $0 next } /dbpmda> / { if ( found != false ) { print found found = false } print $0 next } { print } ' } # real QA test starts here unset ROOT MAKEFLAGS # Install the PMDA cd $here/pmdas/broken $sudo ./broken_Install -N < /dev/null | _filter_ins cd $here # Remove the PMDA _remove() { cd $here/pmdas/broken $sudo ./broken_Remove -N cd $here } trap "_remove; exit \$status" 0 1 2 3 15 dbpmda -ie 2>&1 <&1 <&1 <&1 <&1 <&1 <