Drop unused condition check
[pcp.git] / qa / 215
blobc05dbabdc6a9f68225153be0ff5dfd4b3a794636
1 #! /bin/sh
2 # PCP QA Test No. 215
3 # libpcp_socks + pmsocks testing
5 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
8 seq=`basename $0`
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
12 . ./common.product
13 . ./common.filter
14 . ./common.check
16 . ./common.config
18 if [ "`pmsocks echo ok 2>&1`" != ok ]
19 then
20 echo "pmsocks is not installed and/or not configured" >$seq.notrun
21 echo "$seq: [not run] `cat $seq.notrun`"
22 exit 0
25 rm -f $seq.out
26 if [ $PCP_PLATFORM = linux ]
27 then
28 ln $seq.out.linux $seq.out
29 else
30 echo "Warning: no validated output for $PCP_PLATFORM"
33 status=0
34 signal=$PCP_BINADM_DIR/pmsignal
35 trap "_interrupt; rm -f $tmp.*; exit \$status" 0 1 2 3 15
37 _interrupt()
39 [ "X$KILLER" != "X" ] && $signal -s TERM $KILLER
42 _filter()
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" ]
53 then
54 echo "Cannot find a suitable remote pmcd host" >$seq.notrun
55 echo "$seq: [not run] `cat $seq.notrun`"
56 exit
58 dname=`pmhostname | sed -e 's/^[a-z0-9]*\.//'`
59 if ! grep sgi $dname >/dev/null
60 then
61 echo "QA host is not in the SGI domain" >$seq.notrun
62 echo "$seq: [not run] `cat $seq.notrun`"
63 exit
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`
69 SOCKS_DEBUG=
70 PMCD_CONNECT_TIMEOUT=120
71 PMCD_REQUEST_TIMEOUT=120
72 export SOCKS_SERVER SOCKS_NS SOCKS_DEBUG PMCD_CONNECT_TIMEOUT PMCD_REQUEST_TIMEOUT
73 rm -f $seq.full
74 touch $seq.full
76 KILLER=""
77 for host in www.sgi.com.au $otherhost localhost
79 for i in 1 2
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 &
84 KILLER="$KILLER $!"
85 done
86 done
88 echo "pmlogger launch, waiting ..."
89 p=1
90 for host in www.sgi.com.au $otherhost localhost
92 for i in 1 2
94 pid=`echo $KILLER | $PCP_AWK_PROG '{ x='"$p"'; print $x }'`
95 _wait_for_pmlogger $pid $tmp.${host}_$i.log 120
96 p=`expr $p + 1`
97 done
98 done
100 for host in localhost $otherhost www.sgi.com.au
102 for i in 1 2
104 echo
105 if [ $host = $otherhost ]
106 then
107 echo "=== pmlogger for OTHERHOST #$i connection ==="
108 echo "=== pmlogger for OTHERHOST #$i connection ===" >>$seq.full
109 else
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
116 done
117 done
120 $signal -s TERM $KILLER
121 sleep 2
122 KILLER=
125 echo
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
131 echo
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
139 echo
140 if [ $host = $otherhost ]
141 then
142 echo "=== host OTHERHOST pmval connection ==="
143 echo "=== host OTHERHOST pmval connection ===" >>$seq.full
144 else
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
150 done
152 # optional stuff if your test has verbose output to help resolve problems
153 echo
154 echo "If failure, check $seq.full (this) and $seq.full.ok (reference)"
156 # all done
157 exit