pmrep: fix archive end time reporting
[pcp.git] / qa / 758
blobc2415b7f7ea40ac57a67050c8f010c8503fda141
1 #!/bin/sh
2 # PCP QA Test No. 758
3 # Exercise a couple of perl PMDA module bugs/features.
5 # Copyright (c) 2014-2015 Red Hat.
8 seq=`basename $0`
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
12 . ./common.product
13 . ./common.filter
14 . ./common.check
16 perl -e "use PCP::PMDA" >/dev/null 2>&1
17 [ $? -eq 0 ] || _notrun "perl PCP::PMDA module not installed"
19 _cleanup()
21 if pmprobe -I pmcd.agent.status | grep '"test_perl"' >/dev/null
22 then
23 cd $here/pmdas/test_perl
24 $sudo ./Remove >>$here/$seq.full 2>&1
25 $sudo rm -f domain.h.perl
26 cd $here
30 status=1 # failure is the default!
31 $sudo rm -rf $tmp.* $seq.full
32 trap "cd $here; rm -rf $tmp.*; _cleanup; exit \$status" 0 1 2 3 15
34 # real QA test starts here
35 cd pmdas/test_perl
36 $sudo ./Install </dev/null \
37 | _filter_pmda_install \
38 | sed -e '/^Waiting for pmcd/s/\.\.\.[. ]*$/DOTS/' \
39 | $PCP_AWK_PROG '
40 /Check test_perl metrics have appeared/ { if ($10 >= 0 && $10 <= 5) $10 = "N" }
41 { print }'
42 cd $here
44 # start from a known place
45 pmstore test_perl.some_value 0 \
46 | sed -e 's/old value=./old value=N/g'
48 # need a few invocations to tickle the bug
49 for i in 1 2 3 4 5; do
50 echo "=== Round $i ===" | tee -a $here/$seq.full
51 pmprobe \
52 test_perl.other_indom.some_value \
53 test_perl.some_value \
54 test_perl.some_indom.some_value
55 done
57 # success, all done
58 status=0
59 exit