Skip to content
Snippets Groups Projects
Commit 00220bfc authored by Stéphane Diemer's avatar Stéphane Diemer
Browse files

Changed instances selections for tests (refs #20760).

parent 8ae456f2
No related branches found
No related tags found
No related merge requests found
...@@ -109,6 +109,12 @@ HA_LB1_IP='192.168.41.177' ...@@ -109,6 +109,12 @@ HA_LB1_IP='192.168.41.177'
HA_LB2= HA_LB2=
HA_LB2_IP= HA_LB2_IP=
# -- Tester config --
# separate values with commas
TESTER_MS_INSTANCES=
# TESTER_MAX_INSTANCES is ignored if TESTER_MS_INSTANCES is set
TESTER_MAX_INSTANCES=
# Upstream configuration override # Upstream configuration override
# ------------------------------- # -------------------------------
......
...@@ -49,7 +49,6 @@ class Tester(): ...@@ -49,7 +49,6 @@ class Tester():
VALID_ARGS = ['-e', '-f', '-b', '-d', '-h'] VALID_ARGS = ['-e', '-f', '-b', '-d', '-h']
MAX_LOG_FILES = 50 MAX_LOG_FILES = 50
NO_MAIL_FAILURES_COUNT = 30 NO_MAIL_FAILURES_COUNT = 30
MAX_INSTANCES = 2
def __init__(self, *args): def __init__(self, *args):
log('\033[96m-------------------------------\033[0m') log('\033[96m-------------------------------\033[0m')
...@@ -148,8 +147,28 @@ class Tester(): ...@@ -148,8 +147,28 @@ class Tester():
ms_users.append(user) ms_users.append(user)
# Get MediaServer tests # Get MediaServer tests
if ms_users: if ms_users:
if len(ms_users) > self.MAX_INSTANCES: ms_users.sort()
ms_users = ms_users[:self.MAX_INSTANCES] cleaned_list = list()
instances_to_test = utils.get_conf('TESTER_MS_INSTANCES', '').split(',')
if instances_to_test:
for val in instances_to_test:
val = val.strip()
if not val:
continue
if val in ms_users:
cleaned_list.append(val)
else:
log('An inexisting instance has been requested for tests: "%s".' % val)
if cleaned_list:
ms_users = cleaned_list
else:
try:
max_instances = int(utils.get_conf('TESTER_MAX_INSTANCES') or 2)
except Exception as e:
log('TESTER_MAX_INSTANCES has an invalid value: %s' % e)
max_instances = 2
if len(ms_users) > max_instances:
ms_users = ms_users[:max_instances]
# Clone testing suite # Clone testing suite
ms_path = os.path.join(path, 'ms-testing-suite') ms_path = os.path.join(path, 'ms-testing-suite')
if os.path.exists(ms_path): if os.path.exists(ms_path):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment