summaryrefslogtreecommitdiff
path: root/qa/215
blob: dd19c265f5100c0f631889c5054eb1c77e12663a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
#! /bin/sh
# PCP QA Test No. 215
# libpcp_socks + pmsocks testing
#
# Copyright (c) 1995-2002 Silicon Graphics, Inc.  All Rights Reserved.
#

seq=`basename $0`
echo "QA output created by $seq"

if [ "`pmsocks echo ok 2>&1`" != ok ]
then
    echo "pmsocks is not installed and/or not configured" >$seq.notrun
    echo "$seq: [not run] `cat $seq.notrun`"
    exit 0
fi

rm -f $seq.out
. ./localconfig
if [ $PCP_PLATFORM = linux ]
then
    ln $seq.out.linux $seq.out
elif [ $PCP_PLATFORM = irix ]
then
    ln $seq.out.irix $seq.out
else
    echo "Warning: no validated output for $PCP_PLATFORM"
fi

# get standard filters
. ./common.filter
. ./common.check
. ./common.product
. ./common.config

status=0
signal=$PCP_BINADM_DIR/pmsignal
trap "_interrupt; rm -f $tmp.*; exit \$status" 0 1 2 3 15

_interrupt()
{
    [ "X$KILLER" != "X" ] && $signal -s TERM $KILLER
}

_filter()
{
    egrep '(Rconnect direct)|(debug)|(value)|(^[ 0-9]*$)' \
	| sed -e 's/ret=0,.*/no error/' \
	| sed -e 's/discrete instantaneous/DISCRETE or INSTANTANEOUS/' \
	| sed -e 's/instantaneous/DISCRETE or INSTANTANEOUS/'
}

# real QA test starts here
otherhost=`./getpmcdhosts -L -n 1 2>$tmp.out`
if [ -z "$otherhost" ]
then
    echo "Cannot find a suitable remote pmcd host" >$seq.notrun
    echo "$seq: [not run] `cat $seq.notrun`"
    exit
fi
dname=`pmhostname | sed -e 's/^[a-z0-9]*\.//'`
if ! grep sgi $dname >/dev/null
then
    echo "QA host is not in the SGI domain" >$seq.notrun
    echo "$seq: [not run] `cat $seq.notrun`"
    exit
fi

SOCKS_SERVER=$PCPQA_SOCKS_SERVER
SOCKS_NS=`_host_to_ipaddr $SOCKS_SERVER`
SOCKS_DEBUG=
PMCD_CONNECT_TIMEOUT=120
PMCD_REQUEST_TIMEOUT=120
export SOCKS_SERVER SOCKS_NS SOCKS_DEBUG PMCD_CONNECT_TIMEOUT PMCD_REQUEST_TIMEOUT
rm -f $seq.full
touch $seq.full

KILLER=""
for host in www.sgi.com.au $otherhost localhost
do
    for i in 1 2
    do
	rm -f $tmp.${host}_${i}*
	echo "log advisory on once pmcd.control" \
		| pmsocks pmlogger -h $host -l $tmp.${host}_$i.log $tmp.${host}_$i >$tmp.${host}_$i.err 2>&1 &
	KILLER="$KILLER $!"
    done
done

echo "pmlogger launch, waiting ..."
p=1
for host in www.sgi.com.au $otherhost localhost
do
    for i in 1 2
    do
	pid=`echo $KILLER | $PCP_AWK_PROG '{ x='"$p"'; print $x }'`
	_wait_for_pmlogger $pid $tmp.${host}_$i.log 120
	p=`expr $p + 1`
    done
done

for host in localhost $otherhost www.sgi.com.au
do
    for i in 1 2
    do
	echo
	if [ $host = $otherhost ]
	then
	    echo "=== pmlogger for OTHERHOST #$i connection ==="
	    echo "=== pmlogger for OTHERHOST #$i connection ===" >>$seq.full
	else
	    echo "=== pmlogger for $host #$i connection ==="
	    echo "=== pmlogger for $host #$i connection ===" >>$seq.full
	fi
	cat $tmp.${host}_$i.err $tmp.${host}_$i.log | _filter
	cat $tmp.${host}_$i.err $tmp.${host}_$i.log >> $seq.full
	pmdumplog -l $tmp.${host}_$i | _filter_pmdumplog
    done
done


$signal -s TERM $KILLER
sleep 2
KILLER=


echo
echo "=== localhost pmval connection ==="
echo "=== localhost pmval connection ===" >>$seq.full
pmsocks pmval -s1 -t 0.1 pmcd.control.debug 2>&1 \
	| tee -a $seq.full | _filter

echo
echo "=== hostname local pmval connection ==="
echo "=== hostname local pmval connection ===" >>$seq.full
pmsocks pmval -s1 -t 0.1 -h `hostname` pmcd.control.debug 2>&1 \
	| tee -a $seq.full | _filter

for host in $otherhost www.sgi.com.au
do
    echo
    if [ $host = $otherhost ]
    then
	echo "=== host OTHERHOST pmval connection ==="
	echo "=== host OTHERHOST pmval connection ===" >>$seq.full
    else
	echo "=== host $host pmval connection ==="
	echo "=== host $host pmval connection ===" >>$seq.full
    fi
    pmsocks pmval -s1 -t 0.1 -h $host pmcd.control.debug 2>&1 \
	| tee -a $seq.full | _filter
done

# optional stuff if your test has verbose output to help resolve problems
echo
echo "If failure, check $seq.full (this) and $seq.full.ok (reference)"

# all done
exit