pmrep: fix archive end time reporting
[pcp.git] / qa / 1040
blob54791bb01a8e9a12f3625075e377570f550c2294
1 #!/bin/sh
2 # PCP QA Test No. 1040
3 # dbpmda can trigger malloc badness in the libpcp pmns routines
5 # Copyright (c) 2016 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 status=1 # failure is the default!
17 $sudo rm -rf $tmp $tmp.* $seq.full
18 trap "cd $here; rm -rf $tmp $tmp.*; exit \$status" 0 1 2 3 15
20 $sudo rm -f /tmp/no/such/file
22 _filter()
24 sed \
25 -e '/pmResult/s/ .* numpmid/ ... numpmid/' \
26 -e '/value/s/1000000 .*/1000000 .../' \
27 -e "s;$PCP_PMDAS_DIR;\$PCP_PMDAS_DIR;" \
28 -e "s/\\.$DSO_SUFFIX/.\$DSO_SUFFIX/" \
29 -e "s@$tmp@TMP@g" \
30 # done
33 cat <<End-of-File >$tmp.pmns
34 root {
35 empty 29:0:13 /* really pmid for sample.long.million */
37 End-of-File
39 pipepmda=$PCP_PMDAS_DIR/sample/pmdasample
40 [ ! -f $pipepmda ] && echo "FATAL ERROR Could not find \"$pipepmda\"" && exit 1
42 # real QA test starts here
43 $sudo TERM=ansi dbpmda -ie <<End-of-File 2>&1 | _filter
44 open pipe $pipepmda -d 29
45 fetch sample.long.million
46 # pmns from non-existent file
47 namespace /tmp/no/such/file
48 fetch sample.long.million
49 # pmns from /dev/null
50 namespace /dev/null
51 fetch sample.long.million
52 # near-emtpy pmns
53 namespace $tmp.pmns
54 fetch sample.long.million
55 fetch empty
56 End-of-File
58 # success, all done
59 status=0
61 exit