Skip to content

Commit 68684be

Browse files
test: fix permissions on files for html validation (ietf-tools#3795)
* test: fix permissions on files for html validation * test: rewind stdout before dumping output that caused error
1 parent 92f0ff6 commit 68684be

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

ietf/utils/test_runner.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@
5151
import tempfile
5252
import copy
5353
import factory.random
54+
5455
from fnmatch import fnmatch
56+
from pathlib import Path
5557

5658
from coverage.report import Reporter
5759
from coverage.results import Numbers
@@ -764,6 +766,7 @@ def setup_test_environment(self, **kwargs):
764766
)
765767
self.config_file[kind].write(json.dumps(config[kind]).encode())
766768
self.config_file[kind].flush()
769+
Path(self.config_file[kind].name).chmod(0o644)
767770

768771
super(IetfTestRunner, self).setup_test_environment(**kwargs)
769772

@@ -800,6 +803,7 @@ def validate(self, kind):
800803
testcase = TestCase()
801804
cwd = pathlib.Path.cwd()
802805
tmpdir = tempfile.TemporaryDirectory(prefix="html-validate-")
806+
Path(tmpdir.name).chmod(0o655)
803807
for (name, content, fingerprint) in self.batches[kind]:
804808
path = pathlib.Path(tmpdir.name).joinpath(
805809
hex(fingerprint)[2:],
@@ -828,6 +832,7 @@ def validate(self, kind):
828832
try:
829833
validation_results = json.load(stdout)
830834
except json.decoder.JSONDecodeError:
835+
stdout.seek(0)
831836
testcase.fail(stdout.read())
832837

833838
errors = ""

0 commit comments

Comments
 (0)