Changeset 8675


Ignore:
Timestamp:
11 Jun 2012, 10:40:28 (12 years ago)
Author:
uli
Message:

Clean up sample pre-run script and use values from local .cfg file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.stress/trunk/kofa01/pre_run.py

    r8672 r8675  
     1"""Script run before tests start.
     2
     3This script is run with some additional globals set:
     4
     5- project_name: The name of this project (dir)
     6- cmd_opts: Commandline args from stress-run invocation
     7  Includes the stresstest-project directory.
     8- cfg_opts: options as set in local config.cfg.
     9
     10Context Python is normally the version used when running bootstrap on
     11the waeup.stress package.
     12"""
    113import waeup.stress
    214
    3 print "RUN SETUP"
    4 
    5 instance='kofa'
    6 
    7 waeup.stress.configure()
     15instance=cfg_opts['instance']
     16print "PRE-RUN.PY: using instance: waeup.%s" % instance
    817
    918## removes any existing ZODB (for a clean ZODB at start)
     
    1524## starts an instance as daemon
    1625waeup.stress.start_instance(instance)
    17 waeup.stress.wait_for_startup('localhost', 8080) # wait until daemon is up
    18 ## after starting an instance, we have to wait for the instance to come up
    19 #time.sleep(3)
     26## wait for instance to come up
     27waeup.stress.wait_for_startup(cfg_opts['host'], int(cfg_opts['baseport']))
    2028
    2129## we need a running instance, so leave this commented out.
Note: See TracChangeset for help on using the changeset viewer.