| 1 |
# This testcase is based on pr10568. It ensures that when an alias |
| 2 |
# causes a tapset file to be included, the entire files gets included. |
| 3 |
|
| 4 |
set test alias_tapset |
| 5 |
|
| 6 |
set never_found 0 |
| 7 |
set kernel_function_found 0 |
| 8 |
set timer_found 0 |
| 9 |
|
| 10 |
set cmd "bash -c {stap -p2 -I $srcdir/$subdir/${test} $srcdir/$subdir/${test}.stp | grep -E '^kprobe|^kernel|^never|^timer'}" |
| 11 |
verbose -log "running $cmd" |
| 12 |
eval spawn $cmd |
| 13 |
expect { |
| 14 |
-timeout 60 |
| 15 |
-re {^never[^\r\n]+\r\n} { incr never_found; exp_continue } |
| 16 |
-re {^(kernel|kprobe)\.function[^\r\n]+\r\n} { incr kernel_function_found; exp_continue } |
| 17 |
-re {^timer\.s\(5\)[^\r\n]+\r\n} { incr timer_found; exp_continue } |
| 18 |
-re {^[^\r\n]+\r\n} { |
| 19 |
# ignore output we're not interested in |
| 20 |
exp_continue } |
| 21 |
timeout { verbose -log "TIMEOUT" } |
| 22 |
} |
| 23 |
catch { close } |
| 24 |
|
| 25 |
# get the return code of the process |
| 26 |
set rc [lindex [wait -i $spawn_id] 3] |
| 27 |
|
| 28 |
if { $rc == 0 && $never_found == 1 && $kernel_function_found >= 1 |
| 29 |
&& $timer_found == 1 } { |
| 30 |
pass $test |
| 31 |
} else { |
| 32 |
fail "$test ($rc, $never_found, $kernel_function_found, $timer_found)" |
| 33 |
} |