Index: /main/waeup.stress/trunk/kofa01/pre_run.py
===================================================================
--- /main/waeup.stress/trunk/kofa01/pre_run.py	(revision 8674)
+++ /main/waeup.stress/trunk/kofa01/pre_run.py	(revision 8675)
@@ -1,9 +1,18 @@
+"""Script run before tests start.
+
+This script is run with some additional globals set:
+
+- project_name: The name of this project (dir)
+- cmd_opts: Commandline args from stress-run invocation
+  Includes the stresstest-project directory.
+- cfg_opts: options as set in local config.cfg.
+
+Context Python is normally the version used when running bootstrap on
+the waeup.stress package.
+"""
 import waeup.stress
 
-print "RUN SETUP"
-
-instance='kofa'
-
-waeup.stress.configure()
+instance=cfg_opts['instance']
+print "PRE-RUN.PY: using instance: waeup.%s" % instance
 
 ## removes any existing ZODB (for a clean ZODB at start)
@@ -15,7 +24,6 @@
 ## starts an instance as daemon
 waeup.stress.start_instance(instance)
-waeup.stress.wait_for_startup('localhost', 8080) # wait until daemon is up
-## after starting an instance, we have to wait for the instance to come up
-#time.sleep(3)
+## wait for instance to come up
+waeup.stress.wait_for_startup(cfg_opts['host'], int(cfg_opts['baseport']))
 
 ## we need a running instance, so leave this commented out.
