diff options
author | Josh Stone <jistone@redhat.com> | 2009-04-24 18:07:12 -0700 |
---|---|---|
committer | Josh Stone <jistone@redhat.com> | 2009-04-24 20:09:27 -0700 |
commit | 5badd4d0d1fc3f7dce2dc26a3ad5a69275ff07d2 (patch) | |
tree | 1e84f94d01a18bfefa1e03d2074e1efd639a1fe8 /testsuite/systemtap.base/badkprobe.exp | |
parent | 8f497c23fd73345bd73b085a853f9c8be548715c (diff) | |
download | systemtap-steved-5badd4d0d1fc3f7dce2dc26a3ad5a69275ff07d2.tar.gz systemtap-steved-5badd4d0d1fc3f7dce2dc26a3ad5a69275ff07d2.tar.xz systemtap-steved-5badd4d0d1fc3f7dce2dc26a3ad5a69275ff07d2.zip |
Don't terminate when a dwarfless kprobe fails
All of our other kprobe types will let the script continue after a
registration failure, as per PR6749. The dwarfless kprobes should be
no exception.
Also, the way they were exiting was causing an unclean shutdown, so I
added tests to badkprobe.exp to make sure that cleanup is always allowed
to run.
Diffstat (limited to 'testsuite/systemtap.base/badkprobe.exp')
-rw-r--r-- | testsuite/systemtap.base/badkprobe.exp | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/testsuite/systemtap.base/badkprobe.exp b/testsuite/systemtap.base/badkprobe.exp index efc06695..c0815fbe 100644 --- a/testsuite/systemtap.base/badkprobe.exp +++ b/testsuite/systemtap.base/badkprobe.exp @@ -1,14 +1,28 @@ -set script "probe kernel.statement(-1).absolute {} probe timer.s(1) { exit() }" set test "bad kprobe registration" +set script { + probe $1 {} + probe timer.s(1) { exit() } + probe end { println("cleanup ok") } +} if {! [installtest_p]} { untested $test; return } -spawn stap -g -w -e "$script" -expect { - -timeout 60 - -re "^WARNING: probe .*registration error.*" { pass $test } - eof { fail "$test (eof)" } - timeout { fail "$test (timeout)" } +set bad_kprobes { + kernel.statement(-1).absolute + kprobe.statement(-1).absolute + kprobe.function("no_such_function") + kprobe.function("no_such_function").return +} + +foreach bk $bad_kprobes { + set test "bad kprobe registration: $bk" + spawn stap -g -w -e "$script" "$bk" + expect { + -timeout 60 + -re "^WARNING: probe .*registration error.*\r\ncleanup ok" { pass $test } + eof { fail "$test (eof)" } + timeout { fail "$test (timeout)" } + } + catch {close} + catch {wait} } -catch {close} -catch {wait} |