|
340 | 340 | print(" ✓ nix copy works") |
341 | 341 | print(" ✓ Credentials cached on client") |
342 | 342 |
|
| 343 | + @setup_s3(populate_bucket=[PKGS['A'], PKGS['B']], public=True) |
| 344 | + def test_public_bucket_operations(bucket): |
| 345 | + """Test store operations on public bucket without credentials""" |
| 346 | + print("\n=== Testing Public Bucket Operations ===") |
| 347 | +
|
| 348 | + store_url = make_s3_url(bucket) |
| 349 | +
|
| 350 | + # Verify store info works without credentials |
| 351 | + client.succeed(f"nix store info --store '{store_url}' >&2") |
| 352 | + print(" ✓ nix store info works without credentials") |
| 353 | +
|
| 354 | + # Get and validate store info JSON |
| 355 | + info_json = client.succeed(f"nix store info --json --store '{store_url}'") |
| 356 | + store_info = json.loads(info_json) |
| 357 | +
|
| 358 | + if not store_info.get("url"): |
| 359 | + raise Exception("Store should have a URL") |
| 360 | +
|
| 361 | + print(f" ✓ Store URL: {store_info['url']}") |
| 362 | +
|
| 363 | + # Verify packages are not yet in client store |
| 364 | + client.fail(f"nix path-info {PKGS['A']}") |
| 365 | + client.fail(f"nix path-info {PKGS['B']}") |
| 366 | +
|
| 367 | + # Test copy from public bucket without credentials |
| 368 | + client.succeed( |
| 369 | + f"nix copy --debug --no-check-sigs " |
| 370 | + f"--from '{store_url}' {PKGS['A']} {PKGS['B']} 2>&1" |
| 371 | + ) |
| 372 | +
|
| 373 | + # Verify packages were copied successfully |
| 374 | + client.succeed(f"nix path-info {PKGS['A']}") |
| 375 | + client.succeed(f"nix path-info {PKGS['B']}") |
| 376 | +
|
| 377 | + print(" ✓ nix copy from public bucket works without credentials") |
| 378 | +
|
343 | 379 | @setup_s3(populate_bucket=[PKGS['A']]) |
344 | 380 | def test_url_format_variations(bucket): |
345 | 381 | """Test different S3 URL parameter combinations""" |
|
506 | 542 | test_error_message_formatting() |
507 | 543 | test_fork_credential_preresolution() |
508 | 544 | test_store_operations() |
| 545 | + test_public_bucket_operations() |
509 | 546 | test_url_format_variations() |
510 | 547 | test_concurrent_fetches() |
511 | 548 | test_compression_narinfo_gzip() |
|
0 commit comments