Bug 1272255 - Force MOZ_DISABLE_NONLOCAL_CONNECTIONS in Marionette-based tests r=webdriver-reviewers,whimboo,chutten

Differential Revision: https://phabricator.services.mozilla.com/D137691
This commit is contained in:
Julian Descottes 2022-02-08 11:00:07 +00:00
Родитель 570e636697
Коммит 343524674b
6 изменённых файлов: 23 добавлений и 0 удалений

Просмотреть файл

@ -64,6 +64,11 @@ def run_firefox_ui_test(testtype=None, topsrcdir=None, **kwargs):
for test in test_types[testtype]["default_tests"]
]
# Disable non-local connections except for remote tests.
if "test_tags" in kwargs and "remote" not in kwargs.get("test_tags"):
# Causes Firefox to crash when using non-local connections.
os.environ["MOZ_DISABLE_NONLOCAL_CONNECTIONS"] = "1"
kwargs["logger"] = kwargs.pop("log", None)
if not kwargs["logger"]:
kwargs["logger"] = commandline.setup_logging(

Просмотреть файл

@ -50,6 +50,9 @@ def run_marionette(tests, binary=None, topsrcdir=None, **kwargs):
parser.verify_usage(args)
# Causes Firefox to crash when using non-local connections.
os.environ["MOZ_DISABLE_NONLOCAL_CONNECTIONS"] = "1"
if not args.logger:
args.logger = commandline.setup_logging(
"Marionette Unit Tests", args, {"mach": sys.stdout}

Просмотреть файл

@ -328,6 +328,11 @@ class FirefoxUITests(TestingMixin, VCSToolsScript, CodeCoverageMixin):
if self.config["allow_software_gl_layers"]:
env["MOZ_LAYERS_ALLOW_SOFTWARE_GL"] = "1"
# Disable non-local connections except for remote tests.
if self.config.get("tag") and self.config["tag"] != "remote":
# Causes Firefox to crash when using non-local connections.
env["MOZ_DISABLE_NONLOCAL_CONNECTIONS"] = "1"
return_code = self.run_command(
cmd,
cwd=dirs["abs_fxui_dir"],

Просмотреть файл

@ -375,6 +375,10 @@ class MarionetteTest(TestingMixin, MercurialScript, TransferMixin, CodeCoverageM
if not os.path.isdir(env["MOZ_UPLOAD_DIR"]):
self.mkdir_p(env["MOZ_UPLOAD_DIR"])
# Causes Firefox to crash when using non-local connections.
env["MOZ_DISABLE_NONLOCAL_CONNECTIONS"] = "1"
env = self.query_env(partial_env=env)
try:

Просмотреть файл

@ -220,6 +220,9 @@ class TelemetryTests(TestingMixin, VCSToolsScript, CodeCoverageMixin):
env["RUST_BACKTRACE"] = "1"
env["MOZ_IGNORE_NSS_SHUTDOWN_LEAKS"] = "1"
# Causes Firefox to crash when using non-local connections.
env["MOZ_DISABLE_NONLOCAL_CONNECTIONS"] = "1"
# If code coverage is enabled, set GCOV_PREFIX env variable
if self.config.get("code_coverage"):
env["GCOV_PREFIX"] = self.gcov_dir

Просмотреть файл

@ -54,6 +54,9 @@ def run_telemetry(tests, binary=None, topsrcdir=None, **kwargs):
os.environ["MOZ_IGNORE_NSS_SHUTDOWN_LEAKS"] = "1"
# Causes Firefox to crash when using non-local connections.
os.environ["MOZ_DISABLE_NONLOCAL_CONNECTIONS"] = "1"
if not args.logger:
args.logger = commandline.setup_logging(
"Telemetry Client Tests", args, {"mach": sys.stdout}