Bug 995417 - part 2 - testing infrastructure changes to set MOZ_DISABLE_NONLOCAL_CONNECTIONS; r=jmaher
authorNathan Froyd <froydnj@mozilla.com>
Tue, 17 Jun 2014 10:49:57 -0400
changeset 209922 51342b493983f83f3d301581d0f5b13ff05a6ffd
parent 209921 a3bfa5ab131ea6f1b436fbc746ccf25609c338ee
child 209923 82ae65ae640fee7fd4605ef562769a95662f59ba
push id3857
push userraliiev@mozilla.com
push dateTue, 02 Sep 2014 16:39:23 +0000
treeherdermozilla-beta@5638b907b505 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs995417
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 995417 - part 2 - testing infrastructure changes to set MOZ_DISABLE_NONLOCAL_CONNECTIONS; r=jmaher
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:5,datachannel:5')
     env.setdefault('R_LOG_LEVEL', '6')
     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()