From d407cd825ba1256513f293f25034111d5b65d797 Mon Sep 17 00:00:00 2001 From: William Lachance Date: Mon, 21 Apr 2014 11:03:51 -0400 Subject: [PATCH] Bug 996862 - Remove use of mozdevice's networktools. r=ahal --- build/mobile/b2gautomation.py | 5 ----- build/mobile/remoteautomation.py | 6 +----- layout/tools/reftest/Makefile.in | 1 + layout/tools/reftest/remotereftest.py | 3 ++- layout/tools/reftest/runreftestb2g.py | 3 ++- testing/mochitest/Makefile.in | 1 + testing/mochitest/runtestsremote.py | 3 ++- 7 files changed, 9 insertions(+), 13 deletions(-) diff --git a/build/mobile/b2gautomation.py b/build/mobile/b2gautomation.py index 189c79775a3b..5d489009c6a2 100644 --- a/build/mobile/b2gautomation.py +++ b/build/mobile/b2gautomation.py @@ -13,7 +13,6 @@ import time import traceback from automation import Automation -from devicemanager import NetworkTools from mozprocess import ProcessHandlerMixin @@ -129,10 +128,6 @@ class B2GRemoteAutomation(Automation): return app, args - def getLanIp(self): - nettools = NetworkTools() - return nettools.getLanIp() - def waitForFinish(self, proc, utilityPath, timeout, maxTime, startTime, debuggerInfo, symbolsPath): """ Wait for tests to finish (as evidenced by a signature string diff --git a/build/mobile/remoteautomation.py b/build/mobile/remoteautomation.py index f4a665e2818b..780b35fb2429 100644 --- a/build/mobile/remoteautomation.py +++ b/build/mobile/remoteautomation.py @@ -10,7 +10,7 @@ import shutil import subprocess from automation import Automation -from devicemanager import NetworkTools, DMError +from devicemanager import DMError import mozcrash # signatures for logcat messages that we don't care about much @@ -175,10 +175,6 @@ class RemoteAutomation(Automation): # return app, ['--environ:NO_EM_RESTART=1'] + args return app, args - def getLanIp(self): - nettools = NetworkTools() - return nettools.getLanIp() - def Process(self, cmd, stdout = None, stderr = None, env = None, cwd = None): if stdout == None or stdout == -1 or stdout == subprocess.PIPE: stdout = self._remoteLog diff --git a/layout/tools/reftest/Makefile.in b/layout/tools/reftest/Makefile.in index 31d1b9dbf4c5..358c91651b3f 100644 --- a/layout/tools/reftest/Makefile.in +++ b/layout/tools/reftest/Makefile.in @@ -36,6 +36,7 @@ _HARNESS_FILES = \ $(topsrcdir)/testing/mozbase/mozdevice/mozdevice/devicemanagerSUT.py \ $(topsrcdir)/testing/mozbase/mozdevice/mozdevice/droid.py \ $(topsrcdir)/testing/mozbase/mozdevice/mozdevice/Zeroconf.py \ + $(topsrcdir)/testing/mozbase/moznetwork/moznetwork/moznetwork.py \ $(topsrcdir)/build/mobile/b2gautomation.py \ $(topsrcdir)/build/automationutils.py \ $(topsrcdir)/build/mobile/remoteautomation.py \ diff --git a/layout/tools/reftest/remotereftest.py b/layout/tools/reftest/remotereftest.py index d733e0dd3047..1d90db552481 100644 --- a/layout/tools/reftest/remotereftest.py +++ b/layout/tools/reftest/remotereftest.py @@ -16,6 +16,7 @@ from runreftest import ReftestOptions from automation import Automation import devicemanager import droid +import moznetwork from remoteautomation import RemoteAutomation, fennecLogcatFilters class RemoteOptions(ReftestOptions): @@ -53,7 +54,7 @@ class RemoteOptions(ReftestOptions): self.add_option("--remote-webserver", action="store", type = "string", dest = "remoteWebServer", help = "IP Address of the webserver hosting the reftest content") - defaults["remoteWebServer"] = automation.getLanIp() + defaults["remoteWebServer"] = moznetwork.get_ip() self.add_option("--http-port", action = "store", type = "string", dest = "httpPort", diff --git a/layout/tools/reftest/runreftestb2g.py b/layout/tools/reftest/runreftestb2g.py index 7afd72ad699b..34d2054b3bcc 100644 --- a/layout/tools/reftest/runreftestb2g.py +++ b/layout/tools/reftest/runreftestb2g.py @@ -20,6 +20,7 @@ from remotereftest import ReftestServer from mozdevice import DeviceManagerADB, DMError from marionette import Marionette +import moznetwork class B2GOptions(ReftestOptions): @@ -142,7 +143,7 @@ class B2GOptions(ReftestOptions): if options.remoteWebServer == None: if os.name != "nt": - options.remoteWebServer = self.automation.getLanIp() + options.remoteWebServer = moznetwork.get_ip() else: print "ERROR: you must specify a --remote-webserver=\n" return None diff --git a/testing/mochitest/Makefile.in b/testing/mochitest/Makefile.in index 7811cacf6e1b..593205501d72 100644 --- a/testing/mochitest/Makefile.in +++ b/testing/mochitest/Makefile.in @@ -25,6 +25,7 @@ SERV_FILES = \ $(topsrcdir)/testing/mozbase/manifestdestiny/manifestparser/manifestparser.py \ $(topsrcdir)/testing/mozbase/mozdevice/mozdevice/droid.py \ $(topsrcdir)/testing/mozbase/mozdevice/mozdevice/Zeroconf.py \ + $(topsrcdir)/testing/mozbase/moznetwork/moznetwork/moznetwork.py \ $(topsrcdir)/build/automationutils.py \ $(topsrcdir)/build/mobile/remoteautomation.py \ gen_template.pl \ diff --git a/testing/mochitest/runtestsremote.py b/testing/mochitest/runtestsremote.py index a44c88c8873c..31e873a60a4c 100644 --- a/testing/mochitest/runtestsremote.py +++ b/testing/mochitest/runtestsremote.py @@ -25,6 +25,7 @@ import droid import manifestparser import mozinfo import mozlog +import moznetwork SCRIPT_DIR = os.path.abspath(os.path.realpath(os.path.dirname(__file__))) log = mozlog.getLogger('Mochi-Remote') @@ -131,7 +132,7 @@ class RemoteOptions(MochitestOptions): if options.remoteWebServer == None: if os.name != "nt": - options.remoteWebServer = automation.getLanIp() + options.remoteWebServer = moznetwork.get_ip() else: log.error("you must specify a --remote-webserver=") return None