File: 356

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 (81 lines) | stat: -rwxr-xr-x 1,887 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
73
74
75
76
77
78
79
80
81
#!/bin/sh
# PCP QA Test No. 356
#
# segv with derived metrics
#
# Copyright (c) 2010 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

_cleanup()
{
    _restore_auto_restart pmcd
    rm -f $tmp.*
}

status=0	# success is the default!
trap "_cleanup; exit \$status" 0 1 2 3 15

cat <<End-of-File >$tmp.config
bad_in_pkts = network.interface.in.errors + network.interface.in.drops
End-of-File

_filter()
{
    _filter_pmie_log \
    | sed \
	-e '/^\[TIMESTAMP]/'"s/ `hostname`/ HOST/" \
	-e '/^\[TIMESTAMP]/'"s/ local:/ HOST/" \
	-e '/expr_1:.*?/d' \
	-e '/expr_1: [0-9. ]*/s/ .*/ value(s)/' \
	-e 's/Connection reset by peer/IPC protocol failure/' \
	-e '/^  *$/d' \
	-e '/^$/d' \
    | $PCP_AWK_PROG '
skip == 0 && /expr_1/	{ print; print "..."; print ""; skip = 1; next }
skip == 1 && /expr_1/	{ next }
skip == 1 &&  NF == 0	{ next }
			{ print; skip = 0 }'
}

# real QA test starts here

PCP_DERIVED_CONFIG=$tmp.config; export PCP_DERIVED_CONFIG
echo "bad_in_pkts;" | pmie -t 1 -T+15 -v >$tmp.out 2>&1 &

sleep 3

unset PCP_DERIVED_CONFIG
_stop_auto_restart pmcd
if ! _service pmcd restart 2>&1; then _exit 1; fi | _filter_pcp_restart
_wait_for_pmcd || _exit 1

wait

cat $tmp.out >$seq_full
# Especially on slow VMs (like bozo-vm) we may need to dodge warnings
# from pmie's rule scheduler around pmcd reconnection ... the awk
# script does this.
#
cat <$tmp.out \
| $PCP_AWK_PROG '
skip == 1 && /^[^ ]/		{ skip = 0 }
/^run: schedule eval/		{ skip = 1 }
/^sleepTight: negative/		{ skip = 1 }
/^Last sleepTight until:/	{ skip = 1 }
/^This sleepTight\() entry:/	{ skip = 1 }
/^Harvest children done:/	{ skip = 1 }
/^Want sleepTight until:/	{ skip = 1 }
/Task dump @/			{ skip = 1 }
skip == 0			{ print }' \
| _filter

# success, all done
exit