pmrep: fix archive end time reporting
[pcp.git] / qa / 833
blobbdee666548912ed0e6bda5635cca3ed065c7566c
1 #!/bin/sh
2 # PCP QA Test No. 833
4 # Memory leak associated with PDU buffers remaining pinned after calling
5 # pmDestroyContext().
6 # See http://oss.sgi.com/bugzilla/show_bug.cgi?id=1057
8 # Memory corruption after duplicating contexts with attributes after calling
9 # pmDestroyContext().
10 # See http://oss.sgi.com/bugzilla/show_bug.cgi?id=1129
12 # Copyright (c) 2014 Ken McDonell. All Rights Reserved.
13 # Copyright (c) 2016 Red Hat.
16 seq=`basename $0`
17 echo "QA output created by $seq"
19 # get standard environment, filters and checks
20 . ./common.product
21 . ./common.filter
22 . ./common.check
24 _filter_pdu()
26 # free pdubuf[size]: 0xe61000[28672] 0xe5c000[17408]
27 sed \
28 -e '/free pdubuf/s/0x[0-9a-f]*\[[0-9]*\]/addr[size]/g' \
29 | $PCP_AWK_PROG '
30 /free pdubuf/ { if (NF <= 9) {
31 print " free pdubuf[size]: ... <= 7 buffers ..."
32 next
35 { print }'
38 _filter_date()
40 sed \
41 -e 's/[A-Z][a-z][a-z] [A-Z][a-z][a-z] *[0-9][0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9] [0-9][0-9][0-9][0-9]$/DATE/' \
42 # end
45 _filter_pmid()
47 sed \
48 -e 's/^29\./xxx29./' \
49 -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*:/PMID:/' \
50 -e 's/^xxx//' \
51 # end
54 status=1 # failure is the default!
55 $sudo rm -rf $tmp.* $seq.full
56 trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
58 # real QA test starts here
59 echo "=== pmNewContext ==="
60 src/churnctx -z -s 400 -a archives/bug1057 kernel.all.load hinv.ncpu disk.dev.total 2>&1 | _filter_pdu
62 echo
63 echo "=== pmDupContext ==="
64 src/churnctx -d -z -s 400 -a archives/bug1057 kernel.all.load hinv.ncpu disk.dev.total 2>&1 | _filter_pdu
66 echo
67 echo "=== host context, and pmNewContext ... just to be sure ==="
68 src/churnctx -s 10 -t 0.2sec kernel.all.load hinv.ncpu sample.byte_ctr 2>&1 \
69 | _filter_pdu \
70 | _filter_pmid \
71 | _filter_date
73 echo
74 echo "=== local: context with attributes, and pmDupContext ==="
75 src/churnctx -d -s 10 -t 0.2sec -h local: kernel.all.load hinv.ncpu sample.byte_ctr 2>&1 \
76 | _filter_pdu \
77 | _filter_pmid \
78 | _filter_date
80 # success, all done
81 status=0
83 exit