nixosTests.galene: Modernise / simplify test code
- makeTest -> passed-through runTest - Drop hardcoded sleep & check if galene still runs, it's not really necessary
This commit is contained in:
parent
446617549c
commit
6bfa191ec3
@ -546,7 +546,7 @@ in
|
|||||||
ft2-clone = runTest ./ft2-clone.nix;
|
ft2-clone = runTest ./ft2-clone.nix;
|
||||||
legit = runTest ./legit.nix;
|
legit = runTest ./legit.nix;
|
||||||
mimir = runTest ./mimir.nix;
|
mimir = runTest ./mimir.nix;
|
||||||
galene = discoverTests (import ./galene.nix);
|
galene = discoverTests (import ./galene.nix { inherit runTest; });
|
||||||
gancio = runTest ./gancio.nix;
|
gancio = runTest ./gancio.nix;
|
||||||
garage_1 = import ./garage {
|
garage_1 = import ./garage {
|
||||||
inherit runTest;
|
inherit runTest;
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
|
{ runTest }:
|
||||||
|
|
||||||
let
|
let
|
||||||
makeTest = import ./make-test-python.nix;
|
|
||||||
galeneTestGroupsDir = "/var/lib/galene/groups";
|
galeneTestGroupsDir = "/var/lib/galene/groups";
|
||||||
galeneTestGroupFile = "galene-test-config.json";
|
galeneTestGroupFile = "galene-test-config.json";
|
||||||
galenePort = 8443;
|
galenePort = 8443;
|
||||||
@ -7,7 +8,7 @@ let
|
|||||||
galeneTestGroupAdminPassword = "1234";
|
galeneTestGroupAdminPassword = "1234";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
basic = makeTest (
|
basic = runTest (
|
||||||
{ pkgs, lib, ... }:
|
{ pkgs, lib, ... }:
|
||||||
{
|
{
|
||||||
name = "galene-works";
|
name = "galene-works";
|
||||||
@ -56,10 +57,7 @@ in
|
|||||||
with subtest("galene starts"):
|
with subtest("galene starts"):
|
||||||
# Starts?
|
# Starts?
|
||||||
machine.wait_for_unit("galene")
|
machine.wait_for_unit("galene")
|
||||||
|
machine.wait_for_open_port(${builtins.toString galenePort})
|
||||||
# Keeps running after startup?
|
|
||||||
machine.sleep(10)
|
|
||||||
machine.wait_for_unit("galene")
|
|
||||||
|
|
||||||
# Reponds fine?
|
# Reponds fine?
|
||||||
machine.succeed("curl -s -D - -o /dev/null 'http://localhost:${builtins.toString galenePort}' >&2")
|
machine.succeed("curl -s -D - -o /dev/null 'http://localhost:${builtins.toString galenePort}' >&2")
|
||||||
@ -93,7 +91,7 @@ in
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
file-transfer = makeTest (
|
file-transfer = runTest (
|
||||||
{ pkgs, lib, ... }:
|
{ pkgs, lib, ... }:
|
||||||
{
|
{
|
||||||
name = "galene-file-transfer-works";
|
name = "galene-file-transfer-works";
|
||||||
@ -143,10 +141,7 @@ in
|
|||||||
with subtest("galene starts"):
|
with subtest("galene starts"):
|
||||||
# Starts?
|
# Starts?
|
||||||
machine.wait_for_unit("galene")
|
machine.wait_for_unit("galene")
|
||||||
|
machine.wait_for_open_port(${builtins.toString galenePort})
|
||||||
# Keeps running after startup?
|
|
||||||
machine.sleep(10)
|
|
||||||
machine.wait_for_unit("galene")
|
|
||||||
|
|
||||||
# Reponds fine?
|
# Reponds fine?
|
||||||
machine.succeed("curl -s -D - -o /dev/null 'http://localhost:${builtins.toString galenePort}' >&2")
|
machine.succeed("curl -s -D - -o /dev/null 'http://localhost:${builtins.toString galenePort}' >&2")
|
||||||
@ -209,7 +204,7 @@ in
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
stream = makeTest (
|
stream = runTest (
|
||||||
{ pkgs, lib, ... }:
|
{ pkgs, lib, ... }:
|
||||||
let
|
let
|
||||||
galeneTestGroupBotName = "bot";
|
galeneTestGroupBotName = "bot";
|
||||||
@ -281,10 +276,7 @@ in
|
|||||||
with subtest("galene starts"):
|
with subtest("galene starts"):
|
||||||
# Starts?
|
# Starts?
|
||||||
machine.wait_for_unit("galene")
|
machine.wait_for_unit("galene")
|
||||||
|
machine.wait_for_open_port(${builtins.toString galenePort})
|
||||||
# Keeps running after startup?
|
|
||||||
machine.sleep(10)
|
|
||||||
machine.wait_for_unit("galene")
|
|
||||||
|
|
||||||
# Reponds fine?
|
# Reponds fine?
|
||||||
machine.succeed("curl -s -D - -o /dev/null 'http://localhost:${builtins.toString galenePort}' >&2")
|
machine.succeed("curl -s -D - -o /dev/null 'http://localhost:${builtins.toString galenePort}' >&2")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user