mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-09-11 07:15:54 +03:00
nixosTests.garage: fix
This commit is contained in:
parent
d9c73ef087
commit
45e438fd89
@ -1,4 +1,4 @@
|
|||||||
args@{ mkNode, ... }:
|
args@{ mkNode, ver, ... }:
|
||||||
(import ../make-test-python.nix ({ pkgs, ...} : {
|
(import ../make-test-python.nix ({ pkgs, ...} : {
|
||||||
name = "garage-basic";
|
name = "garage-basic";
|
||||||
meta = {
|
meta = {
|
||||||
@ -52,7 +52,7 @@ args@{ mkNode, ... }:
|
|||||||
machine.succeed(f"garage layout apply --version {version}")
|
machine.succeed(f"garage layout apply --version {version}")
|
||||||
|
|
||||||
def create_api_key(machine: Machine, key_name: str) -> S3Key:
|
def create_api_key(machine: Machine, key_name: str) -> S3Key:
|
||||||
output = machine.succeed(f"garage key new --name {key_name}")
|
output = machine.succeed(f"garage key ${if ver == "0_8" then "new --name" else "create"} {key_name}")
|
||||||
m = key_creation_regex.match(output)
|
m = key_creation_regex.match(output)
|
||||||
if not m or not m.group('key_id') or not m.group('secret_key'):
|
if not m or not m.group('key_id') or not m.group('secret_key'):
|
||||||
raise ValueError('Cannot parse API key data')
|
raise ValueError('Cannot parse API key data')
|
||||||
@ -90,7 +90,7 @@ args@{ mkNode, ... }:
|
|||||||
single_node.wait_for_open_port(3900)
|
single_node.wait_for_open_port(3900)
|
||||||
# Now Garage is initialized.
|
# Now Garage is initialized.
|
||||||
single_node_id = get_node_id(single_node)
|
single_node_id = get_node_id(single_node)
|
||||||
apply_garage_layout(single_node, [f'-z qemutest -c 1 "{single_node_id}"'])
|
apply_garage_layout(single_node, [f'-z qemutest -c ${if ver == "0_8" then "1" else "1G"} "{single_node_id}"'])
|
||||||
# Now Garage is operational.
|
# Now Garage is operational.
|
||||||
test_bucket_writes(single_node)
|
test_bucket_writes(single_node)
|
||||||
test_bucket_over_http(single_node)
|
test_bucket_over_http(single_node)
|
||||||
|
@ -44,8 +44,8 @@ let
|
|||||||
in
|
in
|
||||||
foldl
|
foldl
|
||||||
(matrix: ver: matrix // {
|
(matrix: ver: matrix // {
|
||||||
"basic${toString ver}" = import ./basic.nix { inherit system pkgs; mkNode = mkNode pkgs."garage_${ver}"; };
|
"basic${toString ver}" = import ./basic.nix { inherit system pkgs ver; mkNode = mkNode pkgs."garage_${ver}"; };
|
||||||
"with-3node-replication${toString ver}" = import ./with-3node-replication.nix { inherit system pkgs; mkNode = mkNode pkgs."garage_${ver}"; };
|
"with-3node-replication${toString ver}" = import ./with-3node-replication.nix { inherit system pkgs ver; mkNode = mkNode pkgs."garage_${ver}"; };
|
||||||
})
|
})
|
||||||
{}
|
{}
|
||||||
[
|
[
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
args@{ mkNode, ... }:
|
args@{ mkNode, ver, ... }:
|
||||||
(import ../make-test-python.nix ({ pkgs, ...} :
|
(import ../make-test-python.nix ({ pkgs, ...} :
|
||||||
{
|
{
|
||||||
name = "garage-3node-replication";
|
name = "garage-3node-replication";
|
||||||
@ -55,7 +55,7 @@ args@{ mkNode, ... }:
|
|||||||
machine.succeed(f"garage layout apply --version {version}")
|
machine.succeed(f"garage layout apply --version {version}")
|
||||||
|
|
||||||
def create_api_key(machine: Machine, key_name: str) -> S3Key:
|
def create_api_key(machine: Machine, key_name: str) -> S3Key:
|
||||||
output = machine.succeed(f"garage key new --name {key_name}")
|
output = machine.succeed(f"garage key ${if ver == "0_8" then "new --name" else "create"} {key_name}")
|
||||||
m = key_creation_regex.match(output)
|
m = key_creation_regex.match(output)
|
||||||
if not m or not m.group('key_id') or not m.group('secret_key'):
|
if not m or not m.group('key_id') or not m.group('secret_key'):
|
||||||
raise ValueError('Cannot parse API key data')
|
raise ValueError('Cannot parse API key data')
|
||||||
@ -110,7 +110,7 @@ args@{ mkNode, ... }:
|
|||||||
zones = ["nixcon", "nixcon", "paris_meetup", "fosdem"]
|
zones = ["nixcon", "nixcon", "paris_meetup", "fosdem"]
|
||||||
apply_garage_layout(node1,
|
apply_garage_layout(node1,
|
||||||
[
|
[
|
||||||
f'{ndata.node_id} -z {zones[index]} -c 1'
|
f'{ndata.node_id} -z {zones[index]} -c ${if ver == "0_8" then "1" else "1G"}'
|
||||||
for index, ndata in enumerate(node_ids.values())
|
for index, ndata in enumerate(node_ids.values())
|
||||||
])
|
])
|
||||||
# Now Garage is operational.
|
# Now Garage is operational.
|
||||||
|
Loading…
Reference in New Issue
Block a user