/var/lib/pcp/testsuite/581 is in pcp-testsuite 3.8.12ubuntu1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 | #! /bin/sh
# PCP QA Test No. 581
# pmie, #687355
#
# Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
#
seq=`basename $0`
echo "QA output created by $seq"
# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check
signal=$PCP_BINADM_DIR/pmsignal
status=1 # failure is the default!
control=$PCP_PMDAS_DIR/sample/dynamic.indom
needclean=true
HOST=`hostname`
cat <<End-of-File >$tmp.pmie
// disk indom
some_inst disk.dev.total >= 0 -> print "\nDISK %i";
// cpu indom
some_inst kernel.percpu.cpu.user >= 0 -> print "\nCPU %i";
End-of-File
if [ $PCP_PLATFORM != solaris ]
then
cat <<End-of-File >>$tmp.pmie
// network interface indom
some_inst network.interface.total.packets >= 0 -> print "\nNETWORK %i";
// filesys indom
some_inst filesys.capacity >= 0 -> print "\nFILESYS %i";
End-of-File
fi
cat <<End-of-File >>$tmp.pmie
// sample.mirage
some_inst sample.mirage >= 0 -> print "\nMIRAGE %i";
// the dynamic ones ...
some_inst sample.dynamic.discrete >= 0 -> print "DYN_DISCRETE" " %i";
some_inst sample.dynamic.instant >= 0 -> print "DYN_INSTANT" " %i";
End-of-File
_cleanup()
{
if $needclean
then
$sudo rm -f $control
[ -f $control.$seq ] && $sudo mv $control.$seq $control
_restore_loggers
$sudo $PCP_RC_DIR/pcp restart | _filter_pcp_start
_wait_for_pmcd
_wait_for_pmlogger
needlcean=false
fi
$sudo rm -f $tmp.*
}
_filter()
{
sed \
-e '/value/s/ [0-9]*$/ N/'
}
$sudo rm -f $control.$seq
trap "_cleanup; exit \$status" 0 1 2 3 15
[ -f $control ] && $sudo mv $control $control.$seq
PMCD_RECONNECT_TIMEOUT=1
export PMCD_RECONNECT_TIMEOUT
# instances - mk I
#
cat >$tmp.indom <<End-of-File
10 ten
20 twenty
30 thirty
End-of-File
$sudo rm -f $control
$sudo cp $tmp.indom $control
_disable_loggers
$sudo $PCP_RC_DIR/pcp start | _filter_pcp_start
_wait_for_pmcd
pminfo -f sample.dynamic.instant | _filter
echo
# real QA test starts here
pmie -t 250msec -c $tmp.pmie >$tmp.out 2>&1 &
pid_pmie=$!
# sleep_stop time to sleep before stopping pmcd
# sleep_start time to sleep before starting pmcd
sleep_start=4
sleep_stop=5
# and again with the same instances
#
sleep $sleep_stop
$sudo $PCP_RC_DIR/pcp stop | _filter_pcp_stop
sleep $sleep_start
$sudo $PCP_RC_DIR/pcp start | _filter_pcp_start
_wait_for_pmcd
pminfo -f sample.dynamic.instant |_filter
echo
# instances - mk II
#
sleep $sleep_stop
$sudo $PCP_RC_DIR/pcp stop | _filter_pcp_stop
cat >$tmp.indom <<End-of-File
20 twenty
25 twenty-five
30 thirty
40 forty
49 forty-nine
50 fifty
58 fifty-eight
106 one-hundred-and-six
End-of-File
$sudo cp $tmp.indom $control
sleep $sleep_start
$sudo $PCP_RC_DIR/pcp start | _filter_pcp_start
_wait_for_pmcd
pminfo -f sample.dynamic.instant |_filter
echo
# instances - mk III
#
sleep $sleep_stop
$sudo $PCP_RC_DIR/pcp stop | _filter_pcp_stop
cat >$tmp.indom <<End-of-File
07 seven
08 eight
10 ten
20 twenty
30 thirty-*
100 one-hundred
End-of-File
$sudo cp $tmp.indom $control
sleep $sleep_start
$sudo $PCP_RC_DIR/pcp start | _filter_pcp_start
_wait_for_pmcd
pminfo -f sample.dynamic.instant |_filter
echo
# instances - mk IV
#
sleep $sleep_stop
$sudo $PCP_RC_DIR/pcp stop | _filter_pcp_stop
cat >$tmp.indom <<End-of-File
End-of-File
$sudo cp $tmp.indom $control
sleep $sleep_start
$sudo $PCP_RC_DIR/pcp start | _filter_pcp_start
_wait_for_pmcd
pminfo -f sample.dynamic.instant |_filter
echo
sleep $sleep_stop
$signal -s TERM $pid_pmie
wait
cp $tmp.out $seq.full
echo
echo "Expect only connection lost/re-established and DYN_* lines ..."
echo
# in addition to the regular filtering, some versions of Linux return
# ECONNRESET on the write() when pmcd is signald, rather than waiting
# to return the error on the following read() ... as far as this test
# is concerned, these are synonyms
#
_filter_pmie_log <$tmp.out \
| sed \
-e "/ Error: /s/$HOST/HOST/g" \
-e "/ Error: /s/local:/HOST/g" \
-e "/ Error: /s/localhost/HOST/g" \
-e "/ Info: /s/$HOST/HOST/g" \
-e "/ Info: /s/localhost/HOST/g" \
-e "/ Info: /s/local:/HOST/g" \
-e 's/failed: Connection reset by peer/failed: IPC protocol failure/' \
-e '/^DATE: *$/d' \
-e '/^FILESYS \/dev\//d' \
-e '/^FILESYS \/dev$/d' \
-e '/^FILESYS none$/d' \
-e '/^FILESYS devfs$/d' \
-e '/^FILESYS map -hosts$/d' \
-e '/^FILESYS map auto_home$/d' \
-e '/^MIRAGE m-[0-9][0-9]*$/d' \
-e '/^DISK dks[0-9][0-9]*d[0-9][0-9]*/d' \
-e '/^DISK [a-f0-9][a-f0-9]*\/lun[0-9][0-9]*\/c[0-9][0-9]*p[0-9][0-9]*/d' \
-e '/^DISK hd[a-z]/d' \
-e '/^DISK sd[a-z0-9]/d' \
-e '/^DISK dasd[a-z]/d' \
-e '/^DISK cmdk[0-9]/d' \
-e '/^DISK rd\//d' \
-e '/^DISK scsi\/host/d' \
-e '/^DISK vd[a-z]/d' \
-e '/^DISK xscsi\/pci/d' \
-e '/^DISK xvm\//d' \
-e '/^DISK disk[0-9][0-9]*$/d' \
-e '/^CPU cpu[0-9][0-9]*$/d' \
-e '/^CPU cpu:[0-9][0-9]*\.[0-9][0-9]*\.[ab]$/d' \
-e '/^CPU cpu:[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[a-d]$/d' \
-e '/^NETWORK dummy[0-9]/d' \
-e '/^NETWORK br[0-9][0-9]*$/d' \
-e '/^NETWORK e[cfmnt][0-9][0-9]*$/d' \
-e '/^NETWORK ens[0-9]*$/d' \
-e '/^NETWORK enp[0-9][0-9]*s[0-9][0-9]*f[0-9][0-9]*$/d' \
-e '/^NETWORK enp[0-9][0-9]*s[0-9][0-9]*f[0-9][0-9]*u[0-9][0-9]*$/d' \
-e '/^NETWORK eth[0-9]/d' \
-e '/^NETWORK fw[0-9][0-9]*$/d' \
-e '/^NETWORK gif[0-9][0-9]*$/d' \
-e '/^NETWORK lo[0-9][0-9]*$/d' \
-e '/^NETWORK lo$/d' \
-e '/^NETWORK p[0-9][0-9]*p[0-9][0-9]*$/d' \
-e '/^NETWORK pan[0-9][0-9]*$/d' \
-e '/^NETWORK ppp[0-9][0-9]*$/d' \
-e '/^NETWORK sit[0-9]/d' \
-e '/^NETWORK sl[0-9][0-9]*$/d' \
-e '/^NETWORK stf[0-9][0-9]*$/d' \
-e '/^NETWORK tun[0-9][0-9]*$/d' \
-e '/^NETWORK vde[0-9][0-9]*$/d' \
-e '/^NETWORK vnet[0-9][0-9]*$/d' \
-e '/^NETWORK virbr[0-9][0-9]*$/d' \
-e '/^NETWORK virbr[0-9][0-9]*-nic$/d' \
-e '/^NETWORK wlan[0-9][0-9]*$/d' \
-e '/^NETWORK wwan[0-9][0-9]*$/d' \
-e '/^NETWORK wmaster[0-9][0-9]*$/d' \
-e '/^NETWORK xp[0-9][0-9]*$/d' \
| $PCP_AWK_PROG '
BEGIN { last["DYN_DISCRETE"] = last["DYN_INSTANT"] = "" }
$2 ~ /DYN_/ { if (last[$2] != $0) {
print $0
last[$2] = $0
}
next
}
{ print }
/Lost connection/ { last["DYN_DISCRETE"] = last["DYN_INSTANT"] = "" }'
# success, all done
status=0
exit
|