Bug 1320643 - Bind fixture servers to public interface when testing Fennec; r=whimboo
authorAndreas Tolfsen <ato@mozilla.com>
Fri, 02 Dec 2016 19:46:46 +0000
changeset 325362 dc7d74a8a4bad3ca3beca17491775bd3e19b829d
parent 325361 d237751e0dea92a3b033a7b44855238c12c9ce86
child 325363 6b3b26d63719ceeb45c0219f6fb1eb58af3b49d3
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
Bug 1320643 - Bind fixture servers to public interface when testing Fennec; r=whimboo This lets the Android emulator access the fixture servers over a public interface when using the Marionette harness. Unfortunately we cannot use `adb reverse`, which allows one to reverse-forward socket connections from the emulator to the host, because we are not yet using Android 5.0. MozReview-Commit-ID: BGexcDq5aju
--- a/testing/marionette/harness/marionette/runner/base.py
+++ b/testing/marionette/harness/marionette/runner/base.py
@@ -10,16 +10,17 @@ import socket
 import sys
 import time
 import traceback
 import unittest
 from argparse import ArgumentParser
 from copy import deepcopy
 import mozinfo
+import moznetwork
 import mozprofile
 from marionette_driver.marionette import Marionette
 import mozversion
 import serve
 from manifestparser import TestManifest
 from manifestparser.filters import tags
 from moztest.adapters.unit import StructuredTestResult, StructuredTestRunner
@@ -895,17 +896,20 @@ class BaseMarionetteTestRunner(object):
         if self.failed > 0:
             self.logger.info('\nFAILED TESTS\n-------')
             for failed_test in self.failures:
     def start_fixture_servers(self):
         root = self.server_root or os.path.join(os.path.dirname(here), "www")
-        return serve.start(root)
+        if self.appName == "fennec":
+            return serve.start(root, host=moznetwork.get_ip())
+        else:
+            return serve.start(root)
     def add_test(self, test, expected='pass'):
         filepath = os.path.abspath(test)
         if os.path.isdir(filepath):
             for root, dirs, files in os.walk(filepath):
                 for filename in files:
                     if filename.endswith('.ini'):