/var/lib/pcp/testsuite/800 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 | #!/bin/sh
# PCP QA Test No. 800
# Excercise the hotproc additions to the linux_proc pmda
#
# Copyright (c) 2014 Martins Innus. All Rights Reserved.
#
seq=`basename $0`
echo "QA output created by $seq"
# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check
[ -d $PCP_PMDAS_DIR/proc ] || _notrun "Proc PMDA not installed"
_cleanup()
{
cd $here
[ -f $tmp.backup ] && $sudo mv $tmp.backup $PCP_PMDAS_DIR/proc/hotproc.conf
rm -rf $tmp.*
$sudo rm -f proc.log
}
status=1 # failure is the default!
$sudo rm -rf $tmp.* $seq.full
trap "_cleanup; exit \$status" 0 1 2 3 15
_filter()
{
sed \
-e "s,$PCP_PMDAS_DIR,PCP_PMDAS_DIR,g" \
-e 's/value [1-9][0-9]*/value NUMBER/' \
-e 's/0x[0-9a-f]*/ADDR/g' \
-e 's/[0-2][0-9]:00:00.000/TIME/' \
-e 's/3.[0-9][0-9]*.[0-9][0-9]*/3.NUMBER.NUMBER/'
}
# vars and checks
pipepmda=$PCP_PMDAS_DIR/proc/pmdaproc
[ ! -f $pipepmda ] && echo "FATAL ERROR Could not find \"$pipepmda\"" && exit 1
# temporarily move aside any existing hotproc.conf (for qa determinism)
[ -f $PCP_PMDAS_DIR/proc/hotproc.conf ] && \
$sudo mv $PCP_PMDAS_DIR/proc/hotproc.conf $tmp.backup
# real QA test starts here
# By default, hotproc should be disabled
echo "=== Hotproc disabled by default test ==="
$sudo TERM=ansi dbpmda -ie <<EOF 2>&1 | _filter
open pipe $pipepmda -d 3
getdesc on
fetch hotproc.control.config_gen
fetch hotproc.control.config
EOF
# After this, hotproc still disabled (and pmdaproc running)
echo "=== Check that hotproc can have interval set early==="
$sudo TERM=ansi dbpmda -ie <<EOF 2>&1 | _filter
open pipe $pipepmda -d 3
getdesc on
attr "username" "root"
attr 11 "0"
store hotproc.control.refresh "1"
wait 3
fetch hotproc.nprocs
EOF
echo "=== Check that hotproc can be configured with UID==="
$sudo TERM=ansi dbpmda -ie <<EOF 2>&1 | _filter
open pipe $pipepmda -d 3
getdesc on
attr "username" "root"
attr 11 "0"
store hotproc.control.config "uid==0"
store hotproc.control.refresh "1"
fetch hotproc.control.config
wait 3
fetch hotproc.nprocs
EOF
echo "=== Check that hotproc can be configured with process name==="
$sudo TERM=ansi dbpmda -ie <<EOF 2>&1 | _filter
open pipe $pipepmda -d 3
getdesc on
attr "username" "root"
attr 11 "0"
store hotproc.control.config 'fname=="pmdaproc"'
store hotproc.control.refresh "1"
wait 3
fetch hotproc.nprocs
EOF
status=0
exit
|