/var/lib/pcp/testsuite/968 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 | #!/bin/sh
# PCP QA Test No. 968
# Exercise several corner cases in the Python PMAPI wrappers.
#
# Copyright (c) 2015,2017 Red Hat.
#
seq=`basename $0`
echo "QA output created by $seq"
. ./common.python
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
# real QA test starts here
echo "== options error message" | tee -a $seq.full
cat > $tmp.opts <<EOF
from pcp import pmapi
import sys
opts = pmapi.pmOptions()
nops = opts.pmGetOperands()
nops = opts.pmGetNonOptionsFromList(sys.argv)
ctx = pmapi.pmContext.fromOptions(opts, sys.argv)
EOF
cat $tmp.opts >> $seq.full
$python $tmp.opts 2>&1 | tee -a $seq.full | grep Error
echo "== check setmode" | tee -a $seq.full
cat > $tmp.mode <<EOF
from pcp import pmapi
import cpmapi as api
import sys
ctx = pmapi.pmContext(api.PM_CONTEXT_ARCHIVE, '$here/archives/src-rattle')
try:
ctx.pmSetMode(api.PM_MODE_INTERP, None, 0) # no exception
except pmapi.pmErr as error:
sys.stderr.write("Unexpected pmSetMode error: ", error)
EOF
cat $tmp.mode >> $seq.full
$python $tmp.mode 2>&1 | tee -a $seq.full
echo "== check import" | tee -a $seq.full
cat > $tmp.pmi <<EOF
from pcp import pmi
import cpmapi as api
log = pmi.pmiLogImport('$tmp.log', 0)
log.pmiAddMetric("hinv.ncpu", api.PM_ID_NULL,
api.PM_TYPE_U32, api.PM_INDOM_NULL,
api.PM_SEM_DISCRETE, log.pmiUnits(0, 0, 0, 0, 0, 0))
log.pmiPutValue("hinv.ncpu", None, "42")
EOF
cat $tmp.pmi >> $seq.full
$python $tmp.pmi 2>&1 | tee -a $seq.full
echo "== check derive" | tee -a $seq.full
cat > $tmp.derive <<EOF
from pcp import pmapi
import sys
ctx = pmapi.pmContext()
try:
ctx.pmRegisterDerived("fuu", "rat(disk.dev.read)")
except pmapi.pmErr as error:
print(error.message())
EOF
cat $tmp.derive >> $seq.full
$python $tmp.derive 2>&1 | tee -a $seq.full
# success, all done
echo "== done"
status=0
exit
|