aboutsummaryrefslogtreecommitdiffstats
path: root/tests/by-name/sh/sharkey/test.nix
diff options
context:
space:
mode:
Diffstat (limited to 'tests/by-name/sh/sharkey/test.nix')
-rw-r--r--tests/by-name/sh/sharkey/test.nix87
1 files changed, 14 insertions, 73 deletions
diff --git a/tests/by-name/sh/sharkey/test.nix b/tests/by-name/sh/sharkey/test.nix
index 0d79cd2..7b6f537 100644
--- a/tests/by-name/sh/sharkey/test.nix
+++ b/tests/by-name/sh/sharkey/test.nix
@@ -1,66 +1,21 @@
{
- nixos-lib,
- pkgsUnstable,
- nixpkgs-unstable,
- vhackPackages,
- pkgs,
extraModules,
- nixLib,
+ vhack,
...
}:
-nixos-lib.runTest {
- hostPkgs = pkgs; # the Nixpkgs package set used outside the VMs
-
+vhack.runTest {
name = "sharkey";
- node = {
- specialArgs = {inherit pkgsUnstable extraModules vhackPackages nixpkgs-unstable nixLib;};
-
- # Use the nixpkgs as constructed by the `nixpkgs.*` options
- pkgs = null;
- };
+ serverDomains = [
+ {server = "sharkey.server";}
+ ];
nodes = {
- acme = {...}: {
- imports = [
- ../../../common/acme/server.nix
- ../../../common/dns/client.nix
- ];
- };
- name_server = {nodes, ...}: {
- imports =
- extraModules
- ++ [
- ../../../common/acme/client.nix
- ../../../common/dns/server.nix
- ];
-
- vhack.dns.zones = {
- "sharkey.server" = {
- SOA = {
- nameServer = "ns";
- adminEmail = "admin@server.com";
- serial = 2025012301;
- };
- useOrigin = false;
-
- A = [
- nodes.server.networking.primaryIPAddress
- ];
- AAAA = [
- nodes.server.networking.primaryIPv6Address
- ];
- };
- };
- };
-
server = {config, ...}: {
imports =
extraModules
++ [
../../../../modules
- ../../../common/acme/client.nix
- ../../../common/dns/client.nix
];
vhack = {
@@ -73,30 +28,16 @@ nixos-lib.runTest {
};
};
- client = {...}: {
- imports = [
- ../../../common/acme/client.nix
- ../../../common/dns/client.nix
- ];
- };
+ client = {...}: {};
};
- testScript = {nodes, ...}: let
- acme = import ../../../common/acme {inherit pkgs;};
- in
- acme.prepare ["server" "client"]
- # Python
- ''
- server.wait_for_unit("sharkey.service")
-
- with subtest("All services running"):
- import json
- def all_services_running(host):
- (status, output) = host.systemctl("list-units --state=failed --plain --no-pager --output=json")
- host_failed = json.loads(output)
- assert len(host_failed) == 0, f"Expected zero failing services, but found: {json.dumps(host_failed, indent=4)}"
- all_services_running(server)
+ services = [
+ {server = "sharkey.service";}
+ ];
- client.wait_until_succeeds("curl --silent https://sharkey.server | grep 'Thank you for using Sharkey!'")
- '';
+ testScript = {...}:
+ # Python
+ ''
+ client.wait_until_succeeds("curl --verbose https://sharkey.server | grep 'Thank you for using Sharkey!'")
+ '';
}