Merge branch 'master' of git://git.pcp.io/pcp into qt
[pcp.git] / qa / 841
blobfe2569db49d2e8ad75b32c1f51cd8b0d6c891d0e
1 #!/bin/sh
2 # PCP QA Test No. 841
3 # Exercise slow_python PMDA connect_pmcd() method - Python variant
4 # [see also qa/763 for the Perl version]
6 # Copyright (c) 2014 Ken McDonell. All Rights Reserved.
9 seq=`basename $0`
10 echo "QA output created by $seq"
12 # get standard environment, filters and checks
13 . ./common.product
14 . ./common.filter
15 . ./common.check
17 _cleanup()
19 if pmprobe -I pmcd.agent.status | grep '"slow_python"' >/dev/null
20 then
21 cd $here/pmdas/slow_python
22 $sudo ./Remove >>$here/$seq.full 2>&1
23 $sudo rm -f domain.h.python
24 cd $here
28 status=1 # failure is the default!
29 $sudo rm -rf $tmp.* $seq.full
30 trap "cd $here; rm -rf $tmp.*; _cleanup; exit \$status" 0 1 2 3 15
32 python -c 'from pcp import pmda' 2>/dev/null
33 test $? -eq 0 || _notrun 'Python pcp pmda module is not installed'
35 cd pmdas/slow_python
36 $PCP_MAKE_PROG clean >>$here/$seq.full 2>&1
38 # real QA test starts here
39 for start in 0 4 -4
41 echo | tee -a $here/$seq.full
42 case "$start"
45 echo "=== no start delay ===" | tee -a $here/$seq.full
47 -[0-9]*)
48 echo "=== start delay `expr \( -1 \) \* $start` sec, no connect_pmcd() ===" | tee -a $here/$seq.full
50 [0-9]*)
51 echo "=== start delay $start sec, using connect_pmcd() ===" | tee -a $here/$seq.full
53 esac
54 date >>$here/$seq.full
55 cat <<End-of-File | $sudo ./Install
56 both
57 $start
58 End-of-File
59 date >>$here/$seq.full
60 pminfo -f slow_python | tee -a $here/$seq.full
61 $sudo cat $PCP_LOG_DIR/pmcd/slow_python.log >>$here/$seq.full
62 $sudo tail -40 $PCP_LOG_DIR/pmcd/pmcd.log >>$here/$seq.full
63 done
65 # success, all done
66 status=0
68 exit