/var/lib/pcp/testsuite/806 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 | #!/bin/sh
# PCP QA Test No. 806
# Check out clients for metrics with negative values.
#
# Copyright (c) 2016 Ken McDonell. All Rights Reserved.
#
seq=`basename $0`
echo "QA output created by $seq"
# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check
status=1 # failure is the default!
$sudo rm -rf $tmp $tmp.* $seq.full
trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
# sample.negative.ctr.m_32 old value=-9999 new value=-1000
_filter_store()
{
sed \
-e 's/old value=[^ ]* /old value=OLD /' \
# end
}
# e1: 1.00
_filter_pmie()
{
if [ "$1" = "ctr" ]
then
$PCP_AWK_PROG '
$1 == "e1:" && $2 != "?" {
if ( $2 < 0.90 || $2 > 1.10)
$2 = $2 " (bad)"
else
$2 = "OK"
}
{ print }'
else
cat
fi
}
# 0.998
_filter_pmval()
{
if [ "$1" = "ctr" ]
then
$PCP_AWK_PROG '
$1 == "host:" { next }
NF == 1 { if ( $1 < 0.90 || $1 > 1.10)
$1 = $1 " (bad)"
else
$1 = "OK"
}
{ print }'
else
sed -e '/^host:/d'
fi
}
_filter_dbpmda()
{
sed \
-e '/pmResult/s/ .* numpmid/ ... numpmid/' \
-e "s;$PCP_PMDAS_DIR;\$PCP_PMDAS_DIR;" \
-e "s/\.$DSO_SUFFIX/.DSO_SUFFIX/g" \
# end
}
# real QA test starts here
for m in m_32 m_64 m_float m_double
do
for sem in ctr instant discrete
do
if [ "$sem" = ctr ]
then
# for counters need longer sample interval to ensure rate
# conversion is close to correct.
#
delta="1sec"
end="2.5sec"
else
delta="100msec"
end="250msec"
fi
echo "=== $sem.$m ==="
pmstore sample.negative.$sem.$m -1000 | _filter_store
pminfo -f sample.negative.$sem.$m
pmprobe -v sample.negative.$sem.$m
echo "e1 = sample.negative.$sem.$m;" \
| pmie -t $delta -T $end -v 2>/dev/null \
| _filter_pmie $sem
pmval -t $delta -s 2 sample.negative.$sem.$m \
| _filter_pmval $sem
cat <<End-of-File | dbpmda -ei 2>&1 | _filter_dbpmda
open dso $PCP_PMDAS_DIR/sample/pmda_sample.$DSO_SUFFIX sample_init 30
getdesc on
fetch sampledso.negative.$sem.$m
End-of-File
done
done
# success, all done
status=0
exit
|