Commit 55d7381c authored by Łukasz Nowak's avatar Łukasz Nowak Committed by Łukasz Nowak

testnode: Allow to pass max_quantity to runComputerPartition

It defaults to MAX_PARTITIONS, but if needed allows the caller to change the
amount of runs, especially in case if fine grained expectations are needed
from instantiation.

/reviewed-on !805
parent b5ef657c
...@@ -319,7 +319,8 @@ class SlapOSControler(object): ...@@ -319,7 +319,8 @@ class SlapOSControler(object):
return status_dict return status_dict
def runComputerPartition(self, config, environment, def runComputerPartition(self, config, environment,
stdout=None, stderr=None, cluster_configuration=None, **kw): stdout=None, stderr=None, cluster_configuration=None,
max_quantity=MAX_PARTITIONS, **kw):
logger.debug("SlapOSControler.runComputerPartition with cluster_config: %r", logger.debug("SlapOSControler.runComputerPartition with cluster_config: %r",
cluster_configuration) cluster_configuration)
for path in self.software_path_list: for path in self.software_path_list:
...@@ -335,7 +336,7 @@ class SlapOSControler(object): ...@@ -335,7 +336,7 @@ class SlapOSControler(object):
# try to run for all partitions as one partition may in theory request another one # try to run for all partitions as one partition may in theory request another one
# this not always is required but curently no way to know how "tree" of partitions # this not always is required but curently no way to know how "tree" of partitions
# may "expand" # may "expand"
for _ in xrange(MAX_PARTITIONS): for _ in xrange(max_quantity):
status_dict = self.spawn(config['slapos_binary'], 'node', 'instance', status_dict = self.spawn(config['slapos_binary'], 'node', 'instance',
'--pidfile', os.path.join(self.instance_root, 'slapos-node.pid'), '--pidfile', os.path.join(self.instance_root, 'slapos-node.pid'),
'--cfg', self.slapos_config, raise_error_if_fail=False, '--cfg', self.slapos_config, raise_error_if_fail=False,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment