/var/lib/pcp/testsuite/061 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 | #!/bin/sh
# PCP QA Test No. 061
# exercise the logging state compatibility matrix
#
# Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
#
seq=`basename $0`
echo "QA output created by $seq"
# get standard filters
. ./common.product
. ./common.filter
. ./common.check
rm -f $seq.out
if [ $PCP_VER -lt 3604 ]
then
ln $seq.out.1 $seq.out || exit 1
else
ln $seq.out.2 $seq.out || exit 1
fi
trap "$sudo rm -f $tmp.*; exit" 0 1 2 3 15
signal=$PCP_BINADM_DIR/pmsignal
# this line changed from msec to usec in 3.5.9
# state: not in log, unavail, mand, on delta: 0 usec numpmid: 1
#
_filter_pmlogger()
{
_filter_pmlogger_log \
| sed \
-e '/[Ss]ignalled (signal=.*), exiting/d' \
-e '/Warning: AF event queue is empty, nothing /d' \
-e "/Warning /s/[0-9]*-[0-9]*\.config/SEQ-MYPID.config/" \
-e 's/0x00000000/NULL/g' \
-e 's/0x[0-9a-f]*/ADDR/g' \
-e 's/(nil)/ADDR/g' \
-e 's/value [0-9]*/value INT/g' \
-e 's/[0-2][0-9]:00:00.000/TIME/' \
-e '/__pmLogPutResult/{
s/len=[0-9]*/len=NNN/
s/posn=[0-9]*/posn=NNN/
}' \
-e '/__pmLogPutIndex/{
s/stamp=[0-9][0-9]*\.[0-9][0-9]*/stamp=NNN.NNNNNN/
s/posn=[0-9]*/posn=NNN/g
}' \
-e 's/msec numpmid/usec numpmid/'
}
_filter_dumplog()
{
sed \
-e '/pmResult/s/ .* numpmid/ ... numpmid/' \
-e '/inst /{
s/inst \[[0-9][0-9]* or "dks..."]/inst [DISK]/
s;inst \[[0-9][0-9]* or "/dev/[^"]*"];inst [DISK];
s;inst \[[0-9][0-9]* or ".*/dbs/.*\.dbf"];inst [FILE];
}' \
-e '/value /{
s/value [0-9][0-9]*\.[0-9][0-9]*e.[0-9][0-9]*/value NUMBER/
s/value [0-9][0-9]*\.[0-9][0-9]*/value NUMBER/
s/value [0-9][0-9]*e.[0-9][0-9]*/value NUMBER/
s/value [0-9][0-9]*/value NUMBER/
s/value \[.*]/value AGGREGATE/
s/value ".*"/value STRING/
}' \
-e '/[0-9][0-9]:[0-9][0-9]:[0-9][0-9]/s/[^ ]*/TIMESTAMP/' \
-e "/pmcd\.pmlogger\./s/$logger_pid/LOGGER_PID/g" \
-e '/pmcd\.pmlogger\.port/s/value .*/value PORT/' \
-e '/pmcd\.pmlogger\.host/s/value ".*/value "HOST"/' \
-e '/pmcd\.pmlogger\.archive/s/value ".*/value "PATH"/' \
-e "/\"$logger_pid\"/s/$logger_pid/LOGGER_PID/g" \
| $PCP_AWK_PROG '
$1 == "TIMESTAMP" && NF == 4 { print "TIMESTAMP 0 OFFSET OFFSET"; next }
{ print }'
}
# real QA test starts here
TZ=GMT
export TZ
for ctl in mandatory advisory
do
for state in "on once" maybe off
do
[ "$ctl $state" = "advisory maybe" ] && continue
for req_ctl in mandatory advisory
do
for req_state in "on once" maybe off
do
[ "$req_ctl $req_state" = "advisory maybe" ] && continue
echo ""
echo "$ctl $state -> $req_ctl $req_state"
cat >$tmp.config <<End-of-File
log $ctl $state {
sample.colour [ "blue" ]
}
log $req_ctl $req_state {
sample.colour [ "blue" ]
}
End-of-File
$sudo rm -f $tmp.0 $tmp.meta $tmp.index
_start_up_pmlogger -L -D 640 -c $tmp.config -l $tmp.out $tmp >$tmp.err 2>&1
logger_pid=$pid
_wait_for_pmlogger $logger_pid $tmp.out
src/logcontrol -p $logger_pid enquire sample.colour
$sudo $signal -s TERM $logger_pid
_wait_pmlogger_end $logger_pid
cat $tmp.err $tmp.out | _filter_pmlogger
if [ -s $tmp.0 ]
then
pmdumplog $tmp | _filter_dumplog
else
echo "Archive log is empty"
fi
done
done
done
done
exit
|