stages/test/test_tar: fix regex to be more robust

For usecases where for example selinux is not supported,
we should expect more errors from tar so we should also accept this
when matching the string.

Kudos go to Achilleas Koutsou <achilleas@koutsou.net> for this hint
This commit is contained in:
Florian Schüller 2024-10-25 12:18:22 +02:00 committed by Achilleas Koutsou
parent a1f02113cd
commit 2d1e8553d7

View file

@ -159,4 +159,4 @@ def test_tar_disk_full(stage_module, fake_inputs, tmp_path_disk_full, capfd):
stage_module.main(fake_inputs, tmp_path_disk_full, options) stage_module.main(fake_inputs, tmp_path_disk_full, options)
assert ex.value.returncode == 2 assert ex.value.returncode == 2
assert re.match(r".*Wrote only \d+ of \d+ bytes.*", str(capfd.readouterr().err)) assert re.search(r"Wrote only \d+ of \d+ bytes", str(capfd.readouterr().err))