Debian Codegraph @

doc/SystemTap_Beginners_Guide/testsuite/systemtap.base/control_limits.exp

raw
1 set test "control_limits MAXNESTING"
2 if {![installtest_p]} { untested $test; return }
3
4 # Test MAXNESTING.
5 foreach runtime [get_runtime_list] {
6 set test "control_limits MAXNESTING"
7 if {$runtime != ""} {
8 lappend test "($runtime)"
9 spawn stap -u -DMAXNESTING=5 $srcdir/$subdir/control_limits.stp \
10 --runtime=$runtime
11 } else {
12 spawn stap -u -DMAXNESTING=5 $srcdir/$subdir/control_limits.stp
13 }
14 set ok 0
15 expect {
16 -timeout 150
17 -re {ERROR.*MAXNESTING} { incr ok; exp_continue }
18 timeout { fail "$test (timeout)" }
19 eof { }
20 }
21 catch {close}; catch {wait}
22 if {$ok == 1} { pass "$test ($ok)" } { fail "$test ($ok)" }
23 }
24
25 foreach runtime [get_runtime_list] {
26 set test "control_limits MAXNESTING proper"
27 if {$runtime != ""} {
28 lappend test "($runtime)"
29 spawn stap -u -DMAXNESTING=8 $srcdir/$subdir/control_limits.stp \
30 --runtime=$runtime
31 } else {
32 spawn stap -u -DMAXNESTING=8 $srcdir/$subdir/control_limits.stp
33 }
34 set ko 0
35 expect {
36 -timeout 150
37 -re {ERROR.*MAXNESTING} { incr ko; exp_continue }
38 timeout { fail "$test (timeout)" }
39 eof { }
40 }
41 catch {close}; catch {wait}
42 if {$ko == 0} { pass "$test ($ko)" } { fail "$test ($ko)" }
43 }
44
45 # Test MAXACTION.
46 foreach runtime [get_runtime_list] {
47 set test "control_limits MAXACTION"
48 if {$runtime != ""} {
49 lappend test "($runtime)"
50 spawn stap -u -DMAXACTION_INTERRUPTIBLE=500 \
51 $srcdir/$subdir/control_limits.stp --runtime=$runtime
52 } else {
53 spawn stap -u -DMAXACTION_INTERRUPTIBLE=500 \
54 $srcdir/$subdir/control_limits.stp
55 }
56 set ok 0
57 expect {
58 -timeout 150
59 -re {ERROR.*MAXACTION} { incr ok; exp_continue }
60 timeout { fail "$test (timeout)" }
61 eof { }
62 }
63 catch {close}; catch {wait}
64 if {$ok == 1} { pass "$test ($ok)" } { fail "$test ($ok)" }
65 }
66
67 foreach runtime [get_runtime_list] {
68 set test "control_limits MAXACTION proper"
69 if {$runtime != ""} {
70 lappend test "($runtime)"
71 spawn stap -u -DMAXACTION_INTERRUPTIBLE=502 \
72 $srcdir/$subdir/control_limits.stp --runtime=$runtime
73 } else {
74 spawn stap -u -DMAXACTION_INTERRUPTIBLE=502 \
75 $srcdir/$subdir/control_limits.stp
76 }
77 set ko 0
78 expect {
79 -timeout 150
80 -re {ERROR.*MAXACTION} { incr ko; exp_continue }
81 timeout { fail "$test (timeout)" }
82 eof { }
83 }
84 catch {close}; catch {wait}
85 if {$ko == 0} { pass "$test ($ko)" } { fail "$test ($ko)" }
86 }
87
88 # Test MAXMAPENTRIES.
89 foreach runtime [get_runtime_list] {
90 set test "control_limits MAXMAPENTRIES"
91 if {$runtime != ""} {
92 lappend test "($runtime)"
93 spawn stap -u -D MAXMAPENTRIES=19 \
94 $srcdir/$subdir/control_limits.stp --runtime=$runtime
95 } else {
96 spawn stap -u -D MAXMAPENTRIES=19 \
97 $srcdir/$subdir/control_limits.stp
98 }
99 set ok 0
100 expect {
101 -timeout 150
102 -re {ERROR.*MAXMAPENTRIES} { incr ok; exp_continue }
103 timeout { fail "$test (timeout)" }
104 eof { }
105 }
106 catch {close}; catch {wait}
107 if {$ok == 1} { pass "$test ($ok)" } { fail "$test ($ok)" }
108 }
109
110 foreach runtime [get_runtime_list] {
111 set test "control_limits MAXMAPENTRIES proper"
112 if {$runtime != ""} {
113 lappend test "($runtime)"
114 spawn stap -u -D MAXMAPENTRIES=20 \
115 $srcdir/$subdir/control_limits.stp --runtime=$runtime
116 } else {
117 spawn stap -u -D MAXMAPENTRIES=20 \
118 $srcdir/$subdir/control_limits.stp
119 }
120 set ko 0
121 expect {
122 -timeout 150
123 -re {ERROR.*MAXMAPENTRIES} { incr ko; exp_continue }
124 timeout { fail "$test (timeout)" }
125 eof { }
126 }
127 catch {close}; catch {wait}
128 if {$ko == 0} { pass "$test ($ko)" } { fail "$test ($ko)" }
129 }
130
131 # Test MAXSTRINGLEN.
132 foreach runtime [get_runtime_list] {
133 set test "control_limits MAXSTRINGLEN small"
134 if {$runtime != ""} {
135 lappend test "($runtime)"
136 spawn stap -u -DMAXSTRINGLEN=50 \
137 $srcdir/$subdir/control_limits.stp --runtime=$runtime
138 } else {
139 spawn stap -u -DMAXSTRINGLEN=50 $srcdir/$subdir/control_limits.stp
140 }
141 set ok 0
142 expect {
143 -timeout 150
144 -re {ERROR.*MAXSTRINGLEN reduced} { incr ok; exp_continue }
145 timeout { fail "$test (timeout)" }
146 eof { }
147 }
148 catch {close}; catch {wait}
149 if {$ok == 1} { pass "$test ($ok)" } { fail "$test ($ok)" }
150 }
151
152 foreach runtime [get_runtime_list] {
153 set test "control_limits MAXSTRINGLEN large"
154 if {$runtime != ""} {
155 lappend test "($runtime)"
156 spawn stap -u -DMAXSTRINGLEN=500 \
157 $srcdir/$subdir/control_limits.stp --runtime=$runtime
158 } else {
159 spawn stap -u -DMAXSTRINGLEN=500 $srcdir/$subdir/control_limits.stp
160 }
161 set ok 0
162 expect {
163 -timeout 150
164 -re {ERROR.*MAXSTRINGLEN enlarged} { incr ok; exp_continue }
165 timeout { fail "$test (timeout)" }
166 eof { }
167 }
168 catch {close}; catch {wait}
169 if {$ok == 1} { pass "$test ($ok)" } { fail "$test ($ok)" }
170 }