diff options
| author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-07-18 22:35:46 +0200 |
|---|---|---|
| committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-07-18 22:35:46 +0200 |
| commit | b84c9c7382dc05d1ff5f3bdaf2bac7ce3c332007 (patch) | |
| tree | 42b64963341fc7e6251e16c68dfbdb4b3be54aa1 /tests/by-name/at | |
| parent | scripts/update_hosts.sh: Use faster `nix copy` and ping hosts after update (diff) | |
| download | nixos-server-b84c9c7382dc05d1ff5f3bdaf2bac7ce3c332007.zip | |
tests: Refactor to unify tests and avoid duplicated code
Diffstat (limited to 'tests/by-name/at')
| -rw-r--r-- | tests/by-name/at/atuin-sync/test.nix | 69 |
1 files changed, 11 insertions, 58 deletions
diff --git a/tests/by-name/at/atuin-sync/test.nix b/tests/by-name/at/atuin-sync/test.nix index 0f2cd24..627e89e 100644 --- a/tests/by-name/at/atuin-sync/test.nix +++ b/tests/by-name/at/atuin-sync/test.nix @@ -7,63 +7,26 @@ extraModules, nixLib, turtle, + vhack, ... }: -nixos-lib.runTest { - hostPkgs = pkgs; +vhack.runTest { name = "atuin-sync"; - - node = { - specialArgs = {inherit pkgsUnstable vhackPackages nixpkgs-unstable nixLib;}; - - # Use the nixpkgs as constructed by the `nixpkgs.*` options - pkgs = null; - }; + serverDomains = [ + { + server = "atuin-sync.server"; + } + ]; nodes = let atuinSession = "01969ec6b8d07e30a9d2df0911fbfe2a"; atuin = turtle.packages."${pkgs.stdenv.hostPlatform.system}".default; in { - 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 = { - "atuin-sync.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 = { @@ -77,11 +40,6 @@ nixos-lib.runTest { }; client1 = {config, ...}: { - imports = [ - ../../../common/acme/client.nix - ../../../common/dns/client.nix - ]; - environment.sessionVariables.ATUIN_SESSION = atuinSession; environment.systemPackages = [ @@ -90,11 +48,6 @@ nixos-lib.runTest { ]; }; client2 = {config, ...}: { - imports = [ - ../../../common/acme/client.nix - ../../../common/dns/client.nix - ]; - environment.sessionVariables.ATUIN_SESSION = atuinSession; environment.systemPackages = [ @@ -104,6 +57,10 @@ nixos-lib.runTest { }; }; + services = [ + {server = "turtle.service";} + ]; + testScript = {nodes, ...}: let mkSyncConfig = pkgs.writeShellScript "register-atuin-sync-account" '' mkdir --parents ~/.config/atuin/ @@ -136,13 +93,9 @@ nixos-lib.runTest { run_and_record_in_atuin "$@" ''; - - acme = import ../../../common/acme {inherit pkgs;}; in - acme.prepare ["server" "client1" "client2"] # Python '' - server.wait_for_unit("turtle.service") server.wait_for_open_port(443) # Wait for the server to acquire the acme certificate |
