| 1 |
# PR 2142+2610 |
| 2 |
|
| 3 |
set test "absentstats" |
| 4 |
set script $srcdir/$subdir/$test.stp |
| 5 |
|
| 6 |
if {![installtest_p]} { untested $test; return } |
| 7 |
|
| 8 |
foreach runtime [get_runtime_list] { |
| 9 |
set ok 0 |
| 10 |
set ko 0 |
| 11 |
|
| 12 |
set testname $test |
| 13 |
if {$runtime != ""} { |
| 14 |
spawn stap -DMAXERRORS=20 --runtime=$runtime $script |
| 15 |
lappend testname "($runtime)" |
| 16 |
} else { |
| 17 |
spawn stap -DMAXERRORS=20 $script |
| 18 |
} |
| 19 |
expect { |
| 20 |
-timeout 150 |
| 21 |
-re {^ERROR: empty aggregate[^\r]*\r} { incr ko ; exp_continue } |
| 22 |
-re {^WARNING: Number of errors} { incr ko ; exp_continue } |
| 23 |
-re {^0\r} { incr ok ; exp_continue } |
| 24 |
-re {\n} { exp_continue } |
| 25 |
eof { } |
| 26 |
} |
| 27 |
catch close |
| 28 |
wait |
| 29 |
|
| 30 |
# As of stap 1.5, @count and @sum are allowed, the rest fail |
| 31 |
if {$ok == 4 && $ko == 13} { |
| 32 |
pass $testname |
| 33 |
} else { |
| 34 |
fail "$testname ($ok $ko)" |
| 35 |
} |
| 36 |
|
| 37 |
set ok 0 |
| 38 |
set ko 0 |
| 39 |
|
| 40 |
if {$runtime != ""} { |
| 41 |
spawn stap -DMAXERRORS=20 --runtime=$runtime $script --compatible=1.4 |
| 42 |
} else { |
| 43 |
spawn stap -DMAXERRORS=20 $script --compatible=1.4 |
| 44 |
} |
| 45 |
expect { |
| 46 |
-timeout 150 |
| 47 |
-re {^ERROR: empty aggregate[^\r]*\r} { incr ko ; exp_continue } |
| 48 |
-re {^WARNING: Number of errors} { incr ko ; exp_continue } |
| 49 |
-re {^0\r} { incr ok ; exp_continue } |
| 50 |
-re {\n} { exp_continue } |
| 51 |
eof { } |
| 52 |
} |
| 53 |
catch close |
| 54 |
wait |
| 55 |
|
| 56 |
# In stap <= 1.4, only @count is allowed, the rest fail |
| 57 |
if {$ok == 2 && $ko == 15} { |
| 58 |
pass "$testname 1.4" |
| 59 |
} else { |
| 60 |
fail "$testname 1.4 ($ok $ko)" |
| 61 |
} |
| 62 |
} |