Module test_ospl :: Class TestScenario
[hide private]
[frames] | no frames]

Class TestScenario

source code

Represents a single test scenario within a test. A scenario has 1 or more Nodes, and an arbitrary number of processes

Instance Methods [hide private]
 
__init__(self, name='', test_run=None, description='') source code
 
check_test_reqs_met(self)
Check the TestScenario requirements can be satisfied by the TestRun it is within.
source code
 
define_process(self, node)
Declare a process to run on the specified Node within this TestScenario
source code
 
get_log_dest_dir(self)
Where the logs need to be copied to
source code
 
get_name(self)
Accessor for the TestScenario name
source code
 
get_next_node(self)
Gets a new node definition from the scenario.
source code
 
get_unique_port(self)
Returns a unique port.
source code
 
get_working_dir(self, node)
Get the default working directory for this scenario on the given Node.
source code
 
lock_and_load(self)
Checks the requirements of the whole TestScenario are met by the TestRun it is within.
source code
 
requires_multiple_nodes(self, min_number=2)
Specify that this test scenario requires a *minimum* number of nodes to do its thing.
source code
Class Variables [hide private]
  LOCALHOST = <test_ospl.TestNode instance at 0x7fcdf88c>
Method Details [hide private]

check_test_reqs_met(self)

source code 

Check the TestScenario requirements can be satisfied by the TestRun it is within.

If it can't it will throw an error and the scenario should be recorded as skipped.

get_next_node(self)

source code 

Gets a new node definition from the scenario. Will be a new node iff the scenario has enough for it to be so.

get_unique_port(self)

source code 

Returns a unique port. Used to make soure Process instances' IPC can be initialised in a non conflicting manner.

get_working_dir(self, node)

source code 

Get the default working directory for this scenario on the given Node. Assumes this scenario directory is under the usual test root and is named as per convention.

lock_and_load(self)

source code 

Checks the requirements of the whole TestScenario are met by the TestRun it is within. Will actually have build and load the test processes in some embedded circumstances if there's no other alternative. Scenario should exit if this does not return True. No changes should be made to the scenario after this.

requires_multiple_nodes(self, min_number=2)

source code 

Specify that this test scenario requires a *minimum* number of nodes to do its thing. The default is 1 i.e. single node. If your test cannot operate at all on one node specify an appropriate higher value. Do *not* specify a higher value just because the test is less meaningful on less. Keep this value as low as possible.