Bug 1501040 - Raptor fix so unsigned webext will load on mozilla-beta. r=jmaher, a=test-only
authorRob Wood <rwood@mozilla.com>
Thu, 01 Nov 2018 08:43:49 +0000
changeset 501028 560ec5d63826c4a8b510fa08a4510564f575ee2b
parent 501027 cc49be946af968c2091c0d777a0c8b167d72854a
child 501029 cc953fc99e9be4330c20d053af897f264f6a4170
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher, test-only
bugs1501040
milestone64.0
Bug 1501040 - Raptor fix so unsigned webext will load on mozilla-beta. r=jmaher, a=test-only Differential Revision: https://phabricator.services.mozilla.com/D10453
testing/mozharness/mozharness/mozilla/testing/raptor.py
testing/raptor/raptor/raptor.py
--- a/testing/mozharness/mozharness/mozilla/testing/raptor.py
+++ b/testing/mozharness/mozharness/mozilla/testing/raptor.py
@@ -438,16 +438,19 @@ class Raptor(TestingMixin, MercurialScri
 
         # mitmproxy needs path to mozharness when installing the cert, and tooltool
         env['SCRIPTSPATH'] = scripts_path
         env['EXTERNALTOOLSPATH'] = external_tools_path
 
         # disable "GC poisoning" Bug# 1499043
         env['JSGC_DISABLE_POISONING'] = '1'
 
+        # needed to load unsigned raptor webext on moz-beta
+        env['MOZ_DISABLE_NONLOCAL_CONNECTIONS'] = '1'
+
         if self.repo_path is not None:
             env['MOZ_DEVELOPER_REPO_DIR'] = self.repo_path
         if self.obj_path is not None:
             env['MOZ_DEVELOPER_OBJ_DIR'] = self.obj_path
 
         # sets a timeout for how long raptor should run without output
         output_timeout = self.config.get('raptor_output_timeout', 3600)
         # run raptor tests
--- a/testing/raptor/raptor/raptor.py
+++ b/testing/raptor/raptor/raptor.py
@@ -204,16 +204,23 @@ class Raptor(object):
                                             fail_if_running=False)
             except Exception:
                 self.log.error("Exception launching %s" % self.config['binary'])
                 raise
             self.control_server.device = self.device
             self.control_server.app_name = self.config['binary']
 
         else:
+            # For Firefox we need to set MOZ_MOZ_DISABLE_NONLOCAL_CONNECTIONS=1 env var before
+            # startup. This is because of restrictions on moz-beta that require webext to be
+            # signed unless disable non-local connections
+            if self.config['app'] == "firefox":
+                self.log.info("setting MOZ_DISABLE_NONLOCAL_CONNECTIONS=1")
+                os.environ['MOZ_DISABLE_NONLOCAL_CONNECTIONS'] = "1"
+
             # now start the desktop browser
             self.log.info("starting %s" % self.config['app'])
 
             # if running a pageload test on google chrome, add the cmd line options
             # to turn on the proxy and ignore security certificate errors
             if self.config['app'] == "chrome" and test.get('playback', None) is not None:
                 chrome_args = [
                     '--proxy-server="http=127.0.0.1:8080;https=127.0.0.1:8080;ssl=127.0.0.1:8080"',
@@ -222,16 +229,21 @@ class Raptor(object):
                 self.runner.cmdargs.extend(chrome_args)
 
             self.runner.start()
             proc = self.runner.process_handler
             self.output_handler.proc = proc
 
             self.control_server.browser_proc = proc
 
+            # pageload tests need to be able to access non-local connections via mitmproxy
+            if self.config['app'] == "firefox" and test.get('playback', None) is not None:
+                self.log.info("setting MOZ_DISABLE_NONLOCAL_CONNECTIONS=0")
+                os.environ['MOZ_DISABLE_NONLOCAL_CONNECTIONS'] = "0"
+
         # set our cs flag to indicate we are running the browser/app
         self.control_server._finished = False
 
         # convert to seconds and account for page cycles
         timeout = int(timeout / 1000) * int(test['page_cycles'])
         try:
             elapsed_time = 0
             while not self.control_server._finished: