File: 535

package info (click to toggle)
pcp 7.0.5-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 252,916 kB
  • sloc: ansic: 1,478,844; sh: 177,285; xml: 160,462; cpp: 83,809; python: 24,349; perl: 18,303; yacc: 6,877; lex: 2,864; makefile: 2,694; awk: 165; fortran: 60; java: 52
file content (183 lines) | stat: -rwxr-xr-x 3,942 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
#! /bin/sh
# PCP QA Test No. 535
# #535080 - dynamic indoms for pmie, uses sample.dynamic.*
#
# Copyright (c) 1995-2002 Silicon Graphics, Inc.  All Rights Reserved.
#

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

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

signal=$PCP_BINADM_DIR/pmsignal
status=1	# failure is the default!
control=$PCP_PMDAS_DIR/sample/dynamic.indom

_cleanup()
{
    [ -f $control.qa-$seq ] && $sudo mv $control.qa-$seq $control
    rm -f $tmp.*
}

$sudo rm -f $control.qa-$seq

trap "_cleanup; exit \$status" 0 1 2 3 15

[ -f $control ] && $sudo mv $control $control.qa-$seq

# real QA test starts here

if ! _service pmcd restart 2>&1; then _exit 1; fi \
| _filter_pcp_restart
_wait_for_pmcd || _exit 1
if ! _service pmlogger restart 2>&1; then _exit 1; fi \
| _filter_pcp_restart
_wait_for_pmlogger || _exit 1

# prime the sample PMDA to refresh the dynamic indom
#
pminfo -f sample.dynamic >/dev/null 2>&1

echo
echo "=== pmprobe ==="

pmprobe -I sample.dynamic.counter sample.dynamic.instant sample.dynamic.discrete

cat <<End-of-File | pmie -t 250msec >$tmp.out 2>$tmp.err &
some_inst ( sample.dynamic.counter > 0 ) -> shell "echo counter:" " %i:?";
some_inst ( sample.dynamic.instant > 0 ) -> shell "echo instant:" " %i:?";
some_inst ( sample.dynamic.discrete > 0 ) -> shell "echo discrete:" " %i:?";
End-of-File
pid=$!

sleep 2

# initial config
#
cat >$tmp.indom <<End-of-File
10 one
20 two
30 three
200 twenty
End-of-File
$sudo rm -f $control
$sudo cp $tmp.indom $control
sleep 1
pmprobe -I sample.dynamic.counter sample.dynamic.instant sample.dynamic.discrete
sleep 1

# add one in the middle
#
cat >$tmp.indom <<End-of-File
10 one
20 two
30 three
40 four
200 twenty
End-of-File
$sudo rm -f $control
$sudo cp $tmp.indom $control
sleep 1
pmprobe -I sample.dynamic.counter sample.dynamic.instant sample.dynamic.discrete
sleep 1

# remove all but the first and last
#
cat >$tmp.indom <<End-of-File
10 one
200 twenty
End-of-File
$sudo rm -f $control
$sudo cp $tmp.indom $control
sleep 1
pmprobe -I sample.dynamic.counter sample.dynamic.instant sample.dynamic.discrete
sleep 1

# re-instate previous state, with new ones at each end
#
cat >$tmp.indom <<End-of-File
00 zero
10 one
20 two
30 three
40 four
200 twenty
210 twenty-one
End-of-File
$sudo rm -f $control
$sudo cp $tmp.indom $control
sleep 1
pmprobe -I sample.dynamic.counter sample.dynamic.instant sample.dynamic.discrete
sleep 1

# replace every second one
#
cat >$tmp.indom <<End-of-File
05 zero+
10 one
25 two+
30 three
45 four+
200 twenty
215 twenty-one+
End-of-File
$sudo rm -f $control
$sudo cp $tmp.indom $control
sleep 1
pmprobe -I sample.dynamic.counter sample.dynamic.instant sample.dynamic.discrete
sleep 1

# replace every thing by one (different) instance
#
cat >$tmp.indom <<End-of-File
1 singular
End-of-File
$sudo rm -f $control
$sudo cp $tmp.indom $control
sleep 1
pmprobe -I sample.dynamic.counter sample.dynamic.instant sample.dynamic.discrete
sleep 1

$signal -s TERM $pid
wait

$sudo rm -f $control
sleep 1
pmprobe -I sample.dynamic.counter sample.dynamic.instant sample.dynamic.discrete
sleep 1

echo
echo "=== pmie ==="

LC_COLLATE=POSIX sort -u $tmp.out

# 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.
#
$PCP_AWK_PROG <$tmp.err >$tmp.tmp '
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 }'

cat $tmp.tmp | _show_pmie_errors

echo "== stdout ==" >$seq_full
cat $tmp.out >>$seq_full
echo >>$seq_full
echo "== stderr ==" >>$seq_full
cat $tmp.err >>$seq_full

# success, all done
status=0
exit