From 68684be247231af4251c38999769aafdfea7b5ab Mon Sep 17 00:00:00 2001 From: Jennifer Richards Date: Thu, 7 Apr 2022 18:17:33 -0300 Subject: [PATCH] test: fix permissions on files for html validation (#3795) * test: fix permissions on files for html validation * test: rewind stdout before dumping output that caused error --- ietf/utils/test_runner.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ietf/utils/test_runner.py b/ietf/utils/test_runner.py index 96979831a..fc54b3fb4 100644 --- a/ietf/utils/test_runner.py +++ b/ietf/utils/test_runner.py @@ -51,7 +51,9 @@ import subprocess import tempfile import copy import factory.random + from fnmatch import fnmatch +from pathlib import Path from coverage.report import Reporter from coverage.results import Numbers @@ -764,6 +766,7 @@ class IetfTestRunner(DiscoverRunner): ) self.config_file[kind].write(json.dumps(config[kind]).encode()) self.config_file[kind].flush() + Path(self.config_file[kind].name).chmod(0o644) super(IetfTestRunner, self).setup_test_environment(**kwargs) @@ -800,6 +803,7 @@ class IetfTestRunner(DiscoverRunner): testcase = TestCase() cwd = pathlib.Path.cwd() tmpdir = tempfile.TemporaryDirectory(prefix="html-validate-") + Path(tmpdir.name).chmod(0o655) for (name, content, fingerprint) in self.batches[kind]: path = pathlib.Path(tmpdir.name).joinpath( hex(fingerprint)[2:], @@ -828,6 +832,7 @@ class IetfTestRunner(DiscoverRunner): try: validation_results = json.load(stdout) except json.decoder.JSONDecodeError: + stdout.seek(0) testcase.fail(stdout.read()) errors = ""