From 47e6e7c84f008a53061e661f31ae96629bc694ef Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Sun, 26 Oct 2014 12:33:50 +0400 Subject: Debian 3.9.10 --- qa/1017 | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100755 qa/1017 (limited to 'qa/1017') diff --git a/qa/1017 b/qa/1017 new file mode 100755 index 0000000..486711e --- /dev/null +++ b/qa/1017 @@ -0,0 +1,93 @@ +#!/bin/sh +# PCP QA Test No. 1017 +# Test QmcMetric functionality +# +seq=`basename $0` +echo "QA output created by $seq" +. ./common.qt + +[ -x qt/qmc_metric/qmc_metric ] || _notrun "qmc_metric not built or installed" + +status=1 # failure is the default! +trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 + +SIMPLE_CONF=$PCP_PMDAS_DIR/simple/simple.conf +status=1 # failure is the default! +rm -f $seq.full + +_cleanup() +{ + [ -f $tmp.conf ] && $sudo cp $tmp.conf $PCP_PMDAS_DIR/simple/simple.conf + [ -f $tmp.pmcd.conf ] && $sudo cp $tmp.pmcd.conf $PCP_PMCDCONF_PATH + $sudo killall -HUP pmcd + _wait_for_pmcd + rm -f $tmp.* +} + +_filter() +{ + tee $here/$seq.full |\ + sed \ + -e "s/$host/HOST/g" \ + -e "/^sample\.seconds/s/= 0.9[0-9]*/= 1/g" \ + -e "/^sample\.seconds/s/= 1.0[0-9]*/= 1/g" \ + -e "/^sample\.seconds/s/= 1 /= NUMBER /g" \ + -e "/^sample\.seconds/s/= 0 /= NUMBER /g" \ + -e '/ minute" /s/= [0-9][0-9]*\.[0-9]*/= NUMBER/g' \ + -e '/ minute" /s/= [0-9][0-9]*/= NUMBER/g' \ + -e "s/ptr = 0x[1-9a-f][0-9a-f]*/ptr = 0x########/g" \ + -e '/"sec"/{ +s/[0-9][0-9]* none/VALUE none/ +s/\[[0-9][0-9]*]/[I]/ +}' \ + -e '/"min"/{ +s/[0-9][0-9]* none/VALUE none/ +s/\[[0-9][0-9]*]/[J]/ +}' \ + -e '/"hour"/{ +s/[0-9][0-9]* none/VALUE none/ +s/\[[0-9][0-9]*]/[K]/ +}' \ + -e "/hinv\.ncpu =/s/[0-9][0-9]* none/VALUE none/" \ + -e "/lookupDesc:/s/29\.0\.31$//" \ + -e "/lookupDesc:/s/29\.0\.6$//" \ + -e "/lookupDesc:/s/29\.0\.2$//" \ + -e "/lookupDesc:/s/1\.18\.2$//" \ + -e "/lookupDesc:/s/60\.0\.32$//" \ + -e "/lookupDesc:/s/1\.18\.3$//" \ + -e "/lookupDesc:/s/60\.2\.0$//" \ + -e "/lookupPMID:/s/60\.2\.0$//" \ + -e "/lookupInDom:/s/1\.5$//" \ + -e "/lookupInDom:/s/60\.2$//" \ + -e "/lookupInDom:/s/29\.2$//" \ + -e "/::genProfile/s/id = [0-9]*,/id = NNN,/" \ + -e "/::genProfile/s/ptr = 0$/ptr = 0x0/" + +} + +trap "_cleanup; exit \$status" 0 1 2 3 15 + +# real QA test starts here + +cp $SIMPLE_CONF $tmp.conf +echo "sec" > $tmp.newconf +$sudo rm -f $SIMPLE_CONF +$sudo cp $tmp.newconf $SIMPLE_CONF + +cp $PCP_PMCDCONF_PATH $tmp.pmcd.conf +cd $PCP_PMDAS_DIR/simple +$sudo ./Install $tmp.install 2>&1 +_check_metric simple.now + +cd $here/qt/qmc_metric +$sudo ./qmc_metric -DPMC,OPTFETCH 2>&1 | _filter + +cd $PCP_PMDAS_DIR/simple +$sudo cp $tmp.pmcd.conf $PCP_PMCDCONF_PATH +$sudo cp $tmp.conf $SIMPLE_CONF +rm -f $tmp.pmcd.conf $tmp.conf +$sudo ./Remove $tmp.remove 2>&1 + +# success, all done +status=0 +exit -- cgit v1.2.3