/var/lib/pcp/testsuite/019 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 | #! /bin/sh
# PCP QA Test No. 019
# Exercse optional PMDA availability for PM_CONTEXT_LOCAL
#
# Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
#
seq=`basename $0`
rm -f $seq.out
# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check
if [ $PCP_PLATFORM = linux ]
then
# proc metrics may not be available
#
if pminfo proc.nprocs >/dev/null 2>&1
then
# available, but if not a DSO agent, then pminfo -L will
# know about the metric, but not find the PMDA
#
type=`pminfo -f pmcd.agent.type | sed -n -e '/"proc"/{
s/.*value //
p
}'`
case "$type"
in
0) # DSO
ln $seq.linux.2 $seq.out || exit 1
;;
2|4)# daemon
ln $seq.linux.4 $seq.out || exit 1
;;
*)
echo "Botch ... don't understand proc PMDA type ($type)"
pminfo -f pmcd.agent.type
exit 1
;;
esac
else
ln $seq.linux.3 $seq.out || exit 1
fi
elif [ $PCP_PLATFORM = darwin ]
then
ln $seq.darwin $seq.out || exit 1
elif [ $PCP_PLATFORM = solaris ]
then
ln $seq.solaris $seq.out || exit 1
else
echo "Error: no validated output for $PCP_PLATFORM"
exit 1
fi
echo "QA output created by $seq"
trap "$sudo rm -f $tmp.*; exit 0" 0 1 2 3 15
_filter()
{
sed -e '/using .* kmem interface/d' \
| _filter_pmcd_log
}
# real QA test starts here
# neither
unset PCP_LITE_SAMPLE
unset PMDA_LOCAL_SAMPLE
unset PMDA_LOCAL_PROC
echo "*** This should fail"
echo "PCP_LITE_SAMPLE=$PCP_LITE_SAMPLE PMDA_LOCAL_SAMPLE=$PMDA_LOCAL_SAMPLE"
pminfo -K clear -L -f 2>&1 \
sampledso.bin sampledso.long sampledso.longlong \
sampledso.float sampledso.double sampledso.string sampledso.aggregate \
| _filter
# PCP_LITE_SAMPLE set
echo
echo "*** This should work"
PCP_LITE_SAMPLE=yes
export PCP_LITE_SAMPLE
echo "PCP_LITE_SAMPLE=$PCP_LITE_SAMPLE PMDA_LOCAL_SAMPLE=$PMDA_LOCAL_SAMPLE"
$sudo_local_ctx pminfo -L -f 2>&1 \
sampledso.bin sampledso.long sampledso.longlong \
sampledso.float sampledso.double sampledso.string sampledso.aggregate \
| _filter
unset PCP_LITE_SAMPLE
# PMDA_LOCAL_SAMPLE set
echo
echo "*** This should work"
PMDA_LOCAL_SAMPLE=yes
export PMDA_LOCAL_SAMPLE
echo "PCP_LITE_SAMPLE=$PCP_LITE_SAMPLE PMDA_LOCAL_SAMPLE=$PMDA_LOCAL_SAMPLE"
$sudo_local_ctx pminfo -L -f 2>&1 \
sampledso.bin sampledso.long sampledso.longlong \
sampledso.float sampledso.double sampledso.string sampledso.aggregate \
| _filter
unset PMDA_LOCAL_SAMPLE
# both set
echo
echo "*** This should work"
PMDA_LOCAL_SAMPLE=yes
PCP_LITE_SAMPLE=yes
export PMDA_LOCAL_SAMPLE PCP_LITE_SAMPLE
echo "PCP_LITE_SAMPLE=$PCP_LITE_SAMPLE PMDA_LOCAL_SAMPLE=$PMDA_LOCAL_SAMPLE"
$sudo_local_ctx pminfo -L -f 2>&1 \
sampledso.bin sampledso.long sampledso.longlong \
sampledso.float sampledso.double sampledso.string sampledso.aggregate \
| _filter
unset PMDA_LOCAL_SAMPLE PCP_LITE_SAMPLE
# neither set
echo
echo "*** This should 1/3 work, proc[no] irix[yes] sampledso[n]"
echo "PCP_LITE_SAMPLE=$PCP_LITE_SAMPLE PMDA_LOCAL_SAMPLE=$PMDA_LOCAL_SAMPLE"
$sudo_local_ctx pminfo -K clear -L -f 2>&1 \
proc.nprocs kernel.all.cpu.idle kernel.all.load sampledso.float \
| _filter \
| sed -e '/value /{
s/value -*[0-9][0-9]*\.[0-9][0-9]*/value NUMBER/g
s/value -*[0-9][0-9]*/value NUMBER/g
}'
# PMDA_LOCAL_SAMPLE set
echo
echo "*** This should 2/3 work, proc[no] irix[yes] sampledso[yes]"
PMDA_LOCAL_SAMPLE=yes
echo "PMDA_LOCAL_SAMPLE=$PMDA_LOCAL_SAMPLE"
export PMDA_LOCAL_SAMPLE
$sudo_local_ctx pminfo -L -f 2>&1 \
proc.nprocs kernel.all.cpu.idle kernel.all.load sampledso.float \
| _filter \
| sed -e '/value /{
s/value -*[0-9][0-9]*\.[0-9][0-9]*/value NUMBER/g
s/value -*[0-9][0-9]*/value NUMBER/g
}'
unset PMDA_LOCAL_SAMPLE
# PMDA_LOCAL_SAMPLE and PMDA_LOCAL_PROC set
echo
echo "*** This should work, proc[yes] irix[yes] sampledso[yes]"
PMDA_LOCAL_SAMPLE=yes
PMDA_LOCAL_PROC=yes
echo "PMDA_LOCAL_SAMPLE=$PMDA_LOCAL_SAMPLE PMDA_LOCAL_PROC=$PMDA_LOCAL_PROC"
export PMDA_LOCAL_SAMPLE PMDA_LOCAL_PROC
$sudo_local_ctx pminfo -L -f 2>&1 \
proc.nprocs kernel.all.cpu.idle kernel.all.load sampledso.float \
| _filter \
| sed -e '/value /{
s/value -*[0-9][0-9]*\.[0-9][0-9]*/value NUMBER/g
s/value -*[0-9][0-9]*/value NUMBER/g
}'
unset PMDA_LOCAL_SAMPLE PMDA_LOCAL_PROC
|