3 # Basic checkout of the Python pmdasimple implementation.
5 # Copyright (c) 2013 Red Hat.
9 echo "QA output created by $seq"
13 [ -d $PCP_PMDAS_DIR/simple
] || _notrun
"simple PMDA directory is not installed"
14 $python -c "from pcp import pmda" >/dev
/null
2>&1
15 [ $?
-eq 0 ] || _notrun
"python pcp pmda module not installed"
16 test -f "$PCP_PMDAS_DIR/simple/pmdasimple.python"
17 [ $?
-eq 0 ] || _notrun
"python simple pmda not yet installed"
29 _restore_config
$PCP_PMCDCONF_PATH
31 $sudo $PCP_RC_DIR/pcp restart | _filter_pcp_start
39 trap "_cleanup" 0 1 2 3 15
41 # real QA test starts here
43 cd $PCP_PMDAS_DIR/$iam
45 # copy the pmcd config file to restore state later.
46 _save_config
$PCP_PMCDCONF_PATH
48 # start from a known starting point
49 $sudo .
/Remove
>/dev
/null
2>&1
52 echo "=== $iam agent installation ==="
53 cat << End-of-File | $sudo ./Install >$tmp.out 2>&1
57 # Check simple metrics have appeared ... X metrics and Y values
58 _filter_pmda_install
<$tmp.out \
60 -e '/^Waiting for pmcd/s/\.\.\.[. ]*$/DOTS/'
67 echo "fetch pmprobe #$iter - $name" |
tee -a $here/$seq.full
68 pmprobe
-v $iam > $tmp.pmprobe
69 cat $tmp.pmprobe
>>$here/$seq.full
71 echo "check pmprobe #$iter - $name" |
tee -a $here/$seq.full
73 |
while read metric nv v1
75 if [ "$metric" = "simple.numfetch" ]
77 echo "$metric shows $nv value(s), $v1 fetches so far"
79 echo "$metric shows $nv value(s)"
85 echo "=== fetch and check values ==="
86 echo sec
,min
,hour
> $tmp.conf
&& $sudo mv $tmp.conf simple.conf
88 echo sec
,min
> $tmp.conf
&& $sudo mv $tmp.conf simple.conf
90 echo hour
> $tmp.conf
&& $sudo mv $tmp.conf simple.conf
92 echo > $tmp.conf
&& $sudo mv $tmp.conf simple.conf
95 # reset the clock back to the start state
96 echo sec
,min
,hour
> $tmp.conf
&& $sudo mv $tmp.conf simple.conf
98 echo "=== remove $iam agent ==="
99 $sudo .
/Remove
>$tmp.out
2>&1
100 _filter_pmda_remove
<$tmp.out