From 10e748a0976edb45a9a389dad155d7c31aded3d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Roth?= Date: Sun, 1 Nov 2026 14:32:23 +0100 Subject: [PATCH] publish s3: remove tmp suffix for testing --- system/lib.py | 5 +++++ system/t06_publish/s3.py | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/system/lib.py b/system/lib.py index 6b79d3de..aebb1e06 100644 --- a/system/lib.py +++ b/system/lib.py @@ -25,6 +25,11 @@ from pathlib import Path from uuid import uuid4 +def remove_tmp_suffix(_, output): + """Normalize .tmp. suffixes to .tmp for deterministic golden output.""" + return re.sub(r'(\.tmp)\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}', r'\1', output) + + def ungzip_if_required(output): if isinstance(output, bytes) and output.startswith(b"\x1f\x8b"): return zlib.decompress(output, 16 + zlib.MAX_WBITS).decode('utf-8') diff --git a/system/t06_publish/s3.py b/system/t06_publish/s3.py index f57adb06..65f91c60 100644 --- a/system/t06_publish/s3.py +++ b/system/t06_publish/s3.py @@ -1,3 +1,4 @@ +from lib import remove_tmp_suffix from s3_lib import S3Test @@ -55,6 +56,7 @@ class S3Publish2Test(S3Test): "aptly repo remove local-repo pyspi" ] sortOutput = True + outputMatchPrepare = remove_tmp_suffix runCmd = "aptly publish update -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec maverick s3:test1:" def check(self): @@ -96,6 +98,7 @@ class S3Publish3Test(S3Test): "aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=maverick snap1 s3:test1:", ] sortOutput = True + outputMatchPrepare = remove_tmp_suffix runCmd = "aptly publish switch -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec maverick s3:test1: snap3" def check(self): @@ -178,6 +181,7 @@ class S3Publish6Test(S3Test): "aptly repo remove local-repo pyspi" ] sortOutput = True + outputMatchPrepare = remove_tmp_suffix runCmd = "aptly publish update -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec maverick s3:test1:" def check(self):