3 # Errors in pmcd.conf [acccess] that should not prevent pmcd starting
5 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
9 echo "QA output created by $seq"
11 # get standard filters
19 ln $seq.out.ipv6
$seq.out ||
exit 1
21 ln $seq.out.nonipv6
$seq.out ||
exit 1
30 if [ -f $tmp.pmcd.conf
]
32 $sudo cp $tmp.pmcd.conf
$PCP_PMCDCONF_PATH
35 $sudo $PCP_RC_DIR/pcp restart | _filter_pcp_start
45 $sudo rm -rf $tmp.
* $seq.full
46 trap "_cleanup; exit \$status" 0 1 2 3 15
49 eval `./getpmcdhosts -L -n 2 2>$tmp.out | sed -e 's/^/other1=/' -e 's/ / other2=/'`
50 echo "other1=$other1" >$seq.full
51 echo "other2=$other2" >>$seq.full
52 echo "qahost=$qahost" >>$seq.full
53 [ -z "$other1" ] && _notrun
"Cannot find first remote host running pmcd"
54 [ -z "$other2" ] && _notrun
"Cannot find second remote host running pmcd"
56 # real QA test starts here
59 # copy the pmcd config file to restore state later.
60 cp $PCP_PMCDCONF_PATH $tmp.pmcd.conf
62 if [ $PCP_PLATFORM = linux
]
64 cat <<End-of-File >$tmp.tmp
67 linux 60 dso linux_init $PCP_PMDAS_DIR/linux/pmda_linux.so
68 pmcd 2 dso pmcd_init $PCP_PMDAS_DIR/pmcd/pmda_pmcd.so
71 elif [ $PCP_PLATFORM = darwin
]
73 cat <<End-of-File >$tmp.tmp
76 darwin 78 dso darwin_init $PCP_PMDAS_DIR/darwin/pmda_darwin.dylib
77 pmcd 2 dso pmcd_init $PCP_PMDAS_DIR/pmcd/pmda_pmcd.dylib
80 elif [ $PCP_PLATFORM = solaris
]
82 cat <<End-of-File >$tmp.tmp
85 solaris 75 dso solaris_init $PCP_PMDAS_DIR/solaris/pmda_solaris.so
86 pmcd 2 dso pmcd_init $PCP_PMDAS_DIR/pmcd/pmda_pmcd.so
90 echo "Arrgh ... need pmcd.conf for $PCP_PLATFORM"
94 cat <<End-of-File >>$tmp.tmp
97 allow no.such.host.pcp.io : all;
98 allow nohost.engr.sgi.com, $qahost : all;
99 allow $other1, no.such.host.pcp.io, localhost : fetch;
100 allow localhost, $other2, nohost.melbourne.sgi.com : store;
101 allow "local:" , "unix:" : all;
105 echo "# from qa/$seq" >> $tmp.tmp
107 $sudo cp $tmp.tmp
$PCP_PMCDCONF_PATH
109 echo "=== pmcd.conf ===" >>$seq.full
110 cat $PCP_PMCDCONF_PATH >>$seq.full
112 $sudo $PCP_RC_DIR/pcp restart | _filter_pcp_start
115 cat $PCP_PMCDLOG_PATH >>$seq.full
117 echo "=== pmcd.log ===" >>$seq.full
118 _filter_pmcd_log
<$PCP_PMCDLOG_PATH \
121 s/ [12] dso/1-or-2 dso/
122 s/lib=\/usr\//lib=\/usr-or-var\//
123 s/lib=\/var\//lib=\/usr-or-var\//
125 -e 's/__pmGetAddrInfo/gethostbyname/g' \
126 -e 's/__pmGetHostByName/gethostbyname/g' \
127 -e '/gethostbyname(/s/ Unknown host/ No address associated with name/' \
128 -e '/gethostbyname(/s/ Host name lookup failure/ No address associated with name/' \
129 -e '/gethostbyname(/s/ Resolver Error 0 (no error)/ No address associated with name/' \
131 s/ [0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]* / LOCALIP /
135 s/ [0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]* / OTHERIP1 /
139 s/ [0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]* / OTHERIP2 /
142 -e "s/$qahost\$/LOCALHOST/g" \
143 -e "s/$other1\$/OTHERHOST1/g" \
144 -e "s/$other2\$/OTHERHOST2/g" \
145 -e '/UNIX_DOMAIN_SOCKET/d' \
147 -e '/error sending Conn ACK PDU/d' \
148 -e "s/[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]/<hexnum>/" \
150 $8 ~ /^[A-Z]+HOST[12]*$/ && $5 ~ /^[0-9a-f]/ {
151 sub(/^[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*$/,"<ipaddr>",$5)
152 sub(/^[0-9a-f:][0-9a-f:]*%[0-9a-z]+$/,"<ipaddr>",$5)
153 sub(/^[0-9a-f:][0-9a-f:]*$/,"<ipaddr>",$5)
157 echo "check pmcd is up and we can get local access" >> $seq.full
158 pmprobe hinv.ncpu
>>$seq.full
2>&1 ||
echo "ACCESS DENIED"