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

Start MS tests if MS is present (refs #19907).

parent 9a07ceb2
No related branches found
No related tags found
No related merge requests found
......@@ -35,8 +35,7 @@ sys.stderr = sys.stdout
class Tester():
USAGE = '''%s [-ms] [-e] [-d] [-h]
-ms: run MediaServer tests in addition of standard tests.
USAGE = '''%s [-e] [-d] [-h]
-e: send email with report.
-d: debug mode (can be started with non root users).
-h: show this message.''' % __file__
......@@ -71,8 +70,7 @@ class Tester():
sys.exit(1)
# Check for email value
email = '-e' in args
ms = '-ms' in args
tests = self.discover_tests(ms)
tests = self.discover_tests()
if not tests:
sys.exit(1)
exit_code = self.run_tests(tests, email)
......@@ -99,7 +97,7 @@ class Tester():
break
return description.strip()
def discover_tests(self, ms=False):
def discover_tests(self):
tests = list()
# Get standard tests
path = os.path.join(self.root_dir, 'tests')
......@@ -116,8 +114,13 @@ class Tester():
if os.path.isfile(test_path):
description = self.get_file_description(test_path)
tests.append((name, description, [test_path]))
# Get MS instances
ms_users = list()
for user in os.listdir('/home'):
if os.path.exists('/home/%s/msinstance' % user):
ms_users.append(user)
# Get MediaServer tests
if ms:
if ms_users:
# Clone testing suite
ms_path = os.path.join(path, 'ms-testing-suite')
if os.path.exists(ms_path):
......@@ -128,20 +131,15 @@ class Tester():
else:
log('Cloning ms-testing-suite in "%s".' % ms_path)
subprocess.check_call(['git', 'clone', 'https://git.ubicast.net/mediaserver/ms-testing-suite.git', ms_path])
ms_tests = ['ms_vod_tester.py']
# Get MS instances
users = list()
for user in os.listdir('/home'):
if os.path.exists('/home/%s/msinstance' % user):
users.append(user)
# check that Wowza is installed
wowza_dir = '/usr/local/WowzaStreamingEngine'
if not os.path.exists(wowza_dir):
log('Wowza is not installed ("%s" does not exist), the live test will not be run.' % wowza_dir)
else:
ms_tests.append('ms_live_tester.py')
# Add tests to list
for user in users:
wowza_dir = '/usr/local/WowzaStreamingEngine'
etc_lives_conf = '/etc/mediaserver/lives_conf.py'
local_lives_conf = '/home/%s/msinstance/conf/lives_conf.py'
for user in ms_users:
ms_tests = ['ms_vod_tester.py']
# Check if live tests should be started
if os.path.exists(wowza_dir) or os.path.exists(etc_lives_conf) or os.path.exists(local_lives_conf % user):
ms_tests.append('ms_live_tester.py')
for name in ms_tests:
test_path = os.path.join(ms_path, name)
description = self.get_file_description(test_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