diff options
author | Dave Brolley <brolley@redhat.com> | 2009-02-20 16:58:57 -0500 |
---|---|---|
committer | Dave Brolley <brolley@redhat.com> | 2009-02-20 16:58:57 -0500 |
commit | e26df1cb46bf61450a3e9569cd892c91fd52c0a7 (patch) | |
tree | b38521375256620056dc4935ac7782b8feaff5a5 /testsuite/lib/systemtap.exp | |
parent | e1d8e378730ccff8491104575913a4943e9427a8 (diff) | |
download | systemtap-steved-e26df1cb46bf61450a3e9569cd892c91fd52c0a7.tar.gz systemtap-steved-e26df1cb46bf61450a3e9569cd892c91fd52c0a7.tar.xz systemtap-steved-e26df1cb46bf61450a3e9569cd892c91fd52c0a7.zip |
Check for required resources and tools before attempting tests using the client/server.
Ensure that tests run with/without the server have unique names.
Diffstat (limited to 'testsuite/lib/systemtap.exp')
-rw-r--r-- | testsuite/lib/systemtap.exp | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/testsuite/lib/systemtap.exp b/testsuite/lib/systemtap.exp index 9dea8a89..c80ad171 100644 --- a/testsuite/lib/systemtap.exp +++ b/testsuite/lib/systemtap.exp @@ -53,7 +53,9 @@ proc setup_systemtap_environment {} { # Find or start a systemtap server, if requested. if {[use_server_p]} then { - setup_server + if {! [setup_server]} then { + return 0 + } } # PATH, SYSTEMTAP_TAPSET, SYSTEMTAP_RUNTIME, LD_LIBRARY_PATH are already set. @@ -62,6 +64,8 @@ proc setup_systemtap_environment {} { verbose -log "env $var = $env($var)" } } + + return 1 } # Set up the environment so that tests will be performed using the systemtap @@ -69,6 +73,21 @@ proc setup_systemtap_environment {} { proc setup_server {} { global srcdir env server_pid net_path + # 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 { + print "Unable to start a server: stap-client-connect is not found in PATH" + return 0 + } + } elseif {! [file exists [exec pwd]/../stap-client-connect]} then { + 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 { + print "Unable to start a server: avahi-publish-service is not found in PATH" + return 0 + } + print "Testing using a systemtap server" # A place for some temporary files and scripts. @@ -87,7 +106,7 @@ proc setup_server {} { if { "$server_pid" == "-1" } then { print "Cannot find or start a systemtap server" set server_pid 0 - # TODO: How do we abort here? + return 0 } elseif { "$server_pid" == "0" } then { print "A compatible systemtap server is already available" } else { @@ -103,6 +122,8 @@ proc setup_server {} { exec /bin/cp -p $srcdir/../stap-client $net_path/stap } set env(PATH) "$net_path:$env(PATH)" + + return 1 } proc shutdown_server {} { @@ -136,7 +157,10 @@ proc get_system_info {} { if [file exists /etc/debian_version] {set Distro [exec /bin/cat /etc/debian_version]} } -setup_systemtap_environment +if {! [setup_systemtap_environment]} then { + return 0 +} + print_systemtap_version get_system_info |