1{ 2 lib, 3 mkNode, 4 package, 5 testScriptSetup, 6 ... 7}: 8{ 9 name = "garage-basic"; 10 11 nodes = { 12 single_node = mkNode { 13 extraSettings = 14 if (lib.versionAtLeast package.version "2") then 15 { 16 replication_factor = 1; 17 consistency_mode = "consistent"; 18 } 19 else 20 { 21 replication_mode = "none"; 22 }; 23 }; 24 }; 25 26 testScript = # python 27 '' 28 ${testScriptSetup} 29 30 with subtest("Garage works as a single-node S3 storage"): 31 single_node.wait_for_unit("garage.service") 32 single_node.wait_for_open_port(3900) 33 # Now Garage is initialized. 34 single_node_id = get_node_id(single_node) 35 apply_garage_layout(single_node, [f'-z qemutest -c 1G "{single_node_id}"']) 36 # Now Garage is operational. 37 test_bucket_writes(single_node) 38 test_bucket_over_http(single_node) 39 ''; 40}