diff options
author | hunt <hunt> | 2007-07-02 07:22:21 +0000 |
---|---|---|
committer | hunt <hunt> | 2007-07-02 07:22:21 +0000 |
commit | 81bceb41bf645dbef2ec8fe1522ad1b68a02d17d (patch) | |
tree | 9956ad4f6bc5122387a040adb442032cb752aecd /testsuite/systemtap.context/context.exp | |
parent | a147cc55c352fecdfe6835af8100403594b79dad (diff) | |
download | systemtap-steved-81bceb41bf645dbef2ec8fe1522ad1b68a02d17d.tar.gz systemtap-steved-81bceb41bf645dbef2ec8fe1522ad1b68a02d17d.tar.xz systemtap-steved-81bceb41bf645dbef2ec8fe1522ad1b68a02d17d.zip |
2007-07-02 Martin Hunt <hunt@redhat.com>
* systemtap.context/*: New context tests.
Diffstat (limited to 'testsuite/systemtap.context/context.exp')
-rw-r--r-- | testsuite/systemtap.context/context.exp | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/testsuite/systemtap.context/context.exp b/testsuite/systemtap.context/context.exp new file mode 100644 index 00000000..f4b34fba --- /dev/null +++ b/testsuite/systemtap.context/context.exp @@ -0,0 +1,59 @@ +set testlist {backtrace args} + +if {![installtest_p]} { + foreach test $testlist { + untested $test + } + return +} + +proc cleanup {} { + catch {send "\003"} + foreach n {1 2} { + catch {exec sudo /bin/rm -f /lib/modules/$::uname/systemtap_test_module$n.ko} + catch {exec sudo /sbin/rmmod systemtap_test_module$n} + } +} + +proc build_modules {} { + foreach n {1 2} { + exec cp makefile$n Makefile + if {[catch {exec make clean} res]} { + puts $res + return 0 + } + catch {exec make} res + if {![file exists systemtap_test_module$n.ko]} { + puts $res + return 0 + } + if {[catch {exec sudo cp systemtap_test_module$n.ko /lib/modules/$::uname} res]} { + puts $res + return 0 + } + } + foreach n {2 1} { + catch {exec sudo /sbin/insmod systemtap_test_module$n.ko} + } + return 1 +} + +# first build the modules +cd $srcdir/$subdir +set uname [exec /bin/uname -r] + +if {[build_modules] == 0} { + puts "BUILD FAILED" + foreach test $testlist { + fail "$test - could not build modules" + } + return +} + +foreach test $testlist { + source $test.tcl +} + + + + |