diff options
author | hunt <hunt> | 2006-10-27 19:06:02 +0000 |
---|---|---|
committer | hunt <hunt> | 2006-10-27 19:06:02 +0000 |
commit | 29aec74d4af5df8f1d5caa699ca4d35659f51a29 (patch) | |
tree | 0083f31e56f9d99cdf262ad800661073175f2377 | |
parent | 68e7e59b32783bc9a40cddecbfdf6a19ba0d8e42 (diff) | |
download | systemtap-steved-29aec74d4af5df8f1d5caa699ca4d35659f51a29.tar.gz systemtap-steved-29aec74d4af5df8f1d5caa699ca4d35659f51a29.tar.xz systemtap-steved-29aec74d4af5df8f1d5caa699ca4d35659f51a29.zip |
2006-10-27 Martin Hunt <hunt@redhat.com>
* test.exp, test.tcl: Remove our own caching code
and just use systemtap's new caching.
* acct.c (main): Make pattern less selective so
it works when run by root.
-rw-r--r-- | testsuite/systemtap.syscall/ChangeLog | 8 | ||||
-rw-r--r-- | testsuite/systemtap.syscall/acct.c | 2 | ||||
-rw-r--r-- | testsuite/systemtap.syscall/test.exp | 110 | ||||
-rwxr-xr-x | testsuite/systemtap.syscall/test.tcl | 20 |
4 files changed, 54 insertions, 86 deletions
diff --git a/testsuite/systemtap.syscall/ChangeLog b/testsuite/systemtap.syscall/ChangeLog index 9a4afdad..d639b06d 100644 --- a/testsuite/systemtap.syscall/ChangeLog +++ b/testsuite/systemtap.syscall/ChangeLog @@ -1,3 +1,11 @@ +2006-10-27 Martin Hunt <hunt@redhat.com> + + * test.exp, test.tcl: Remove our own caching code + and just use systemtap's new caching. + + * acct.c (main): Make pattern less selective so + it works when run by root. + 2006-10-23 David Smith <dsmith@redhat.com> * test.exp (test_procedure): Handles cached module. diff --git a/testsuite/systemtap.syscall/acct.c b/testsuite/systemtap.syscall/acct.c index ec392793..927e40c9 100644 --- a/testsuite/systemtap.syscall/acct.c +++ b/testsuite/systemtap.syscall/acct.c @@ -4,7 +4,7 @@ int main() { acct("foobar"); - // acct ("foobar") = -NNNN (EPERM) + // acct ("foobar") = -NNNN return 0; } diff --git a/testsuite/systemtap.syscall/test.exp b/testsuite/systemtap.syscall/test.exp index d457e125..8de1574a 100644 --- a/testsuite/systemtap.syscall/test.exp +++ b/testsuite/systemtap.syscall/test.exp @@ -1,72 +1,48 @@ proc test_procedure {} { -global subdir -if {$subdir != ""} { - cd $subdir -} - -# compile sys.stp and keep it -catch {exec stap -kvvp4 sys.stp} res1 -set path "" -regexp {Keeping temporary directory "([^\"]*)"} $res1 match path -if {$path == ""} { - send_log "ERROR:\n$res1\n" - fail "ERROR:\n$res1\n" - return -1 -} -foreach line [split $res1 \n] { - if {[regexp {Pass 4: compiled C into "([^\"]*)"} $line match module]} { - break - } - if {[regexp {Pass 4: using cached /.*/(stap_[0-9a-f_]*.ko)} $line match module]} { - break - } -} - -if {![info exists module]} { - send_log "Compiling sys.stp failed:\n$res1\n" - fail "Compiling sys.stp failed:\n$res1\n" - return -1 -} - -set flags "" -foreach filename [lsort [glob *.c]] { - set file [string range $filename 0 end-2] - target_compile $filename $file executable $flags - send_log "Testing ${file}\n" - set res [exec ./test.tcl $file $path/$module] - if {$res == "PASS"} { - pass "$file" - } elseif {$res == "UNSUPP"} { - unsupported "$file not supported on this arch" - } else { - fail "$file" - send_log "$res\n" - } -} - -if {$::tcl_platform(machine) == "x86_64"} { - # on x86_64, test 32-bit and 64-bit binaries - set flags "additional_flags=-m32" - foreach filename [lsort [glob *.c]] { - set file [string range $filename 0 end-2] - target_compile $filename $file executable $flags - send_log "Testing 32-bit ${file}\n" - set res [exec ./test.tcl $file $path/$module] - if {$res == "PASS"} { - pass "32-bit $file" - } elseif {$res == "UNSUPP"} { - unsupported "$file not supported on this arch" - } else { - fail "32-bit $file" - send_log "$res\n" + global subdir + if {$subdir != ""} { + cd $subdir + } + + + set flags "" + foreach filename [lsort [glob *.c]] { + set file [string range $filename 0 end-2] + target_compile $filename $file executable $flags + send_log "Testing ${file}\n" + set res [exec ./test.tcl $file] + if {$res == "PASS"} { + pass "$file" + } elseif {$res == "UNSUPP"} { + unsupported "$file not supported on this arch" + } else { + fail "$file" + send_log "$res\n" + } + } + + if {$::tcl_platform(machine) == "x86_64"} { + # on x86_64, test 32-bit and 64-bit binaries + set flags "additional_flags=-m32" + foreach filename [lsort [glob *.c]] { + set file [string range $filename 0 end-2] + target_compile $filename $file executable $flags + send_log "Testing 32-bit ${file}\n" + set res [exec ./test.tcl $file] + if {$res == "PASS"} { + pass "32-bit $file" + } elseif {$res == "UNSUPP"} { + unsupported "$file not supported on this arch" + } else { + fail "32-bit $file" + send_log "$res\n" + } + } + } + + if {$subdir != ""} { + cd .. } - } -} - -exec rm -rf $path -if {$subdir != ""} { - cd .. -} } test_procedure diff --git a/testsuite/systemtap.syscall/test.tcl b/testsuite/systemtap.syscall/test.tcl index ee797565..41934da4 100755 --- a/testsuite/systemtap.syscall/test.tcl +++ b/testsuite/systemtap.syscall/test.tcl @@ -14,7 +14,7 @@ proc cleanup {} { } proc usage {progname} { - puts "Usage: $progname testname [modulename]" + puts "Usage: $progname testname" } proc bgerror {error} { @@ -23,29 +23,13 @@ proc bgerror {error} { } trap {cleanup} SIGINT set testname [lindex $argv 0] -set modname [lindex $argv 1] if {$testname == ""} { usage $argv0 exit } set filename "${testname}.c" - -if {$modname == ""} { - set cmd "stap -c ../${testname} ../sys.stp" -} else { - set ccmd "which staprun" - catch {eval exec $ccmd} output - if {[file exists $output]} { - set staprun $output - } else { - puts "staprun not found!" - exit - } - - set user $::tcl_platform(user) - set cmd "sudo $staprun -rmq -u $user -c ../${testname} ${modname}" -} +set cmd "stap -c ../${testname} ../sys.stp" # Extract the expected results # Use the preprocessor so we can ifdef tests in and out |