Skip to content

Commit 7d0c06f

Browse files
committed
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.
1 parent 5b4bd5b commit 7d0c06f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/nixos/s3-binary-cache-store.nix

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,19 +131,22 @@ in
131131
print(output)
132132
raise Exception(f"{error_msg}: expected {expected}, got {actual}")
133133
134-
def setup_s3(populate_bucket=[]):
134+
def setup_s3(populate_bucket=[], public=False):
135135
"""
136136
Decorator that creates/destroys a unique bucket for each test.
137137
Optionally pre-populates bucket with specified packages.
138138
Cleans up client store after test completion.
139139
140140
Args:
141141
populate_bucket: List of packages to upload before test runs
142+
public: If True, make the bucket publicly accessible
142143
"""
143144
def decorator(test_func):
144145
def wrapper():
145146
bucket = str(uuid.uuid4())
146147
server.succeed(f"mc mb minio/{bucket}")
148+
if public:
149+
server.succeed(f"mc anonymous set download minio/{bucket}")
147150
try:
148151
if populate_bucket:
149152
store_url = make_s3_url(bucket)

0 commit comments

Comments
 (0)