pmrep: fix archive end time reporting
[pcp.git] / qa / 986
blobb3ea06104636ee5ac7e8d1965b7b0b319cd4e4bf
1 #!/bin/sh
2 # PCP QA Test No. 986
3 # simple exerciser for sheet2pcp - ODS variant
5 # Copyright (c) 2010 Ken McDonell. All Rights Reserved.
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 which sheet2pcp >/dev/null 2>&1
17 [ $? -eq 0 ] || _notrun "sheet2pcp not installed"
18 perl -e "use XML::TokeParser" >/dev/null 2>&1
19 [ $? -eq 0 ] || _notrun "perl XML::TokeParser module not installed"
20 perl -e "use Spreadsheet::ReadSXC" >/dev/null 2>&1
21 [ $? -eq 0 ] || _notrun "perl Spreadsheet::ReadSXC module not installed"
23 status=0 # success is the default!
24 $sudo rm -rf $tmp.* $seq.full
25 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
27 # real QA test starts here
29 cat <<'End-of-File' >$tmp.mapfile
30 <?xml version="1.0" encoding="UTF-8"?>
31 <!-- For PCP QA 372 -->
32 <sheet heading="1" hostname="time.greenwich.com" datefmt="DMY">
33 <metric sem="PM_SEM_COUNTER">metric.a</metric>
34 <metric sem="PM_SEM_COUNTER">metric.b</metric>
35 <metric>metric.c</metric>
36 <metric type="PM_TYPE_32">metric.d</metric>
37 <metric type="PM_TYPE_STRING">metric.e</metric>
38 <datetime></datetime>
39 <data>metric.a</data>
40 <data>metric.b</data>
41 <data>metric.c</data>
42 <data>metric.d</data>
43 <data>metric.e</data>
44 </sheet>
45 End-of-File
47 echo "=== ODS ==="
48 rm -f $tmp.0 $tmp.index $tmp.meta
49 sheet2pcp sheet/simple.ods $tmp.mapfile $tmp 2>&1
50 [ -f $tmp.0 ] && pmdumplog -az $tmp
52 # success, all done
53 exit