2025-06-17 10:00:51 -04:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
mkNode,
|
|
|
|
package,
|
|
|
|
testScriptSetup,
|
|
|
|
...
|
|
|
|
}:
|
2025-06-17 11:44:24 -04:00
|
|
|
{
|
|
|
|
name = "garage-basic";
|
|
|
|
|
|
|
|
nodes = {
|
2025-06-17 10:00:51 -04:00
|
|
|
single_node = mkNode {
|
|
|
|
extraSettings =
|
|
|
|
if (lib.versionAtLeast package.version "2") then
|
|
|
|
{
|
|
|
|
replication_factor = 1;
|
|
|
|
consistency_mode = "consistent";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
replication_mode = "none";
|
|
|
|
};
|
|
|
|
};
|
2025-06-17 11:44:24 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
testScript = # python
|
|
|
|
''
|
2025-06-17 10:00:51 -04:00
|
|
|
${testScriptSetup}
|
2024-12-10 20:26:33 +01:00
|
|
|
|
2022-09-07 22:04:27 +02:00
|
|
|
with subtest("Garage works as a single-node S3 storage"):
|
|
|
|
single_node.wait_for_unit("garage.service")
|
|
|
|
single_node.wait_for_open_port(3900)
|
|
|
|
# Now Garage is initialized.
|
|
|
|
single_node_id = get_node_id(single_node)
|
2025-06-17 11:44:24 -04:00
|
|
|
apply_garage_layout(single_node, [f'-z qemutest -c 1G "{single_node_id}"'])
|
2022-09-07 22:04:27 +02:00
|
|
|
# Now Garage is operational.
|
|
|
|
test_bucket_writes(single_node)
|
|
|
|
test_bucket_over_http(single_node)
|
|
|
|
'';
|
2025-06-17 11:44:24 -04:00
|
|
|
}
|