diff options
Diffstat (limited to 'qa/444')
-rwxr-xr-x | qa/444 | 58 |
1 files changed, 58 insertions, 0 deletions
@@ -0,0 +1,58 @@ +#!/bin/sh +# PCP QA Test No. 444 +# pmid and desc cacheing in pmevent +# +# Copyright (c) 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 + +rm -f $seq.out +if [ $PCP_VER -ge 3805 ] +then + ln $seq.out.3 $seq.out || exit 1 +elif [ $PCP_VER -ge 3803 ] +then + ln $seq.out.2 $seq.out || exit 1 +else + ln $seq.out.1 $seq.out || exit 1 +fi + +status=0 # success is the default! +host=`hostname` +$sudo rm -rf $tmp.* $seq.full +trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 + +# real QA test starts here +pmstore sample.event.reset 0 >/dev/null 2>&1 +pmevent -Dpdu -t 10msec -s 20 sample.event.records >$tmp.out 2>&1 +cat $tmp.out >>$seq.full + +# Need to make this not host specific ... +# 2.6.0 (pmcd.client.whoami): numval: 1 valfmt: 2 vlist[]: +# value "bozo-laptop (127.0.0.1) pmevent -Dpdu -t 10msec -s 20 sample.event.records" +# pmXmitPDU: RESULT fd=<fd> len=124 +# +sed <$tmp.out \ + -e '/^[0-9][0-9]*:/d' \ + -e 's/^\[[0-9]*]//' \ + -e '/pmResult/s/ .* numpmid/ ... numpmid/' \ + -e "s/ value \"$host\"/ value \"HOST\"/g" \ + -e "s/host: $host/host: localhost/g" \ + -e 's/[0-2][0-9]:[0-5][0-9]:[0-5][0-9]\.[0-9][0-9][0-9]/TIMESTAMP/g' \ + -e 's/fd=[0-9][0-9]*/fd=<fd>/g' \ +| $PCP_AWK_PROG ' BEGIN { hostskip=0 } +/^pmXmitPDU: FETCH fd=<fd> len=/ { hostskip++; } +/^pmGetPDU: RESULT fd=<fd> len=/ { if (hostskip < 2) { next } } +/pmcd.client.whoami/ { print; skip=2; next } +skip > 0 { print "blah blah ..."; skip--; next } + { print }' + +# success, all done +exit |