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/651 | |
download | pcp-debian.tar.gz |
Debian 3.9.10debian/3.9.10debian
Diffstat (limited to 'qa/651')
-rwxr-xr-x | qa/651 | 98 |
1 files changed, 98 insertions, 0 deletions
@@ -0,0 +1,98 @@ +#! /bin/sh +# PCP QA Test No. 651 +# basic pmproxy functionality +# +# 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 + +[ -x $PCP_BINADM_DIR/pmproxy ] || \ + _notrun "need $PCP_BINADM_DIR/pmproxy" + +hostname=`_get_fqdn` +[ "$hostname" = "localhost" -o "$hostname" = "localhost.localdomain" ] && \ + _notrun "need sensible setup, not simply hostname => localhost" + +# for newer versions, we default to local sockets with different +# access controls. dodge that, and test the usual pmproxy path. +target="" +test $PCP_VER -ge 3803 && target="-h $hostname" + +_filter() +{ + sed \ + -e "s/$hostname/MYHOST/" \ + -e "s/`hostname`/MYHOST/" \ + -e "s/localhost/MYHOST/" \ + -e "s/local:/MYHOST/" \ + -e '/hinv.ncpu/s/ 1 [0-9][0-9]*/ 1 <n>/' +} + +signal=$PCP_BINADM_DIR/pmsignal +username=`id -u -n` +status=0 # success is the default! +$sudo rm -rf $tmp.* +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + rm -f $tmp.* + $sudo $signal -a pmproxy +} + +# real QA test starts here +$sudo $signal -a pmproxy +sleep 1 + +export PMCD_HOST=localhost +export PMPROXY_HOST=$hostname +proxyargs="" +id pcp >/dev/null 2>&1 && proxyargs="$proxyargs -U $username" + +echo "== pmproxy not running ==" +pmprobe $target -v sample.long.hundred 2>&1 | _filter + +echo +echo "== simplest default case ==" +$PCP_BINADM_DIR/pmproxy $proxyargs +sleep 1 +pmprobe $target -v sample.long.hundred 2>&1 | _filter + +echo +echo "== simple explicit host case ==" +pmprobe -v -h localhost hinv.ncpu 2>&1 | _filter + +echo +echo "== non-standard PMPROXY_PORT, expect failure ==" +export PMPROXY_PORT=94322 +pmprobe $target -v sample.long.hundred 2>&1 | _filter + +echo +echo "== non-standard PMPROXY_PORT, expect success ==" +$sudo $PCP_BINADM_DIR/pmsignal -a pmproxy +$PCP_BINADM_DIR/pmproxy $proxyargs +sleep 1 +pmprobe $target -v sample.long.hundred 2>&1 | _filter + +echo +echo "== restricted interface for connections, expect failure ==" +unset PMPROXY_PORT +$sudo $PCP_BINADM_DIR/pmsignal -a pmproxy +$PCP_BINADM_DIR/pmproxy -i 127.0.0.1 $proxyargs +sleep 1 +pmprobe $target -v sample.long.hundred 2>&1 | _filter + +echo +echo "== restricted interface for connections, expect success ==" +export PMPROXY_HOST=localhost +pmprobe $target -v sample.long.hundred 2>&1 | _filter + +# success, all done +exit |