3 # Excercise the hotproc additions to the linux_proc pmda
5 # Copyright (c) 2014 Martins Innus. All Rights Reserved.
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
16 [ -d $PCP_PMDAS_DIR/proc
] || _notrun
"Proc PMDA not installed"
21 [ -f $tmp.backup
] && $sudo mv $tmp.backup
$PCP_PMDAS_DIR/proc
/hotproc.conf
25 status
=1 # failure is the default!
26 $sudo rm -rf $tmp.
* $seq.full
27 trap "_cleanup; exit \$status" 0 1 2 3 15
32 -e "s,$PCP_PMDAS_DIR,PCP_PMDAS_DIR,g" \
33 -e 's/value [1-9][0-9]*/value NUMBER/' \
34 -e 's/0x[0-9a-f]*/ADDR/g' \
35 -e 's/[0-2][0-9]:00:00.000/TIME/' \
36 -e 's/3.[0-9][0-9]*.[0-9][0-9]*/3.NUMBER.NUMBER/'
40 pipepmda
=$PCP_PMDAS_DIR/proc
/pmdaproc
41 [ ! -f $pipepmda ] && echo "FATAL ERROR Could not find \"$pipepmda\"" && exit 1
43 # temporarily move aside any existing hotproc.conf (for qa determinism)
44 [ -f $PCP_PMDAS_DIR/proc
/hotproc.conf
] && \
45 $sudo mv $PCP_PMDAS_DIR/proc
/hotproc.conf
$tmp.backup
47 # real QA test starts here
49 # By default, hotproc should be disabled
50 echo "=== Hotproc disabled by default test ==="
51 $sudo TERM
=ansi dbpmda
-ie <<EOF 2>&1 | _filter
52 open pipe $pipepmda -d 3
54 fetch hotproc.control.config_gen
55 fetch hotproc.control.config
58 # After this, hotproc still disabled (and pmdaproc running)
59 echo "=== Check that hotproc can have interval set early==="
60 $sudo TERM
=ansi dbpmda
-ie <<EOF 2>&1 | _filter
61 open pipe $pipepmda -d 3
63 attr "username" "root"
65 store hotproc.control.refresh "1"
70 echo "=== Check that hotproc can be configured with UID==="
71 $sudo TERM
=ansi dbpmda
-ie <<EOF 2>&1 | _filter
72 open pipe $pipepmda -d 3
74 attr "username" "root"
76 store hotproc.control.config "uid==0"
77 store hotproc.control.refresh "1"
78 fetch hotproc.control.config
83 echo "=== Check that hotproc can be configured with process name==="
84 $sudo TERM
=ansi dbpmda
-ie <<EOF 2>&1 | _filter
85 open pipe $pipepmda -d 3
87 attr "username" "root"
89 store hotproc.control.config 'fname=="pmdaproc"'
90 store hotproc.control.refresh "1"