3 # Exercise the perfevent PMDA.
5 # Copyright (c) 2014 Joseph White.
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
16 test -e $PCP_PMDAS_DIR/perfevent
/pmdaperfevent || _notrun
"Optional perfevent PMDA not present"
18 status
=1 # failure is the default!
19 $sudo rm -rf $tmp.
* $seq.full
24 echo "=== remove perfevent agent ==="
25 sudo .
/Remove
>$tmp.out
2>&1
26 _filter_pmda_remove
<$tmp.out
31 # start from known starting points
32 cd $PCP_PMDAS_DIR/perfevent
33 $sudo .
/Remove
>/dev
/null
2>&1
34 $sudo $PCP_RC_DIR/pmcd stop | _filter_pcp_stop
36 [ -f $PCP_PMDAS_DIR/perfevent
/perfevent.conf
] && \
37 $sudo cp $PCP_PMDAS_DIR/perfevent
/perfevent.conf
$tmp.backup
38 $sudo cp $here/perfevent
/perfevent.conf
$PCP_PMDAS_DIR/perfevent
41 echo "=== $iam agent installation ==="
42 $sudo .
/Install
</dev
/null
>$tmp.out
2>&1
43 # Check for warnings, we're going to considering these warnings
44 # indications that there is not perfevents on the current machine
45 grep "warnings" $tmp.out
; if [ $?
-eq 0 ]; then _notrun
"perfevents not found"; fi
46 # Check perfevent metrics have appeared ... X metrics and Y values
47 _filter_pmda_install
<$tmp.out \
49 -e '/^Waiting for pmcd/s/\.\.\.[. ]*$/DOTS/' \
51 /Check perfevent metrics have appeared/ {
53 if ($10 >= 8) $10 = "Y"
60 if [ -f $tmp.backup
]; then
61 $sudo cp $tmp.backup
$PCP_PMDAS_DIR/perfevent
/perfevent.conf
64 $sudo rm -f $PCP_PMDAS_DIR/perfevent
/perfevent.conf
66 _cleanup_pmda perfevent
69 _prepare_pmda perfevent
70 trap "perfevent_cleanup; exit \$status" 0 1 2 3 15
74 # filter metric values for deterministic output
75 tee -a $here/$seq.full |
sed \
76 -e 's/value [0-9][0-9]*/value NUMBER/'
79 # real QA test starts here
82 # pmdaperfevent should have been started by the Install process - check
83 if pminfo
-v perfevent
> $tmp.info
2> $tmp.err
87 echo "... failed! ... here is the Install log ..."
90 cat $tmp.info
$tmp.err | _filter_perfevent
92 # Check that the correct metrics are present