diff options
Diffstat (limited to 'tests/by-name/ro/rocie')
| -rw-r--r-- | tests/by-name/ro/rocie/test.nix | 89 |
1 files changed, 15 insertions, 74 deletions
diff --git a/tests/by-name/ro/rocie/test.nix b/tests/by-name/ro/rocie/test.nix index c2ba97a..1f0fccb 100644 --- a/tests/by-name/ro/rocie/test.nix +++ b/tests/by-name/ro/rocie/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 = "rocie"; - node = { - specialArgs = {inherit pkgsUnstable extraModules vhackPackages nixpkgs-unstable nixLib;}; - - # Use the nixpkgs as constructed by the `nixpkgs.*` options - pkgs = null; - }; + serverDomains = [ + {server = "rocie.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 = { - "rocie.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 ]; age.identityPaths = ["${../../../common/email/hostKey}"]; @@ -76,31 +31,17 @@ 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("rocie.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 = "rocie.service";} + ]; - client.wait_until_succeeds("curl --verbose https://rocie.server/api/can-be-provisioned > out.file") - client.copy_from_vm("out.file") - ''; + testScript = {...}: + # Python + '' + client.wait_until_succeeds("curl --verbose https://rocie.server/api/can-be-provisioned > out.file") + client.copy_from_vm("out.file") + ''; } |
