diff options
Diffstat (limited to 'testsuite/lib/systemtap.exp')
-rw-r--r-- | testsuite/lib/systemtap.exp | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/testsuite/lib/systemtap.exp b/testsuite/lib/systemtap.exp index c80ad171..379f6c58 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" @@ -75,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 } @@ -83,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 } @@ -99,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. @@ -118,8 +129,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)" @@ -148,13 +161,18 @@ 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" - 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]} + 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 } + } + } } if {! [setup_systemtap_environment]} then { |