3 # Increase coverage and check malloc failure for event record routines.
5 # Copyright (c) 2011 Ken McDonell. All Rights Reserved.
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
16 src
/check_fault_injection
>/dev
/null
2>&1 || \
17 _notrun
"libpcp not built with fault injection enabled"
19 status
=0 # success is the default!
20 $sudo rm -rf $tmp.
* $seq.full
21 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
25 echo "=== stdout ===" >>$seq.full
26 cat $tmp.out
>>$seq.full
29 echo "=== stderr ===" >>$seq.full
30 cat $tmp.err
>>$seq.full
33 ( cat $tmp.out
; echo; cat $tmp.err
) \
35 -e "s/\(host:[ ]*\)`hostname`/\1localhost/" \
36 -e '/__pmFaultInject(.*) not registered/d' \
37 -e 's/[0-2][0-9]:[0-5][0-9]:[0-5][0-9]\.[0-9][0-9][0-9]/TIMESTAMP/g' \
38 -e 's/Not enough space/Cannot allocate memory/'
41 export PM_FAULT_CONTROL
=$tmp.control
42 export LD_PRELOAD
=$PCP_LIB_DIR/libpcp_fault.so
44 # real QA test starts here
45 cat >$tmp.control
<<End-of-File
47 libpcp/events.c:2 % 11
48 libpcp/events.c:3 % 13
51 pmstore sample.event.
reset 0 >/dev
/null
2>&1
52 pmevent
-Dfault -t 0.2 -s 10 sample.event.records
>$tmp.out
2>$tmp.err
55 # first pmRegisterAnon() fails
57 cat >$tmp.control
<<End-of-File
60 pmstore sample.event.
reset 0 >/dev
/null
2>&1
61 pmevent
-Dfault -t 0.2 -s 2 sample.event.records
>$tmp.out
2>$tmp.err
64 # second pmRegisterAnon() fails
66 cat >$tmp.control
<<End-of-File
69 pmstore sample.event.
reset 0 >/dev
/null
2>&1
70 pmevent
-Dfault -t 0.2 -s 2 sample.event.records
>$tmp.out
2>$tmp.err