proc setup_systemtap_environment {} {
- global srcdir env server_pid net_path
+ global srcdir env server_pid net_path logfile
# need an absolute SRCDIR for the top-level src/ tree
# XXX: or, we could change nearby uses of ${SRCDIR}/testsuite to ${SRCDIR}
# make check and sudo make check don't clobber each other.
set env(SYSTEMTAP_DIR) [exec pwd]/.systemtap-[exec whoami]
+ # Start with fresh server certificates
+ exec rm -fr $env(SYSTEMTAP_DIR)/ssl
+
+ # Erase the old server log file.
+ set logfile "[exec pwd]/server.log"
+ if {[file exists $logfile]} then {
+ exec rm -f $logfile;
+ }
+ # Create a new one and make sure it's world writable.
+ exec touch $logfile
+ exec chmod 666 $logfile
+
# Start a systemtap server, if requested.
set net_path ""
set server_pid 0
# Set up the environment so that tests will be performed using the systemtap
# client and server.
proc setup_server {} {
- global srcdir env net_path installed_stap
+ global srcdir env net_path installed_stap logfile
# Make sure that the necessary resources are available to run the client/server.
if {[catch {exec /usr/bin/which avahi-publish-service} dummy]} then {
verbose -log "Unable to automatically find the systemtap server -- check firewall settings for mDNS"
# Try to discover the port the server is listening on from the server
# log.
- set res [catch { exec /bin/cat [exec pwd]/server.log | awk "/^Systemtap Compile Server on port .* ready/ {print \$6}" } server_port]
+ set res [catch { exec /bin/cat $logfile | awk "/^Systemtap Compile Server on port .* ready/ {print \$6}" } server_port]
if {$res != 0} then {
verbose -log "Unable to discover the port used by the systemtap server"
shutdown_server
}
proc start_server {} {
- global srcdir env server_pid installed_stap
+ global srcdir env server_pid installed_stap logfile
# Server management scripts and data are installed if this is an
# install test, otherwise there is some setup to do.
set env(SYSTEMTAP_SERVER_SCRIPTS) $env(PKGLIBDIR)
}
- # Erase the old server log file.
- set logfile "[exec pwd]/server.log"
- if {[file exists $logfile]} then {
- exec rm -f $logfile;
- }
- # Create a new one and make sure it's world writable.
- exec touch $logfile
- exec chmod 666 $logfile
-
- # Start with fresh server certificates
- exec rm -fr $env(SYSTEMTAP_DIR)/ssl
-
# Try to start the server.
set status 0
if {[catch {exec env STAP_PR11197_OVERRIDE=1 \