From 00220bfcf73ff9237f274cfac6900a46c4615157 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Diemer?= <stephane.diemer@ubicast.eu> Date: Tue, 14 Mar 2017 09:48:08 +0100 Subject: [PATCH] Changed instances selections for tests (refs #20760). --- global-conf.sh | 6 ++++++ tester.py | 25 ++++++++++++++++++++++--- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/global-conf.sh b/global-conf.sh index 43f61e8e..4f45bd45 100644 --- a/global-conf.sh +++ b/global-conf.sh @@ -109,6 +109,12 @@ HA_LB1_IP='192.168.41.177' HA_LB2= 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 # ------------------------------- diff --git a/tester.py b/tester.py index 0ae89ed4..aab1d99c 100755 --- a/tester.py +++ b/tester.py @@ -49,7 +49,6 @@ class Tester(): VALID_ARGS = ['-e', '-f', '-b', '-d', '-h'] MAX_LOG_FILES = 50 NO_MAIL_FAILURES_COUNT = 30 - MAX_INSTANCES = 2 def __init__(self, *args): log('\033[96m-------------------------------\033[0m') @@ -148,8 +147,28 @@ class Tester(): ms_users.append(user) # Get MediaServer tests if ms_users: - if len(ms_users) > self.MAX_INSTANCES: - ms_users = ms_users[:self.MAX_INSTANCES] + ms_users.sort() + 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 ms_path = os.path.join(path, 'ms-testing-suite') if os.path.exists(ms_path): -- GitLab