Last change
on this file since 11300 was
8681,
checked in by uli, 13 years ago
|
Consider instance mode when starting/stopping instances.
|
File size:
1003 bytes
|
Rev | Line | |
---|
[8675] | 1 | """Script run before tests start. |
---|
[8672] | 2 | |
---|
[8675] | 3 | This script is run with some additional globals set: |
---|
[8672] | 4 | |
---|
[8675] | 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. |
---|
[8672] | 9 | |
---|
[8675] | 10 | Context Python is normally the version used when running bootstrap on |
---|
| 11 | the waeup.stress package. |
---|
| 12 | """ |
---|
| 13 | import waeup.stress |
---|
[8672] | 14 | |
---|
[8675] | 15 | instance=cfg_opts['instance'] |
---|
[8681] | 16 | mode = cfg_opts['instance_mode'] |
---|
| 17 | |
---|
[8675] | 18 | print "PRE-RUN.PY: using instance: waeup.%s" % instance |
---|
| 19 | |
---|
[8672] | 20 | ## removes any existing ZODB (for a clean ZODB at start) |
---|
| 21 | waeup.stress.remove_zodb(instance) |
---|
| 22 | |
---|
| 23 | ## installs a University named 'stress_app' in root folder |
---|
| 24 | waeup.stress.install_app(instance) |
---|
| 25 | |
---|
| 26 | ## starts an instance as daemon |
---|
[8681] | 27 | waeup.stress.start_instance(instance, mode=mode) |
---|
[8675] | 28 | ## wait for instance to come up |
---|
| 29 | waeup.stress.wait_for_startup(cfg_opts['host'], int(cfg_opts['baseport'])) |
---|
[8672] | 30 | |
---|
| 31 | ## we need a running instance, so leave this commented out. |
---|
| 32 | #waeup.stress.stop_instance(instance) |
---|
Note: See
TracBrowser for help on using the repository browser.