From e551ace597d7d3884b592edc7adc63e8bd3e49b0 Mon Sep 17 00:00:00 2001 From: Malini Das Date: Thu, 6 Jun 2013 11:10:15 -0400 Subject: [PATCH] Bug 823222 - We should check the host/port before running tests, r=mdas --- testing/marionette/client/marionette/runtests.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/testing/marionette/client/marionette/runtests.py b/testing/marionette/client/marionette/runtests.py index 2ac06c8f201..d9b3d197b68 100644 --- a/testing/marionette/client/marionette/runtests.py +++ b/testing/marionette/client/marionette/runtests.py @@ -19,6 +19,7 @@ import xml.dom.minidom as dom from manifestparser import TestManifest from mozhttpd import MozHttpd +from telnetlib import Telnet from marionette import Marionette from marionette_test import MarionetteJSTestCase, MarionetteTestCase @@ -266,7 +267,12 @@ class MarionetteTestRunner(object): timeout=self.timeout) elif self.address: host, port = self.address.split(':') - if self.emulator: + try: + #establish a telnet connection so we can vertify the data come back + tlconnection = Telnet(host, port) + except: + raise Exception("could not connect to given marionette host/port") + if self.emulator: self.marionette = Marionette.getMarionetteOrExit( host=host, port=int(port), connectToRunningEmulator=True,