3 # basic pmproxy functionality
5 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
16 [ -x $PCP_BINADM_DIR/pmproxy
] || \
17 _notrun
"need $PCP_BINADM_DIR/pmproxy"
22 [ "$hostname" = "localhost" -o "$hostname" = "localhost.localdomain" ] && \
23 _notrun
"need sensible setup, not simply hostname => localhost"
25 echo "hostname=$hostname" >>$seq.full
27 # for newer versions, we default to local sockets with different
28 # access controls. dodge that, and test the usual pmproxy path.
34 -e "s/$hostname/MYHOST/" \
35 -e "s/`hostname`/MYHOST/" \
36 -e "s/localhost/MYHOST/" \
37 -e "s/local:/MYHOST/" \
38 -e '/hinv.ncpu/s/ 1 [0-9][0-9]*/ 1 <n>/'
41 signal
=$PCP_BINADM_DIR/pmsignal
43 status
=0 # success is the default!
45 trap "_cleanup; exit \$status" 0 1 2 3 15
50 $sudo $signal -a pmproxy
53 # real QA test starts here
54 $sudo $signal -a pmproxy
57 export PMCD_HOST
=localhost
58 export PMPROXY_HOST
=$hostname
60 id pcp
>/dev
/null
2>&1 && proxyargs
="$proxyargs -U $username"
62 echo "== pmproxy not running =="
63 pmprobe
$target -v sample.long.hundred
2>&1 | _filter
66 echo "== simplest default case =="
67 $PCP_BINADM_DIR/pmproxy
$proxyargs
69 pmprobe
$target -v sample.long.hundred
2>&1 | _filter
72 echo "== simple explicit host case =="
73 pmprobe
-v -h localhost hinv.ncpu
2>&1 | _filter
76 echo "== non-standard PMPROXY_PORT, expect failure =="
77 export PMPROXY_PORT
=94322
78 pmprobe
$target -v sample.long.hundred
2>&1 | _filter
81 echo "== non-standard PMPROXY_PORT, expect success =="
82 $sudo $PCP_BINADM_DIR/pmsignal
-a pmproxy
83 $PCP_BINADM_DIR/pmproxy
$proxyargs
85 pmprobe
$target -v sample.long.hundred
2>&1 | _filter
88 echo "== restricted interface for connections, expect failure =="
90 $sudo $PCP_BINADM_DIR/pmsignal
-a pmproxy
91 $PCP_BINADM_DIR/pmproxy
-i 127.0.0.1 $proxyargs
93 pmprobe
$target -v sample.long.hundred
2>&1 | _filter
96 echo "== restricted interface for connections, expect success =="
97 export PMPROXY_HOST
=localhost
98 pmprobe
$target -v sample.long.hundred
2>&1 | _filter