From fe053a9882317f9823d68a9b2216d521d47016a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Diemer?= <stephane.diemer@ubicast.eu> Date: Wed, 1 Mar 2017 08:59:54 +0100 Subject: [PATCH] Run mediaworker test only on MS systems. --- tests/test_mediaworker.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/test_mediaworker.py b/tests/test_mediaworker.py index 2d8f0aad..cd4ec950 100755 --- a/tests/test_mediaworker.py +++ b/tests/test_mediaworker.py @@ -13,6 +13,16 @@ GREEN = '\033[92m' RED = '\033[91m' DEF = '\033[0m' + +try: + import mediaserver +except ImportError: + print('MediaServer is not installed, skipping test') + sys.exit(2) +else: + print('MediaServer version: %s' % mediaserver.__version__) + + os.chdir(os.path.dirname(__file__)) if not os.path.isfile('../utils.py'): print('conf.sh not found') @@ -21,6 +31,7 @@ if not os.path.isfile('../utils.py'): es_utils = imp.load_source('es_utils', '../utils.py') conf = es_utils.load_conf() + def check_ssh(ip): cmd = 'ssh -o StrictHostKeyChecking=no -o PasswordAuthentication=no %s ls /tmp' % ip print('Connecting to MediaWorker: %s' % cmd) @@ -32,6 +43,7 @@ def check_ssh(ip): return False return True + def run_tests(ip): print('Updating envsetup tests on MediaWorker') cmd = 'ssh -t %s cd /root/envsetup && git pull' % ip @@ -47,6 +59,7 @@ def run_tests(ip): print('%apt-get update failed on MediaWorker%s' % (RED, DEF)) return False + def check_celerity_connectivity(ip): h = conf.get('MS_SERVER_NAME') cmd = "ssh %s curl -k https://%s:6200" % (ip, h) -- GitLab