From fafd79e3a65854c8e7b3c0048e044af9741a0fff Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Fri, 13 Mar 2009 14:44:54 +0100 Subject: Introduce stap_run3 for distinct test names. * testsuite/lib/stap_run2.exp: Add stap_run3, called from stap_run2. * testsuite/systemtap.base/sdt.exp: Use stap_run3, for distinct test names. --- testsuite/lib/stap_run2.exp | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'testsuite/lib') diff --git a/testsuite/lib/stap_run2.exp b/testsuite/lib/stap_run2.exp index cb1c6615..b734a1e7 100644 --- a/testsuite/lib/stap_run2.exp +++ b/testsuite/lib/stap_run2.exp @@ -10,12 +10,27 @@ proc stap_run2 { TEST_NAME args } { # zap the srcdir prefix - set test_file_name $TEST_NAME + set TEST_FILE $TEST_NAME set TEST_NAME [regsub {.*/testsuite/} $TEST_NAME ""] - + if {[llength $args] == 0} { + stap_run3 $TEST_NAME $TEST_FILE + } else { + stap_run3 $TEST_NAME $TEST_FILE $args + } +} + +# stap_run3 TEST_NAME TEST_FILE +# TEST_NAME is the name of the test as shown in PASS/FAIL/SKIPPED messages. +# TEST_FILE is the path to the current test +# Additional arguments are passed to stap as-is. +# +# global result_string must be set to the expected output + +proc stap_run3 { TEST_NAME TEST_FILE args } { if {[info procs installtest_p] != "" && ![installtest_p]} { untested $TEST_NAME; return } - - set cmd [concat stap $args $test_file_name] + + set cmd [concat stap $args $TEST_FILE] + send_log "executing: $cmd\n" catch {eval exec $cmd} res set n 0 -- cgit From 67af0ab2fac61cce5a9a271c385939b5a8c77f87 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Wed, 18 Mar 2009 11:32:36 +0100 Subject: Make stap_run send_log of command to execute. * testsuite/lib/stap_run.exp (tap_run): Add send_log of cmd. --- testsuite/lib/stap_run.exp | 1 + 1 file changed, 1 insertion(+) (limited to 'testsuite/lib') diff --git a/testsuite/lib/stap_run.exp b/testsuite/lib/stap_run.exp index a4beaa12..3043eeed 100644 --- a/testsuite/lib/stap_run.exp +++ b/testsuite/lib/stap_run.exp @@ -30,6 +30,7 @@ proc stap_run { TEST_NAME {LOAD_GEN_FUNCTION ""} {OUTPUT_CHECK_STRING ""} args } if [file readable $test_file_name] { lappend cmd $test_file_name } + send_log "executing: $cmd\n" eval spawn $cmd expect { -timeout 180 -- cgit From a99eea4f68db917268b83ab75574c832b646bd65 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Sat, 21 Mar 2009 08:39:57 -0400 Subject: sdt.exp: save intermediate sdt.h-client executables for analysis * testsuite/lib/stap_run2.exp (stap_run3): Put supplied stap extra arguments after the .stp script name, not before, so that @1/such arguments can be substituted within. --- testsuite/lib/stap_run2.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'testsuite/lib') diff --git a/testsuite/lib/stap_run2.exp b/testsuite/lib/stap_run2.exp index b734a1e7..d1f02c83 100644 --- a/testsuite/lib/stap_run2.exp +++ b/testsuite/lib/stap_run2.exp @@ -29,7 +29,7 @@ proc stap_run2 { TEST_NAME args } { proc stap_run3 { TEST_NAME TEST_FILE args } { if {[info procs installtest_p] != "" && ![installtest_p]} { untested $TEST_NAME; return } - set cmd [concat stap $args $TEST_FILE] + set cmd [concat stap $TEST_FILE $args] send_log "executing: $cmd\n" catch {eval exec $cmd} res -- cgit From 23d89280bdf6bf4c341478eb766dba9d4f395708 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Sun, 29 Mar 2009 15:57:11 -0400 Subject: tweak "Distro:" line generation in testsuite logs, to moot "oracle-enterprise.patch" --- testsuite/lib/systemtap.exp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'testsuite/lib') diff --git a/testsuite/lib/systemtap.exp b/testsuite/lib/systemtap.exp index c80ad171..b9db4e40 100644 --- a/testsuite/lib/systemtap.exp +++ b/testsuite/lib/systemtap.exp @@ -151,10 +151,9 @@ proc get_system_info {} { set Snapshot $version } set Distro "Linux" - if [file exists /etc/fedora-release] {set Distro [exec /bin/cat /etc/fedora-release]} - if [file exists /etc/redhat-release] {set Distro [exec /bin/cat /etc/redhat-release]} - if [file exists /etc/suse-release] {set Distro [exec /bin/cat /etc/suse-release]} - if [file exists /etc/debian_version] {set Distro [exec /bin/cat /etc/debian_version]} + foreach f {/etc/fedora-release /etc/enterprise-release /etc/redhat-release /etc/suse-release /etc/debian_version} { + if [file exists $f] then {set Distro [exec /bin/cat $f]; break } + } } if {! [setup_systemtap_environment]} then { -- cgit From 172d72b30e804bda124f26b858f0f3081a561b3c Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Sun, 29 Mar 2009 16:40:13 -0400 Subject: prefer using /usr/bin/lsb_release to deduce distribution for testsuite --- testsuite/lib/systemtap.exp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'testsuite/lib') diff --git a/testsuite/lib/systemtap.exp b/testsuite/lib/systemtap.exp index b9db4e40..554e88ed 100644 --- a/testsuite/lib/systemtap.exp +++ b/testsuite/lib/systemtap.exp @@ -148,11 +148,17 @@ proc get_system_info {} { set Snapshot [exec /bin/cat $env(SRCDIR)/../SNAPSHOT] } else { regexp {version [^)]*} [exec stap -V 2>@ stdout] version - set Snapshot $version + set Snapshot $version } set Distro "Linux" - foreach f {/etc/fedora-release /etc/enterprise-release /etc/redhat-release /etc/suse-release /etc/debian_version} { - if [file exists $f] then {set Distro [exec /bin/cat $f]; break } + if [file exists /usr/bin/lsb_release] { + # this produces one line of this format: + # Distribution:\tSTRING + set Distro [lrange [exec /usr/bin/lsb_release -d] 1 end] + } else { + foreach f {/etc/fedora-release /etc/enterprise-release /etc/redhat-release /etc/suse-release /etc/debian_version} { + if [file exists $f] then {set Distro [exec /bin/cat $f]; break } + } } } -- cgit From 83ff01c2f669c66100a5cf7531dda9410a8ff6ce Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Wed, 1 Apr 2009 20:33:51 -0400 Subject: introduce [utrace_p] as dejagnu check for utrace presence in kernel * testsuite/lib/systemtap.exp: Define here. * testsuite/systemtap.*/*.exp: Use it here. Eliminate duplicated utrace_support_present logic. --- testsuite/lib/systemtap.exp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'testsuite/lib') diff --git a/testsuite/lib/systemtap.exp b/testsuite/lib/systemtap.exp index 554e88ed..5311be7b 100644 --- a/testsuite/lib/systemtap.exp +++ b/testsuite/lib/systemtap.exp @@ -16,6 +16,16 @@ proc use_server_p {} { } +proc utrace_p {} { + set path "/proc/kallsyms" + if {! [catch {exec grep -q utrace_attach $path} dummy]} { + return 1 + } else { + return 0 + } +} + + proc print_systemtap_version {} { set version [exec /bin/uname -r] set location "/boot/vmlinux-$version" -- cgit From 0af51b594e033a9d7148be6428f7365f2fcd1663 Mon Sep 17 00:00:00 2001 From: David Smith Date: Wed, 8 Apr 2009 15:31:49 -0500 Subject: Better error handling in 'setup_server'. 2009-04-08 David Smith * lib/systemtap.exp (setup_server): Better error handling. --- testsuite/lib/systemtap.exp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'testsuite/lib') diff --git a/testsuite/lib/systemtap.exp b/testsuite/lib/systemtap.exp index 5311be7b..98108fa5 100644 --- a/testsuite/lib/systemtap.exp +++ b/testsuite/lib/systemtap.exp @@ -85,7 +85,7 @@ proc setup_server {} { # Make sure that the necessary resources are available to run the client/server. if {[installtest_p]} then { - if {[exec /usr/bin/which stap-client-connect] == ""} then { + if {[catch {exec /usr/bin/which stap-client-connect} dummy]} then { print "Unable to start a server: stap-client-connect is not found in PATH" return 0 } @@ -93,7 +93,7 @@ proc setup_server {} { print "Unable to start a server: [exec pwd]/../stap-client-connect is not found" return 0 } - if {[exec /usr/bin/which avahi-publish-service] == ""} then { + if {[catch {exec /usr/bin/which avahi-publish-service} dummy]} then { print "Unable to start a server: avahi-publish-service is not found in PATH" return 0 } -- cgit From 2035bcd40b17832439df0a1eb28403b99a71b74f Mon Sep 17 00:00:00 2001 From: Dave Brolley Date: Mon, 4 May 2009 16:05:22 -0400 Subject: Module signing and verification using a separate file for the module signature. --- testsuite/lib/systemtap.exp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'testsuite/lib') diff --git a/testsuite/lib/systemtap.exp b/testsuite/lib/systemtap.exp index 98108fa5..019b1bf8 100644 --- a/testsuite/lib/systemtap.exp +++ b/testsuite/lib/systemtap.exp @@ -128,8 +128,10 @@ proc setup_server {} { # The server does not call this instance of 'stap' if {[installtest_p]} then { exec /bin/cp -p [exec which stap-client] $net_path/stap + exec /bin/cp -p [exec which stap-env] $net_path/stap-env } else { exec /bin/cp -p $srcdir/../stap-client $net_path/stap + exec /bin/cp -p $srcdir/../stap-env $net_path/stap-env } set env(PATH) "$net_path:$env(PATH)" -- cgit From 67c7a9ac91ea3de5cadb7c90028365fdac1f530f Mon Sep 17 00:00:00 2001 From: Dave Brolley Date: Wed, 6 May 2009 13:52:52 -0400 Subject: Problems using server scripts when not on PATH. HAVE_NSS related compile time warning. --- testsuite/lib/systemtap.exp | 1 + 1 file changed, 1 insertion(+) (limited to 'testsuite/lib') diff --git a/testsuite/lib/systemtap.exp b/testsuite/lib/systemtap.exp index 019b1bf8..379f6c58 100644 --- a/testsuite/lib/systemtap.exp +++ b/testsuite/lib/systemtap.exp @@ -109,6 +109,7 @@ proc setup_server {} { if {! [installtest_p]} then { # Make sure the server management scripts and tools are on the $PATH. set env(PATH) "$srcdir/..:[exec pwd]/..:$env(PATH)" + set env(SYSTEMTAP_SERVER_SCRIPTS) "$srcdir/.." } # Try to find or start the server. -- cgit