Bug 995417 - Part 2: Testing infrastructure changes to set MOZ_DISABLE_NONLOCAL_CONNECTIONS. r=jmaher, a=test-only
authorNathan Froyd <froydnj@mozilla.com>
Tue, 17 Jun 2014 10:49:57 -0400
changeset 208409 49c95442dd178de5d90503eb98cb184c398d7d05
parent 208408 5d8a03b54648690a2745328506fabfc10781ec2a
child 208410 048db75140c6b6da75d0dc18fd8917bed7319ba0
push id494
push userraliiev@mozilla.com
push dateMon, 25 Aug 2014 18:42:16 +0000
treeherdermozilla-release@a3cc3e46b571 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher, test-only
bugs995417
milestone32.0a2
Bug 995417 - Part 2: Testing infrastructure changes to set MOZ_DISABLE_NONLOCAL_CONNECTIONS. r=jmaher, a=test-only
build/automation.py.in
build/automationutils.py
build/mobile/remoteautomation.py
testing/xpcshell/runxpcshelltests.py
--- a/build/automation.py.in
+++ b/build/automation.py.in
@@ -505,16 +505,19 @@ class Automation(object):
       env[preloadEnvVar] = os.path.join(dmdPath, dmdLibrary)
 
     if crashreporter and not debugger:
       env['MOZ_CRASHREPORTER_NO_REPORT'] = '1'
       env['MOZ_CRASHREPORTER'] = '1'
     else:
       env['MOZ_CRASHREPORTER_DISABLE'] = '1'
 
+    # Crash on non-local network connections.
+    env['MOZ_DISABLE_NONLOCAL_CONNECTIONS'] = '1'
+
     env['GNOME_DISABLE_CRASH_DIALOG'] = '1'
     env['XRE_NO_WINDOWS_CRASH_DIALOG'] = '1'
     env['NS_TRACE_MALLOC_DISABLE_STACKS'] = '1'
 
     # Set WebRTC logging in case it is not set yet
     env.setdefault('NSPR_LOG_MODULES', 'signaling:5,mtransport:3')
     env.setdefault('R_LOG_LEVEL', '5')
     env.setdefault('R_LOG_DESTINATION', 'stderr')
--- a/build/automationutils.py
+++ b/build/automationutils.py
@@ -489,16 +489,19 @@ def environment(xrePath, env=None, crash
   env['NS_TRACE_MALLOC_DISABLE_STACKS'] = '1'
 
   if crashreporter and not debugger:
     env['MOZ_CRASHREPORTER_NO_REPORT'] = '1'
     env['MOZ_CRASHREPORTER'] = '1'
   else:
     env['MOZ_CRASHREPORTER_DISABLE'] = '1'
 
+  # Crash on non-local network connections.
+  env['MOZ_DISABLE_NONLOCAL_CONNECTIONS'] = '1'
+
   # Set WebRTC logging in case it is not set yet
   env.setdefault('NSPR_LOG_MODULES', 'signaling:5,mtransport:5,datachannel:5')
   env.setdefault('R_LOG_LEVEL', '6')
   env.setdefault('R_LOG_DESTINATION', 'stderr')
   env.setdefault('R_LOG_VERBOSE', '1')
 
   # ASan specific environment stuff
   asan = bool(mozinfo.info.get("asan"))
--- a/build/mobile/remoteautomation.py
+++ b/build/mobile/remoteautomation.py
@@ -65,16 +65,19 @@ class RemoteAutomation(Automation):
             env['MOZ_HIDE_RESULTS_TABLE'] = os.environ['MOZ_HIDE_RESULTS_TABLE']
 
         if crashreporter and not debugger:
             env['MOZ_CRASHREPORTER_NO_REPORT'] = '1'
             env['MOZ_CRASHREPORTER'] = '1'
         else:
             env['MOZ_CRASHREPORTER_DISABLE'] = '1'
 
+        # Crash on non-local network connections.
+        env['MOZ_DISABLE_NONLOCAL_CONNECTIONS'] = '1'
+
         return env
 
     def waitForFinish(self, proc, utilityPath, timeout, maxTime, startTime, debuggerInfo, symbolsPath):
         """ Wait for tests to finish.
             If maxTime seconds elapse or no output is detected for timeout
             seconds, kill the process and fail the test.
         """
         # maxTime is used to override the default timeout, we should honor that
old mode 100644
new mode 100755
--- a/testing/xpcshell/runxpcshelltests.py
+++ b/testing/xpcshell/runxpcshelltests.py
@@ -854,16 +854,18 @@ class XPCShellTests(object):
         # Crash reporting interferes with debugging
         if not self.debuggerInfo:
             self.env["MOZ_CRASHREPORTER"] = "1"
         # Don't launch the crash reporter client
         self.env["MOZ_CRASHREPORTER_NO_REPORT"] = "1"
         # Capturing backtraces is very slow on some platforms, and it's
         # disabled by automation.py too
         self.env["NS_TRACE_MALLOC_DISABLE_STACKS"] = "1"
+        # Don't permit remote connections.
+        self.env["MOZ_DISABLE_NONLOCAL_CONNECTIONS"] = "1"
 
     def buildEnvironment(self):
         """
           Create and returns a dictionary of self.env to include all the appropriate env variables and values.
           On a remote system, we overload this to set different values and are missing things like os.environ and PATH.
         """
         self.env = dict(os.environ)
         self.buildCoreEnvironment()