diff options
-rw-r--r-- | build/android/pylib/gtest/setup.py | 1 | ||||
-rw-r--r-- | build/isolate.gypi | 1 | ||||
-rw-r--r-- | chrome/browser_tests.isolate | 1 | ||||
-rw-r--r-- | chrome/interactive_ui_tests.isolate | 1 | ||||
-rw-r--r-- | content/content_browsertests.isolate | 1 | ||||
-rwxr-xr-x | ppapi/native_client/tools/browser_tester/browser_tester.py | 2 | ||||
-rwxr-xr-x | testing/test_env.py | 22 |
7 files changed, 18 insertions, 11 deletions
diff --git a/build/android/pylib/gtest/setup.py b/build/android/pylib/gtest/setup.py index 6a9e65b..85a19c3 100644 --- a/build/android/pylib/gtest/setup.py +++ b/build/android/pylib/gtest/setup.py @@ -118,6 +118,7 @@ def _GenerateDepsDirUsingIsolate(suite_name, isolate_file_path=None): '--config-variable', 'component', 'static_library', '--config-variable', 'fastbuild', '0', '--config-variable', 'icu_use_data_file_flag', '1', + '--config-variable', 'lsan', '0', # TODO(maruel): This may not be always true. '--config-variable', 'target_arch', 'arm', '--config-variable', 'use_openssl', '0', diff --git a/build/isolate.gypi b/build/isolate.gypi index 5217c31..c02beb9 100644 --- a/build/isolate.gypi +++ b/build/isolate.gypi @@ -98,6 +98,7 @@ '--config-variable', 'internal_gles2_conform_tests=<(internal_gles2_conform_tests)', '--config-variable', 'icu_use_data_file_flag=<(icu_use_data_file_flag)', + '--config-variable', 'lsan=<(lsan)', '--config-variable', 'libpeer_target_type=<(libpeer_target_type)', '--config-variable', 'use_openssl=<(use_openssl)', '--config-variable', 'target_arch=<(target_arch)', diff --git a/chrome/browser_tests.isolate b/chrome/browser_tests.isolate index 2fe595e..ffed8df 100644 --- a/chrome/browser_tests.isolate +++ b/chrome/browser_tests.isolate @@ -13,6 +13,7 @@ '<(PRODUCT_DIR)', '<(PRODUCT_DIR)/browser_tests<(EXECUTABLE_SUFFIX)', '--test-launcher-bot-mode', + '--lsan=<(lsan)', ], 'isolate_dependency_tracked': [ '../testing/xvfb.py', diff --git a/chrome/interactive_ui_tests.isolate b/chrome/interactive_ui_tests.isolate index 34f9e37..04f6cc2 100644 --- a/chrome/interactive_ui_tests.isolate +++ b/chrome/interactive_ui_tests.isolate @@ -10,6 +10,7 @@ '<(PRODUCT_DIR)', '<(PRODUCT_DIR)/interactive_ui_tests<(EXECUTABLE_SUFFIX)', '--test-launcher-bot-mode', + '--lsan=<(lsan)', ], 'isolate_dependency_tracked': [ '../testing/xvfb.py', diff --git a/content/content_browsertests.isolate b/content/content_browsertests.isolate index 2d43089..e794b2f 100644 --- a/content/content_browsertests.isolate +++ b/content/content_browsertests.isolate @@ -40,6 +40,7 @@ '<(PRODUCT_DIR)', '<(PRODUCT_DIR)/content_browsertests<(EXECUTABLE_SUFFIX)', '--test-launcher-bot-mode', + '--lsan=<(lsan)', ], 'isolate_dependency_tracked': [ '../testing/xvfb.py', diff --git a/ppapi/native_client/tools/browser_tester/browser_tester.py b/ppapi/native_client/tools/browser_tester/browser_tester.py index 844956d..0c21d4f 100755 --- a/ppapi/native_client/tools/browser_tester/browser_tester.py +++ b/ppapi/native_client/tools/browser_tester/browser_tester.py @@ -211,7 +211,7 @@ def RunTestsOnce(url, options): options.files.append(os.path.join(script_dir, 'browserdata', 'nacltest.js')) # Setup the environment with the setuid sandbox path. - test_env.enable_sandbox_if_required(os.environ) + test_env.enable_sandbox_if_required(sys.argv, os.environ) # Create server host = GetHostName() diff --git a/testing/test_env.py b/testing/test_env.py index ec98a11..0729e17 100755 --- a/testing/test_env.py +++ b/testing/test_env.py @@ -17,13 +17,18 @@ CHROME_SANDBOX_ENV = 'CHROME_DEVEL_SANDBOX' CHROME_SANDBOX_PATH = '/opt/chromium/chrome_sandbox' -def should_enable_sandbox(sandbox_path): +def should_enable_sandbox(cmd, sandbox_path): """Return a boolean indicating that the current slave is capable of using the sandbox and should enable it. This should return True iff the slave is a Linux host with the sandbox file present and configured correctly.""" if not (sys.platform.startswith('linux') and os.path.exists(sandbox_path)): return False + + # Copy the check in tools/build/scripts/slave/runtest.py. + if '--lsan=1' in cmd: + return False + sandbox_stat = os.stat(sandbox_path) if ((sandbox_stat.st_mode & stat.S_ISUID) and (sandbox_stat.st_mode & stat.S_IRUSR) and @@ -33,23 +38,20 @@ def should_enable_sandbox(sandbox_path): return False -def enable_sandbox_if_required(env, verbose=False): +def enable_sandbox_if_required(cmd, env, verbose=False): """Checks enables the sandbox if it is required, otherwise it disables it.""" chrome_sandbox_path = env.get(CHROME_SANDBOX_ENV, CHROME_SANDBOX_PATH) - if should_enable_sandbox(chrome_sandbox_path): + if should_enable_sandbox(cmd, chrome_sandbox_path): if verbose: print 'Enabling sandbox. Setting environment variable:' print ' %s="%s"' % (CHROME_SANDBOX_ENV, chrome_sandbox_path) env[CHROME_SANDBOX_ENV] = chrome_sandbox_path else: if verbose: - print 'Sandbox not properly installed. Unsetting:' - print ' %s' % CHROME_SANDBOX_ENV - # The variable should be removed from the environment, making - # the variable empty silently disables the sandbox. - if env.get(CHROME_SANDBOX_ENV): - env.pop(CHROME_SANDBOX_ENV) + print 'Disabling sandbox. Setting environment variable:' + print ' CHROME_DEVEL_SANDBOX=""' + env['CHROME_DEVEL_SANDBOX'] = '' def fix_python_path(cmd): @@ -74,7 +76,7 @@ def run_executable(cmd, env): # Used by base/base_paths_linux.cc as an override. Just make sure the default # logic is used. env.pop('CR_SOURCE_ROOT', None) - enable_sandbox_if_required(env) + enable_sandbox_if_required(cmd, env) # Ensure paths are correctly separated on windows. cmd[0] = cmd[0].replace('/', os.path.sep) cmd = fix_python_path(cmd) |