| 1 |
set test "system_func" |
| 2 |
if {![installtest_p]} { untested $test; return } |
| 3 |
|
| 4 |
foreach runtime [get_runtime_list] { |
| 5 |
set test "system_func" |
| 6 |
if {$runtime != ""} { |
| 7 |
lappend test "($runtime)" |
| 8 |
spawn stap --runtime=$runtime $srcdir/$subdir/system_func.stp |
| 9 |
} else { |
| 10 |
spawn stap $srcdir/$subdir/system_func.stp |
| 11 |
} |
| 12 |
set open 0 |
| 13 |
set done 0 |
| 14 |
set saw_user 0 |
| 15 |
set user [exec whoami] |
| 16 |
expect { |
| 17 |
-timeout 30 |
| 18 |
-re "($user|sys_open|DONE)\r" { |
| 19 |
switch $expect_out(1,string) { |
| 20 |
sys_open {incr open} |
| 21 |
DONE {incr done} |
| 22 |
default {incr saw_user} |
| 23 |
} |
| 24 |
exp_continue |
| 25 |
} |
| 26 |
timeout { fail "$test (timeout)" } |
| 27 |
eof { } |
| 28 |
} |
| 29 |
catch {close}; catch {wait} |
| 30 |
if {$open == 1 && $saw_user == 1 && $done == 1 } { |
| 31 |
pass "$test" |
| 32 |
} else { |
| 33 |
fail "$test ($open,$saw_user,$done)" |
| 34 |
} |
| 35 |
} |