From 7d0c06f921a37c85dd98dfdcd077e5aad2e9ab3e Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Costa Date: Sat, 18 Oct 2025 23:57:51 +0000 Subject: [PATCH] feat(tests/nixos/s3-binary-cache-store): add public parameter to setup_s3 Add optional 'public' parameter to setup_s3 decorator. When set to True, the bucket will be made publicly accessible using mc anonymous set. --- tests/nixos/s3-binary-cache-store.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/nixos/s3-binary-cache-store.nix b/tests/nixos/s3-binary-cache-store.nix index 4f5632724..96ca37f19 100644 --- a/tests/nixos/s3-binary-cache-store.nix +++ b/tests/nixos/s3-binary-cache-store.nix @@ -131,7 +131,7 @@ in print(output) raise Exception(f"{error_msg}: expected {expected}, got {actual}") - def setup_s3(populate_bucket=[]): + def setup_s3(populate_bucket=[], public=False): """ Decorator that creates/destroys a unique bucket for each test. Optionally pre-populates bucket with specified packages. @@ -139,11 +139,14 @@ in Args: populate_bucket: List of packages to upload before test runs + public: If True, make the bucket publicly accessible """ def decorator(test_func): def wrapper(): bucket = str(uuid.uuid4()) server.succeed(f"mc mb minio/{bucket}") + if public: + server.succeed(f"mc anonymous set download minio/{bucket}") try: if populate_bucket: store_url = make_s3_url(bucket)