3 # libpcp_socks + pmsocks testing
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
18 if [ "`pmsocks echo ok 2>&1`" != ok
]
20 echo "pmsocks is not installed and/or not configured" >$seq.notrun
21 echo "$seq: [not run] `cat $seq.notrun`"
26 if [ $PCP_PLATFORM = linux
]
28 ln $seq.out.linux
$seq.out
30 echo "Warning: no validated output for $PCP_PLATFORM"
34 signal
=$PCP_BINADM_DIR/pmsignal
35 trap "_interrupt; rm -f $tmp.*; exit \$status" 0 1 2 3 15
39 [ "X$KILLER" != "X" ] && $signal -s TERM
$KILLER
44 egrep '(Rconnect direct)|(debug)|(value)|(^[ 0-9]*$)' \
45 |
sed -e 's/ret=0,.*/no error/' \
46 |
sed -e 's/discrete instantaneous/DISCRETE or INSTANTANEOUS/' \
47 |
sed -e 's/instantaneous/DISCRETE or INSTANTANEOUS/'
50 # real QA test starts here
51 otherhost
=`./getpmcdhosts -L -n 1 2>$tmp.out`
52 if [ -z "$otherhost" ]
54 echo "Cannot find a suitable remote pmcd host" >$seq.notrun
55 echo "$seq: [not run] `cat $seq.notrun`"
58 dname
=`pmhostname | sed -e 's/^[a-z0-9]*\.//'`
59 if ! grep sgi
$dname >/dev
/null
61 echo "QA host is not in the SGI domain" >$seq.notrun
62 echo "$seq: [not run] `cat $seq.notrun`"
65 [ -n "$PCPQA_SOCKS_SERVER" ] || _notrun
'PCPQA_SOCKS_SERVER is not set in ./common.config'
67 SOCKS_SERVER
=$PCPQA_SOCKS_SERVER
68 SOCKS_NS
=`_host_to_ipaddr $SOCKS_SERVER`
70 PMCD_CONNECT_TIMEOUT
=120
71 PMCD_REQUEST_TIMEOUT
=120
72 export SOCKS_SERVER SOCKS_NS SOCKS_DEBUG PMCD_CONNECT_TIMEOUT PMCD_REQUEST_TIMEOUT
77 for host in www.sgi.com.au
$otherhost localhost
81 rm -f $tmp.
${host}_
${i}*
82 echo "log advisory on once pmcd.control" \
83 | pmsocks pmlogger
-h $host -l $tmp.
${host}_$i.log $tmp.${host}_$i >$tmp.${host}_
$i.err
2>&1 &
88 echo "pmlogger launch, waiting ..."
90 for host in www.sgi.com.au
$otherhost localhost
94 pid
=`echo $KILLER | $PCP_AWK_PROG '{ x='"$p"'; print $x }'`
95 _wait_for_pmlogger
$pid $tmp.
${host}_
$i.log
120
100 for host in localhost
$otherhost www.sgi.com.au
105 if [ $host = $otherhost ]
107 echo "=== pmlogger for OTHERHOST #$i connection ==="
108 echo "=== pmlogger for OTHERHOST #$i connection ===" >>$seq.full
110 echo "=== pmlogger for $host #$i connection ==="
111 echo "=== pmlogger for $host #$i connection ===" >>$seq.full
113 cat $tmp.
${host}_
$i.err
$tmp.
${host}_
$i.log | _filter
114 cat $tmp.
${host}_
$i.err
$tmp.
${host}_
$i.log
>> $seq.full
115 pmdumplog
-l $tmp.
${host}_
$i | _filter_pmdumplog
120 $signal -s TERM
$KILLER
126 echo "=== localhost pmval connection ==="
127 echo "=== localhost pmval connection ===" >>$seq.full
128 pmsocks pmval
-s1 -t 0.1 pmcd.control.debug
2>&1 \
129 |
tee -a $seq.full | _filter
132 echo "=== hostname local pmval connection ==="
133 echo "=== hostname local pmval connection ===" >>$seq.full
134 pmsocks pmval
-s1 -t 0.1 -h `hostname` pmcd.control.debug
2>&1 \
135 |
tee -a $seq.full | _filter
137 for host in $otherhost www.sgi.com.au
140 if [ $host = $otherhost ]
142 echo "=== host OTHERHOST pmval connection ==="
143 echo "=== host OTHERHOST pmval connection ===" >>$seq.full
145 echo "=== host $host pmval connection ==="
146 echo "=== host $host pmval connection ===" >>$seq.full
148 pmsocks pmval
-s1 -t 0.1 -h $host pmcd.control.debug
2>&1 \
149 |
tee -a $seq.full | _filter
152 # optional stuff if your test has verbose output to help resolve problems
154 echo "If failure, check $seq.full (this) and $seq.full.ok (reference)"