diff options
author | David Smith <dsmith@redhat.com> | 2009-08-11 17:08:47 -0500 |
---|---|---|
committer | David Smith <dsmith@redhat.com> | 2009-08-11 17:08:47 -0500 |
commit | 57db697397af3911c40682dc91a2b13e3943e478 (patch) | |
tree | cf221ed7b13c50288a39139ccb0ca490849ca431 | |
parent | 121d0bf7a7dc0d8cd48dfc94724c1f108c85f01e (diff) | |
download | systemtap-steved-57db697397af3911c40682dc91a2b13e3943e478.tar.gz systemtap-steved-57db697397af3911c40682dc91a2b13e3943e478.tar.xz systemtap-steved-57db697397af3911c40682dc91a2b13e3943e478.zip |
Improved context.exp error handling.
* testsuite/systemtap.context/context.exp: Makes sure errors are output to
the log file. Also, a Makefile is copied with 'cp -p' to avoid make
erroring out if the Makefile's date is in the future (as can be the case
if running the test over nfs).
* testsuite/systemtap.context/args.tcl: Makes sure 'close' errors are
ignored.
* testsuite/systemtap.context/backtrace.tcl: Ditto.
-rw-r--r-- | testsuite/systemtap.context/args.tcl | 2 | ||||
-rw-r--r-- | testsuite/systemtap.context/backtrace.tcl | 4 | ||||
-rw-r--r-- | testsuite/systemtap.context/context.exp | 12 |
3 files changed, 8 insertions, 10 deletions
diff --git a/testsuite/systemtap.context/args.tcl b/testsuite/systemtap.context/args.tcl index cffaeaef..fb8aecb4 100644 --- a/testsuite/systemtap.context/args.tcl +++ b/testsuite/systemtap.context/args.tcl @@ -54,5 +54,5 @@ expect { eof {fail "function arguments: unexpected timeout"} } exec kill -INT -[exp_pid] -close +catch { close } wait diff --git a/testsuite/systemtap.context/backtrace.tcl b/testsuite/systemtap.context/backtrace.tcl index d401d89f..5e7b1536 100644 --- a/testsuite/systemtap.context/backtrace.tcl +++ b/testsuite/systemtap.context/backtrace.tcl @@ -163,7 +163,5 @@ if {$m6 == 5} { fail "print_stack of yyy_func4 ($m6)" } - - -close +catch { close } wait diff --git a/testsuite/systemtap.context/context.exp b/testsuite/systemtap.context/context.exp index 52bf260d..da9910b6 100644 --- a/testsuite/systemtap.context/context.exp +++ b/testsuite/systemtap.context/context.exp @@ -24,7 +24,7 @@ proc build_modules {} { global srcdir subdir if {[catch {exec mktemp -d staptestXXXXXX} build_dir]} { - puts stderr "Failed to create temporary directory: $build_dir" + verbose -log "Failed to create temporary directory: $build_dir" return 0 } @@ -35,21 +35,21 @@ proc build_modules {} { cd $build_dir foreach n {2 1} { - exec cp $srcdir/$subdir/makefile$n Makefile + exec cp -p $srcdir/$subdir/makefile$n Makefile if {[catch {exec make clean} res]} { - puts $res + verbose -log "$res" cd $old_dir return 0 } catch {exec make} res if {![file exists systemtap_test_module$n.ko]} { - puts $res + verbose -log "$res" cd $old_dir return 0 } set res [as_root [list cp systemtap_test_module$n.ko /lib/modules/$::uname/kernel]] if { $res != 0 } { - puts $res + verbose -log "$res" cd $old_dir return 0 } @@ -72,7 +72,7 @@ proc build_modules {} { set uname [exec /bin/uname -r] if {[build_modules] == 0} { - puts "BUILD FAILED" + verbose -log "BUILD FAILED" foreach test $testlist { fail "$test - could not build modules" } |