Loading nixos/tests/all-tests.nix +4 −1 Original line number Diff line number Diff line Loading @@ -535,7 +535,10 @@ in mimir = runTest ./mimir.nix; galene = discoverTests (import ./galene.nix); gancio = runTest ./gancio.nix; garage = handleTest ./garage { }; garage_1 = import ./garage { inherit runTest; package = pkgs.garage_1_x; }; gatus = runTest ./gatus.nix; getaddrinfo = runTest ./getaddrinfo.nix; gemstash = handleTest ./gemstash.nix { }; Loading nixos/tests/garage/basic.nix +13 −23 Original line number Diff line number Diff line args@{ mkNode, ver, ... }: (import ../make-test-python.nix ( { pkgs, ... }: { mkNode, ... }: { name = "garage-basic"; meta = { maintainers = with pkgs.lib.maintainers; [ raitobezarius ]; }; nodes = { single_node = mkNode { replicationMode = "none"; }; }; testScript = '' testScript = # python '' from typing import List from dataclasses import dataclass import re Loading Loading @@ -54,9 +50,7 @@ args@{ mkNode, ver, ... }: machine.succeed(f"garage layout apply --version {version}") def create_api_key(machine: Machine, key_name: str) -> S3Key: output = machine.succeed(f"garage key ${ if ver == "0_8" then "new --name" else "create" } {key_name}") output = machine.succeed(f"garage key create {key_name}") m = key_creation_regex.match(output) if not m or not m.group('key_id') or not m.group('secret_key'): raise ValueError('Cannot parse API key data') Loading Loading @@ -94,13 +88,9 @@ args@{ mkNode, ver, ... }: single_node.wait_for_open_port(3900) # Now Garage is initialized. single_node_id = get_node_id(single_node) apply_garage_layout(single_node, [f'-z qemutest -c ${ if ver == "0_8" then "1" else "1G" } "{single_node_id}"']) apply_garage_layout(single_node, [f'-z qemutest -c 1G "{single_node_id}"']) # Now Garage is operational. test_bucket_writes(single_node) test_bucket_over_http(single_node) ''; } )) args nixos/tests/garage/default.nix +21 −27 Original line number Diff line number Diff line { system ? builtins.currentSystem, config ? { }, pkgs ? import ../../.. { inherit system config; }, runTest, package, }: with pkgs.lib; let mkNode = package: { replicationMode, publicV6Address ? "::1", Loading Loading @@ -55,24 +51,22 @@ let virtualisation.diskSize = 2 * 1024; }; in foldl ( matrix: ver: matrix // { "basic${toString ver}" = import ./basic.nix { inherit system pkgs ver; mkNode = mkNode pkgs."garage_${ver}"; { basic = runTest { imports = [ ./basic.nix ]; _module.args = { inherit mkNode; }; }; with-3node-replication = runTest { imports = [ ./with-3node-replication.nix ]; _module.args = { inherit mkNode; }; "with-3node-replication${toString ver}" = import ./with-3node-replication.nix { inherit system pkgs ver; mkNode = mkNode pkgs."garage_${ver}"; }; } ) { } [ "0_8" "0_9" "1_x" ] nixos/tests/garage/with-3node-replication.nix +25 −33 Original line number Diff line number Diff line args@{ mkNode, ver, ... }: (import ../make-test-python.nix ( { pkgs, ... }: { mkNode, ... }: { name = "garage-3node-replication"; meta = { maintainers = with pkgs.lib.maintainers; [ raitobezarius ]; }; nodes = { node1 = mkNode { Loading @@ -26,7 +21,8 @@ args@{ mkNode, ver, ... }: }; }; testScript = '' testScript = # python '' from typing import List from dataclasses import dataclass import re Loading Loading @@ -68,9 +64,7 @@ args@{ mkNode, ver, ... }: machine.succeed(f"garage layout apply --version {version}") def create_api_key(machine: Machine, key_name: str) -> S3Key: output = machine.succeed(f"garage key ${ if ver == "0_8" then "new --name" else "create" } {key_name}") output = machine.succeed(f"garage key create {key_name}") m = key_creation_regex.match(output) if not m or not m.group('key_id') or not m.group('secret_key'): raise ValueError('Cannot parse API key data') Loading Loading @@ -125,7 +119,7 @@ args@{ mkNode, ver, ... }: zones = ["nixcon", "nixcon", "paris_meetup", "fosdem"] apply_garage_layout(node1, [ f'{ndata.node_id} -z {zones[index]} -c ${if ver == "0_8" then "1" else "1G"}' f'{ndata.node_id} -z {zones[index]} -c 1G' for index, ndata in enumerate(node_ids.values()) ]) # Now Garage is operational. Loading @@ -134,5 +128,3 @@ args@{ mkNode, ver, ... }: test_bucket_over_http(get_machine(node)) ''; } )) args pkgs/tools/filesystems/garage/default.nix +1 −1 Original line number Diff line number Diff line Loading @@ -92,7 +92,7 @@ let "k2v::poll::test_poll_item" ]; passthru.tests = nixosTests.garage; passthru.tests = nixosTests."garage_${lib.versions.major version}"; meta = { description = "S3-compatible object store for small self-hosted geo-distributed deployments"; Loading Loading
nixos/tests/all-tests.nix +4 −1 Original line number Diff line number Diff line Loading @@ -535,7 +535,10 @@ in mimir = runTest ./mimir.nix; galene = discoverTests (import ./galene.nix); gancio = runTest ./gancio.nix; garage = handleTest ./garage { }; garage_1 = import ./garage { inherit runTest; package = pkgs.garage_1_x; }; gatus = runTest ./gatus.nix; getaddrinfo = runTest ./getaddrinfo.nix; gemstash = handleTest ./gemstash.nix { }; Loading
nixos/tests/garage/basic.nix +13 −23 Original line number Diff line number Diff line args@{ mkNode, ver, ... }: (import ../make-test-python.nix ( { pkgs, ... }: { mkNode, ... }: { name = "garage-basic"; meta = { maintainers = with pkgs.lib.maintainers; [ raitobezarius ]; }; nodes = { single_node = mkNode { replicationMode = "none"; }; }; testScript = '' testScript = # python '' from typing import List from dataclasses import dataclass import re Loading Loading @@ -54,9 +50,7 @@ args@{ mkNode, ver, ... }: machine.succeed(f"garage layout apply --version {version}") def create_api_key(machine: Machine, key_name: str) -> S3Key: output = machine.succeed(f"garage key ${ if ver == "0_8" then "new --name" else "create" } {key_name}") output = machine.succeed(f"garage key create {key_name}") m = key_creation_regex.match(output) if not m or not m.group('key_id') or not m.group('secret_key'): raise ValueError('Cannot parse API key data') Loading Loading @@ -94,13 +88,9 @@ args@{ mkNode, ver, ... }: single_node.wait_for_open_port(3900) # Now Garage is initialized. single_node_id = get_node_id(single_node) apply_garage_layout(single_node, [f'-z qemutest -c ${ if ver == "0_8" then "1" else "1G" } "{single_node_id}"']) apply_garage_layout(single_node, [f'-z qemutest -c 1G "{single_node_id}"']) # Now Garage is operational. test_bucket_writes(single_node) test_bucket_over_http(single_node) ''; } )) args
nixos/tests/garage/default.nix +21 −27 Original line number Diff line number Diff line { system ? builtins.currentSystem, config ? { }, pkgs ? import ../../.. { inherit system config; }, runTest, package, }: with pkgs.lib; let mkNode = package: { replicationMode, publicV6Address ? "::1", Loading Loading @@ -55,24 +51,22 @@ let virtualisation.diskSize = 2 * 1024; }; in foldl ( matrix: ver: matrix // { "basic${toString ver}" = import ./basic.nix { inherit system pkgs ver; mkNode = mkNode pkgs."garage_${ver}"; { basic = runTest { imports = [ ./basic.nix ]; _module.args = { inherit mkNode; }; }; with-3node-replication = runTest { imports = [ ./with-3node-replication.nix ]; _module.args = { inherit mkNode; }; "with-3node-replication${toString ver}" = import ./with-3node-replication.nix { inherit system pkgs ver; mkNode = mkNode pkgs."garage_${ver}"; }; } ) { } [ "0_8" "0_9" "1_x" ]
nixos/tests/garage/with-3node-replication.nix +25 −33 Original line number Diff line number Diff line args@{ mkNode, ver, ... }: (import ../make-test-python.nix ( { pkgs, ... }: { mkNode, ... }: { name = "garage-3node-replication"; meta = { maintainers = with pkgs.lib.maintainers; [ raitobezarius ]; }; nodes = { node1 = mkNode { Loading @@ -26,7 +21,8 @@ args@{ mkNode, ver, ... }: }; }; testScript = '' testScript = # python '' from typing import List from dataclasses import dataclass import re Loading Loading @@ -68,9 +64,7 @@ args@{ mkNode, ver, ... }: machine.succeed(f"garage layout apply --version {version}") def create_api_key(machine: Machine, key_name: str) -> S3Key: output = machine.succeed(f"garage key ${ if ver == "0_8" then "new --name" else "create" } {key_name}") output = machine.succeed(f"garage key create {key_name}") m = key_creation_regex.match(output) if not m or not m.group('key_id') or not m.group('secret_key'): raise ValueError('Cannot parse API key data') Loading Loading @@ -125,7 +119,7 @@ args@{ mkNode, ver, ... }: zones = ["nixcon", "nixcon", "paris_meetup", "fosdem"] apply_garage_layout(node1, [ f'{ndata.node_id} -z {zones[index]} -c ${if ver == "0_8" then "1" else "1G"}' f'{ndata.node_id} -z {zones[index]} -c 1G' for index, ndata in enumerate(node_ids.values()) ]) # Now Garage is operational. Loading @@ -134,5 +128,3 @@ args@{ mkNode, ver, ... }: test_bucket_over_http(get_machine(node)) ''; } )) args
pkgs/tools/filesystems/garage/default.nix +1 −1 Original line number Diff line number Diff line Loading @@ -92,7 +92,7 @@ let "k2v::poll::test_poll_item" ]; passthru.tests = nixosTests.garage; passthru.tests = nixosTests."garage_${lib.versions.major version}"; meta = { description = "S3-compatible object store for small self-hosted geo-distributed deployments"; Loading