diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2014-10-26 12:33:50 +0400 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2014-10-26 12:33:50 +0400 |
commit | 47e6e7c84f008a53061e661f31ae96629bc694ef (patch) | |
tree | 648a07f3b5b9d67ce19b0fd72e8caa1175c98f1a /qa/116 | |
download | pcp-debian.tar.gz |
Debian 3.9.10debian/3.9.10debian
Diffstat (limited to 'qa/116')
-rwxr-xr-x | qa/116 | 89 |
1 files changed, 89 insertions, 0 deletions
@@ -0,0 +1,89 @@ +#! /bin/sh +# PCP QA Test No. 116 +# Check hyphen in host name +# +# Copyright (c) 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 +. ./common.config + +[ -z "$PCPQA_HYPHEN_HOST" -o "$PCPQA_HYPHEN_HOST" = "some-host" ] && \ + _notrun 'PCPQA_HYPHEN_HOST is not set in ./common.config' + +status=0 # success is the default! +$sudo rm -rf $tmp.* +rm -f $seq.full +trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 + +# real QA test starts here + +host=$PCPQA_HYPHEN_HOST +eval realhost=`pmprobe -v -h $PCPQA_HYPHEN_HOST pmcd.hostname | \ + $PCP_AWK_PROG '{ print $3 }'` +if [ -z "$realhost" ] +then + _notrun "cannot connect to pmcd on $PCPQA_HYPHEN_HOST" +fi +[ "$realhost" = Unknown ] && realhost=`pmhostname $PCPQA_HYPHEN_HOST` + +_filter_pmlc() +{ + sed \ + -e '/primary/d' \ + -e "s/$host/HYPHEN-HOST/" \ + -e "s/$realhost/HYPHEN-HOST/" \ + -e 's/HYPHEN-HOST\.localdomain/HYPHEN-HOST/' \ + -e 's/ *.*/ .../' +} + +_filter() +{ + sed \ + -e "s/$host/HYPHEN-HOST/" \ + -e "s/$realhost/HYPHEN-HOST/" \ + -e 's/HYPHEN-HOST\.localdomain/HYPHEN-HOST/' \ + -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/' +} + +# real QA test starts here + +echo "pmie [hostname in config]" +cat <<End-of-File >$tmp.config +delta = 1; +// note have to quote hostname +2 * pmcd.control.sighup :'$host' - pmcd.control.sighup :'$host'; +End-of-File +cat $tmp.config >$seq.full +pmie -T 2sec -v <$tmp.config >$tmp.out 2>$tmp.err +cat $tmp.out $tmp.err \ +| tee -a $seq.full \ +| sed -e 's/expr_1: */expr_1: /' \ +| _show_pmie_errors + +echo +echo "pmval [metric spec on command line]" +pmval -t0.5 -s 1 $host:pmcd.control.sighup \ +| tee -a $seq.full \ +| _filter + +echo +echo "pmlc [several uses]" +( echo "show loggers"; \ + echo "show loggers@$host"; \ + echo "connect primary@$host"; \ + echo "status" \ +) \ +| pmlc -h $host -P \ +| tee -a $seq.full \ +| _filter_pmlc + +# success, all done +status=0 +exit |