/var/lib/pcp/testsuite/294 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 | #! /bin/sh
# PCP QA Test No. 294
# Basic pmproxy functionality
#
# Copyright (c) 2005 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
which pmdumptext >/dev/null 2>&1 || _notrun "No installed pmdumptext binary"
rm -f $seq.out
if [ $PCP_PLATFORM = darwin -o $PCP_PLATFORM = solaris ]
then
if [ $PCP_VER -ge 3806 ]
then
ln $seq.out.4 $seq.out
else
ln $seq.out.3 $seq.out
fi
else
if [ $PCP_VER -ge 3806 ]
then
ln $seq.out.2 $seq.out
else
ln $seq.out.1 $seq.out
fi
fi
#debug# tmp=`pwd`/tmp
signal=$PCP_BINADM_DIR/pmsignal
status=0 # success is the default!
username=`id -u -n`
$sudo rm -rf $tmp.*
trap "_cleanup; rm -f $tmp.*; exit \$status" 0 1 2 3 15
_cleanup()
{
$sudo $signal -a pmproxy >/dev/null 2>&1
$sudo $PCP_RC_DIR/pmproxy restart >/dev/null 2>&1
}
_filter()
{
sed \
-e '/hinv/s/ [0-9][0-9]*$/ N/' \
-e '/^[A-Z][a-z][a-z] [A-Z][a-z][a-z] *[0-9][0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9]/{
# pmdumptext
s//DATE/
s/ [0-9][0-9.]*/ N/g
}' \
-e '/^\[[A-Z][a-z][a-z] [A-Z][a-z][a-z] *[0-9][0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9]]/{
# pmie trailer
s//[DATE]/
s/([0-9][0-9]*)/(PID)/
}' \
-e '/expr_1/s/ *[0-9][0-9.]*/ N/g' \
-e '/^@ [A-Z][a-z][a-z] [A-Z][a-z][a-z] *[0-9][0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9] [0-9][[0-9][0-9][0-9]/{
# pmstat header1
s//@ DATE/
}' \
-e '/^ 1 min swpd free buff cache pi po bi bo in cs us sy id/{
# pmstat header3
s// 1 min swpd free buff cache si so bi bo in cs us sy id/
}' \
-e '/[0-9.]*[0-9Km] *[0-9.]*[0-9Km] *[0-9.]*[0-9Km] *[0-9.]*[0-9Km] *[0-9.]*[0-9Km]/{
# pmstat data
s/ *[0-9.]*[0-9Km]/ N/g
}' \
| _filter_me
}
_filter_me()
{
sed \
-e "s/`hostname`/MY_HOSTNAME/g" \
-e "s/`hostname | sed -e 's/\..*//'`/MY_HOSTNAME/" \
-e "s/local:/MY_HOSTNAME/" \
-e "s/localhost\.localdomain/MY_HOSTNAME/" \
-e "s/localhost/MY_HOSTNAME/" \
-e "s#$PCP_VAR_DIR#PCP_VAR_DIR#g" \
-e "s#$PCP_SYSCONF_DIR/pmlogger/config.pmstat#TMP.logger.config#g" \
-e "s,$tmp.config,TMP.logger.config,g" \
-e "s#$tmp#TMP#g"
}
_filter_pmproxy()
{
sed \
-e '/^__pmSetSocketIPC: fd=/d' \
-e '/^__pmSetDataIPC:/d' \
-e '/^__pmDataIPC: /d' \
-e '/^IPC table fd/d' \
}
_do()
{
echo
echo "+++ $* +++" | tee -a $seq.full | _filter_me
if which $1 >/dev/null 2>&1
then
eval $* 2>&1 | tee -a $seq.full | _filter
echo "`grep AcceptNewClient $tmp.log | wc -l | sed -e 's/ *//g'` connects"
echo "`grep DeleteClient $tmp.log | wc -l | sed -e 's/ *//g'` disconnects"
else
echo "Skipped, no $1 binary installed"
fi
}
_do_config()
{
cat >$tmp.config <<End-of-File
log advisory on default {
kernel.all.load
swap.used
mem.util.free
mem.util.bufmem
mem.bufmem
mem.util.cached
swap.in
swap.pagesin
swap.out
swap.pagesout
disk.all.blkread
disk.all.blkwrite
kernel.all.intr
kernel.all.intr.non_vme
kernel.all.pswitch
kernel.all.cpu
}
End-of-File
}
$sudo $PCP_RC_DIR/pmproxy stop >/dev/null 2>&1
$sudo $signal -a pmproxy >/dev/null 2>&1
proxyargs="-Dcontext"
id pcp >/dev/null 2>&1 && proxyargs="$proxyargs -U $username"
$PCP_BINADM_DIR/pmproxy $proxyargs -l $tmp.log 2>&1 | _filter_pmproxy
PMPROXY_HOST=localhost
export PMPROXY_HOST
rm -f $seq.full
# real QA test starts here
_do pminfo -h $PMPROXY_HOST -d pmcd.agent
_do pminfo -h $PMPROXY_HOST -f sample.hordes
_do pmprobe -v -h localhost hinv.ncpu
_do pmval -h `hostname` -t 0.5 -s 3 sample.bin
echo "kernel.all.load;" >$tmp.in
_do pmie -h $PMPROXY_HOST -c $tmp.in -v -t 0.5 -T 1.5
echo "kernel.all.cpu.user :localhost;" >$tmp.in
_do pmie -h $PMPROXY_HOST -c $tmp.in -v -t 0.5 -T 1.5
_do pmdumptext -h `hostname` -t 0.5 -s 2 sample.string.hullo
_do pmdumptext -t 0.5 -s 2 localhost:sample.string.hullo
_do pmdumptext -t 0.5 -s 2 `hostname`:kernel.all.load
if [ $PCP_PLATFORM = darwin -o $PCP_PLATFORM = solaris ]
then
: not much to do, as metrics for pmstat are largely missing
: on Mac OS X and OpenSolaris
else
_do pmstat -h $PMPROXY_HOST -t 0.5 -s 2
_do_config
_do pmlogger -h localhost -c $tmp.config -t 0.5sec -s 3 -l $tmp.logger.log $tmp.arch
_do pmstat -S +0.25sec -t 0.5sec -a $tmp.arch
fi
# success, all done
exit
|