Debian Codegraph @

doc/SystemTap_Beginners_Guide/testsuite/systemtap.base/suppress-time-limit.exp

raw
1 set test "suppress-time-limit"
2
3 if {! [installtest_p]} { untested "$test"; return }
4
5 foreach runtime [get_runtime_list] {
6 set test_extra ""
7 if {$runtime != ""} {
8 set test_extra " ($runtime)"
9 spawn stap --runtime=$runtime -g --suppress-time-limits \
10 $srcdir/$subdir/$test.stp
11 } else {
12 spawn stap -g --suppress-time-limits $srcdir/$subdir/$test.stp
13 }
14 set ok 0
15 set ko 0
16 # Testing that -g --suppress-time-limits works properly
17 # by looping 100000 time and confirming the number of iterations
18 # to what we expect.
19 # The default setting only allows for 10000, so we want to test
20 # against a value significantly larger than that.
21 expect {
22 -timeout 30
23 -re {^100000\r\n} { incr ok; exp_continue }
24 timeout { fail "$test active${test_extra} (timeout)" }
25 eof { }
26 }
27 catch {close}; catch {wait}
28 # The actual comparing of active values to what we expect.
29 # For debugging purposes, output the value of the variables
30 # so we can see which value failed (if any)
31 if {$ok == 1} then {
32 pass "$test active${test_extra} ($ok)"
33 } else {
34 fail "$test active${test_extra} ($ok)"
35 }
36 # Testing the case which should fail, without the new option,
37 # and comparing the number of iterations to what we expect (ie 9997).
38 if {$runtime != ""} {
39 spawn stap --runtime=$runtime $srcdir/$subdir/$test.stp
40 } else {
41 spawn stap $srcdir/$subdir/$test.stp
42 }
43 expect {
44 -timeout 30
45 -re {^ERROR:[^\r\n]*\r\n} { incr ko; exp_continue }
46 -re {^WARNING:[^\r\n]*\r\n} { incr ko; exp_continue }
47 -re {^9997\r\n} { incr ko; exp_continue }
48 eof { }
49 timeout { fail "$test passive${test_extra} (timeout)" }
50 }
51 catch {close}; catch {wait}
52 # The actual comparing of passive values to what we expect.
53 # For debugging purposes, output the value of the variables
54 # so we can see which value failed (if any)
55 if {$ko == 4} then {
56 pass "$test passive${test_extra} ($ko)"
57 } else {
58 fail "$test passive${test_extra} ($ko)"
59 }
60 }