File: 763

package info (click to toggle)
pcp 7.1.0-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 252,748 kB
  • sloc: ansic: 1,483,656; sh: 182,366; xml: 160,462; cpp: 83,813; python: 24,980; perl: 18,327; yacc: 6,877; lex: 2,864; makefile: 2,738; awk: 165; fortran: 60; java: 52
file content (72 lines) | stat: -rwxr-xr-x 1,628 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/sh
# PCP QA Test No. 763
# Exercise slow PMDA connect_pmcd() method.
# [see also qa/843 for the Python version]
#
# Copyright (c) 2014 Ken McDonell.  All Rights Reserved.
#

seq=`basename $0`
echo "QA output created by $seq"

# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check

perl -e "use PCP::PMDA" >/dev/null 2>&1
[ $? -eq 0 ] || _notrun "perl PCP::PMDA module not installed"

_cleanup()
{
    if pmprobe -I pmcd.agent.status | grep '"slow"' >/dev/null
    then
	cd $here/pmdas/slow
	$sudo ./Remove >>$seq_full 2>&1
	$sudo rm -f domain.h.perl pmns.perl
	cd $here
    fi
}

status=1	# failure is the default!
trap "cd $here; rm -rf $tmp.*; _cleanup; exit \$status" 0 1 2 3 15

cd pmdas/slow
$PCP_MAKE_PROG clean >>$seq_full 2>&1

# real QA test starts here

# 4 below must be bigger than pmcd's creds_timeout ... make sure
# this is set to the default [3]
#
pmstore pmcd.control.creds_timeout 3 >>$seq_full 2>&1

for start in 0 4 -4
do
    echo | tee -a $seq_full
    case "$start"
    in
	0)
	    echo "=== no start delay ===" | tee -a $seq_full
	    ;;
	-[0-9]*)
	    echo "=== start delay `expr -1 \* $start` sec, no connect_pmcd() ===" | tee -a $seq_full
	    ;;
	[0-9]*)
	    echo "=== start delay $start sec, using connect_pmcd() ===" | tee -a $seq_full
	    ;;
    esac
    date >>$seq_full
    cat <<End-of-File | $sudo ./Install
$start
End-of-File
    date >>$seq_full
    pminfo -f slow | tee -a $seq_full
    $sudo cat $PCP_LOG_DIR/pmcd/slow.log >>$seq_full
    $sudo tail -40 $PCP_LOG_DIR/pmcd/pmcd.log >>$seq_full
done

# success, all done
status=0

exit