From a70a69bd47f2b0c7e8e4e99b7a630ebbedc5f264 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Tue, 10 Feb 2009 16:18:29 -0500 Subject: Move crash.exp and crash.sh to systemtap.base directory. --- testsuite/ChangeLog | 5 ++++ testsuite/systemtap.base/crash.exp | 45 +++++++++++++++++++++++++++++++++++ testsuite/systemtap.base/crash.sh | 8 +++++++ testsuite/systemtap.samples/crash.exp | 45 ----------------------------------- testsuite/systemtap.samples/crash.sh | 8 ------- 5 files changed, 58 insertions(+), 53 deletions(-) create mode 100644 testsuite/systemtap.base/crash.exp create mode 100755 testsuite/systemtap.base/crash.sh delete mode 100644 testsuite/systemtap.samples/crash.exp delete mode 100755 testsuite/systemtap.samples/crash.sh (limited to 'testsuite') diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index 8ac6d698..19d4fced 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-02-10 Will Cohen + + * systemtap.samples/crash.exp: + * systemtap.samples/crash.sh: Move to systemtap.base directory. + 2009-02-09 Will Cohen * systemtap.samples/poll_map.exp: diff --git a/testsuite/systemtap.base/crash.exp b/testsuite/systemtap.base/crash.exp new file mode 100644 index 00000000..9c3e5e05 --- /dev/null +++ b/testsuite/systemtap.base/crash.exp @@ -0,0 +1,45 @@ +# Simple test for staplog.so crash(8) extension +set test "crash" + +if {![installtest_p]} { untested $test; return } +if {![file exists $env(CRASH_LIBDIR)/staplog.so]} { untested "$test - no staplog.so"; return } + +# Load a test script +spawn stap $srcdir/$subdir/testlog.stp -m testlog +expect { + -timeout 120 + "HelloWorld\r\n" { + pass "$test - testlog.stp" + # Need to run crash(8) while this script is still running. + # Since crash(8) needs /dev/mem access, need it run as_root too. + # This [ eval ... \{ \} ] business is necessary because as_root + # evals the given list/variables in its own scope. + eval as_root \{ $srcdir/$subdir/crash.sh $env(CRASH_LIBDIR) \} + } + timeout { fail "$test - testlog.stp timeout" } + timeout { fail "$test - testlog.stp eof" } +} +catch { exec kill -INT -[exp_pid]; close ; wait } + +# The crash(8) script creates testlog/global or testlog/cpu +as_root { chmod -R a+rX testlog } + +set ok 0 +foreach f [glob -nocomplain testlog/*] { + pass "$test - crash(8) generated $f" + set fp [open $f] + set chars [read $fp] + close $fp + if [string match "HelloWorld*" $chars] { + incr ok + pass "$test - crash(8) data" + } else { + fail "$test - crash(8) data $chars" + } +} +if {$ok == 0} { + fail "$test - crash(8) data" +} + +as_root { rm -rf testlog testlog.ko } + diff --git a/testsuite/systemtap.base/crash.sh b/testsuite/systemtap.base/crash.sh new file mode 100755 index 00000000..06aa414e --- /dev/null +++ b/testsuite/systemtap.base/crash.sh @@ -0,0 +1,8 @@ +#! /bin/sh + +crash --readnow << END +mod -s testlog testlog.ko +extend $1/staplog.so +staplog testlog +exit +END diff --git a/testsuite/systemtap.samples/crash.exp b/testsuite/systemtap.samples/crash.exp deleted file mode 100644 index 9c3e5e05..00000000 --- a/testsuite/systemtap.samples/crash.exp +++ /dev/null @@ -1,45 +0,0 @@ -# Simple test for staplog.so crash(8) extension -set test "crash" - -if {![installtest_p]} { untested $test; return } -if {![file exists $env(CRASH_LIBDIR)/staplog.so]} { untested "$test - no staplog.so"; return } - -# Load a test script -spawn stap $srcdir/$subdir/testlog.stp -m testlog -expect { - -timeout 120 - "HelloWorld\r\n" { - pass "$test - testlog.stp" - # Need to run crash(8) while this script is still running. - # Since crash(8) needs /dev/mem access, need it run as_root too. - # This [ eval ... \{ \} ] business is necessary because as_root - # evals the given list/variables in its own scope. - eval as_root \{ $srcdir/$subdir/crash.sh $env(CRASH_LIBDIR) \} - } - timeout { fail "$test - testlog.stp timeout" } - timeout { fail "$test - testlog.stp eof" } -} -catch { exec kill -INT -[exp_pid]; close ; wait } - -# The crash(8) script creates testlog/global or testlog/cpu -as_root { chmod -R a+rX testlog } - -set ok 0 -foreach f [glob -nocomplain testlog/*] { - pass "$test - crash(8) generated $f" - set fp [open $f] - set chars [read $fp] - close $fp - if [string match "HelloWorld*" $chars] { - incr ok - pass "$test - crash(8) data" - } else { - fail "$test - crash(8) data $chars" - } -} -if {$ok == 0} { - fail "$test - crash(8) data" -} - -as_root { rm -rf testlog testlog.ko } - diff --git a/testsuite/systemtap.samples/crash.sh b/testsuite/systemtap.samples/crash.sh deleted file mode 100755 index 06aa414e..00000000 --- a/testsuite/systemtap.samples/crash.sh +++ /dev/null @@ -1,8 +0,0 @@ -#! /bin/sh - -crash --readnow << END -mod -s testlog testlog.ko -extend $1/staplog.so -staplog testlog -exit -END -- cgit