zsh completions: minor tweaks
[pcp.git] / qa / 865
blob55b464657c14003668d68792624c0792e84a8721
1 #!/bin/sh
2 # PCP QA Test No. 865
3 # Use slow PMDA to exercise __pmCloseChannel() on the pmFetch() path
5 # Copyright (c) 2014-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 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 '"slow"' >/dev/null
22 then
23 cd $here/pmdas/slow
24 $sudo ./Remove >>$here/$seq.full 2>&1
25 $sudo rm -f domain.h.perl pmns.perl
26 cd $here
30 # [Sat Jul 30 17:33:55] multictx(26317) Error: __pmCloseChannel: fd=3 context=1: Timeout waiting for a response from PMCD
31 _filter()
33 sed \
34 -e 's/multictx([0-9][0-9]*)/multictx(PID)/' \
35 -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]]/[DATE]/' \
36 # end
39 status=1 # failure is the default!
40 $sudo rm -rf $tmp $tmp.* $seq.full
41 trap "cd $here; rm -rf $tmp $tmp.*; _cleanup; exit \$status" 0 1 2 3 15
43 cd $here/pmdas/slow
44 $PCP_MAKE_PROG clean >>$here/$seq.full 2>&1
45 cat <<End-of-File | $sudo ./Install
46 both
49 End-of-File
50 cd $here
52 # avoid any PDUs associated with the definition of derived metrics
53 export PCP_DERIVED_CONFIG=
55 # # samples is sufficient to do all ops in multictx.c 2 times for
56 # each of 3 metrics, so x6 altogether
58 samples=60
60 # real QA test starts here
62 echo "First no timeouts ..."
63 src/multictx -s $samples sample.part_bin slow.seventeen pmcd.buf.alloc 2>&1 \
64 | _filter
66 echo
67 echo "Now with timeouts ..."
68 export PMCD_REQUEST_TIMEOUT=2
69 src/multictx -s $samples sample.part_bin slow.seventeen pmcd.buf.alloc 2>&1 \
70 | _filter
72 # success, all done
73 status=0
75 exit