diff --git a/tests/test_mediaworker.py b/tests/test_mediaworker.py index c300bf56373313bfda7acb41335eb74b8e9fee84..cf20c54b6bdb5329d2384581bd7eed4386018745 100755 --- a/tests/test_mediaworker.py +++ b/tests/test_mediaworker.py @@ -47,6 +47,17 @@ 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 %i curl -k https://%s:6200" % (ip, h) + print('Checking celerity connectivity: %s' % cmd) + d = subprocess.check_output(cmd, shell=True, timeout=5) + if "Celerity tasks server" in d: + print('%sSuccessfully reached tasks server%s' % (GREEN, DEF)) + return True + print('%sFailed to reach tasks server%s' % (RED, DEF)) + return False + all_ok = True worker_ip = conf.get('CELERITY_WORKER_IP') @@ -56,4 +67,7 @@ if worker_ip != '127.0.1.1': else: if not run_tests(worker_ip): all_ok = False + if not check_celerity_connectivity(ip): + all_ok = False + sys.exit(int(not all_ok))