/var/lib/pcp/testsuite/232 is in pcp-testsuite 4.0.1-1.
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 | #! /bin/sh
# PCP QA Test No. 232
# exercise instance API functions for PM_CONTEXT_LOCAL
#
# 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
# see src/pmdas/linux/pmda.c and the initializations of ...
#
# nfs_indom_id - 18 members
# nfs3_indom_id - 22 members
# nfs4_cli_indom_id - 56 members
# nfs4_svr_indom_id - 71 members (no "0" instance in this case)
#
# The indom is well-defined, but no values are available if the
# relevant parts of the NFS protocols are not enabled in the kernel.
#
_filter_dodgey_nfs_indom()
{
sed \
-e '/number of instances .* (0) != that for pmGetInDom (18)/d' \
-e '/number of instances .* (0) != that for pmGetInDom (22)/d' \
-e '/number of instances .* (0) != that for pmGetInDom (56)/d' \
-e '/number of instances .* (0) != that for pmGetInDom (71)/d'
}
status=0
trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
# real QA test starts here
PMDA_LOCAL_SAMPLE=yes
export PMDA_LOCAL_SAMPLE
cat <<End-of-File >$tmp.metrics
#InDom Name
60.00 hinv.map.cpu_num
60.00 kernel.percpu.cpu.idle
60.01 disk.dev.read
60.02 kernel.all.load
60.03 network.interface.in.bytes
# may fail due to removeable device like DVD or CD-ROM ... in instance
# domain, but not until probed in fetch method do we discover there are
# no filesys.* metrics for that instance
#fail ok 60.05 filesys.used
60.06 swapdev.length
60.07 nfs.client.reqs
60.07 nfs.server.reqs
60.08 nfs3.client.reqs
60.08 nfs3.server.reqs
60.10 disk.partitions.total
60.11 hinv.map.scsi
60.12 mem.slabinfo.objects.total
60.14 nfs4.client.reqs
60.15 nfs4.server.reqs
# don't use network.interface.inet_addr as this may fail because indom
# comes from /proc/net/dev but some of these are skipped in the fetch if
# we can't get the inet addr
60.17 network.interface.total.bytes
60.18 tmpfs.capacity
60.19 kernel.pernode.cpu.nice
# will fail because indom is hard-wired at 256 elements, but fetch may
# return a subset of these
#fail ok 60.23 network.icmpmsg.intype
60.24 hinv.map.dmname
30.01 sampledso.colour
30.02 sampledso.bucket
30.03 sampledso.mirage
30.04 sampledso.needprofile
30.05 sampledso.hordes.one
30.06 sampledso.dodgey.value
30.07 sampledso.dynamic.counter
30.08 sampledso.many.int
# the indom is re-evaluated for each pdu request ...
#fail ok 30.09 sampledso.scramble.bin
30.10 sampledso.event.records
# this will always end in tears ...
#fail ok 02.03 sampledso.secret.foo.bar.max.redirect
End-of-File
sed -e '/^#/d' <$tmp.metrics | while read indom metric
do
echo $metric:
if [ $PCP_PLATFORM = darwin ]
then
# some of the metrics just aren't there on Mac OS X
case $metric
in
swapdev.length|nfs.*|hinv.map.cpu_num|disk.partitions.total|hinv.map.scsi|mem.slabinfo.objects.total|nfs4.*|tmpfs.capacity|kernel.pernode.cpu.nice|hinv.map.dmname)
continue
;;
esac
elif [ $PCP_PLATFORM = solaris ]
then
# some of the metrics just aren't there on Solaris, or have
# equivalents with different names
case $metric
in
swapdev.length|nfs.*|nfs3.*|nfs4.*|hinv.map.cpu_num|disk.partitions.total|hinv.map.scsi|mem.slabinfo.objects.total|network.interface.total.*|tmpfs.capacity|kernel.pernode.cpu.nice|hinv.map.dmname)
continue
;;
filesys.used)
metric=zfs.used.total
;;
esac
elif [ $PCP_PLATFORM = freebsd ]
then
# some of the metrics just aren't there on FreeBSD
case $metric
in
hinv.map.cpu_num|hinv.map.dmname|disk.partitions.total|hinv.map.scsi|mem.slabinfo.objects.total|filesys.used|swapdev.length|nfs.*|nfs3.*|nfs4.*|tmpfs.capacity|kernel.pernode.cpu.nice)
continue
;;
esac
elif [ $PCP_PLATFORM = netbsd ]
then
# some of the metrics just aren't there on FreeBSD
case $metric
in
hinv.map.cpu_num|hinv.map.dmname|disk.partitions.total|hinv.map.scsi|mem.slabinfo.objects.total|swapdev.length|nfs.*|nfs3.*|nfs4.*|tmpfs.capacity|kernel.pernode.cpu.nice)
continue
;;
esac
elif [ $PCP_PLATFORM = openbsd ]
then
# some of the metrics just aren't there on OpenBSD
case $metric
in
hinv.map.cpu_num|hinv.map.dmname|disk.partitions.total|hinv.map.scsi|mem.slabinfo.objects.total|swapdev.length|nfs.*|nfs3.*|nfs4.*|tmpfs.capacity|kernel.pernode.cpu.nice)
continue
;;
esac
fi
if [ $PCP_PLATFORM = solaris -o $PCP_PLATFORM = freebsd -o $PCP_PLATFORM = netbsd -o $PCP_PLATFORM = openbsd -o $metric = "mem.slabinfo.objects.total" -o $metric = "tmpfs.capacity" ]
then
# need to be root to open /dev/kmem or access some Linux /proc files
$sudo $here/src/torture_indom $metric >$tmp.out 2>&1
status=$?
else
$here/src/torture_indom $metric >$tmp.out 2>&1
status=$?
fi
sed <$tmp.out \
-e '/using .* kmem interface/d' \
| _filter_pmcd_log \
| _filter_dodgey_nfs_indom
if [ $status != 0 ]
then
case "$metric"
in
nfs*reqs)
;;
*)
echo torture_indom failed for $metric
;;
esac
fi
done
# all done
exit
|