about summary refs log tree commit diff stats
path: root/tests/by-name/em/email-http/test.nix
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-06-07 14:20:03 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-06-07 14:20:03 +0200
commit4214e54d6e0a64909b45b2191af5e233100d73fa (patch)
treebe182ccc6f299a42702cb5edcded2934afa88199 /tests/by-name/em/email-http/test.nix
parentpkgs/sharkey: Remove nixpkgs unstable wrapper (diff)
downloadnixos-server-4214e54d6e0a64909b45b2191af5e233100d73fa.zip
tests/{atuin-sync,email-{dns,http},sharkey,taskchampion-sync}: Share acme setup
In the wake of `network-online.target`'s removal from `multi-user.target`,
I noticed, that this acme ca setup code is effectively duplicated. This
commit now deduplicates it.
Diffstat (limited to 'tests/by-name/em/email-http/test.nix')
-rw-r--r--tests/by-name/em/email-http/test.nix21
1 files changed, 3 insertions, 18 deletions
diff --git a/tests/by-name/em/email-http/test.nix b/tests/by-name/em/email-http/test.nix
index f508b9f..82b4c45 100644
--- a/tests/by-name/em/email-http/test.nix
+++ b/tests/by-name/em/email-http/test.nix
@@ -71,32 +71,17 @@ in
 
     # TODO(@bpeetz): This test should also test the http JMAP features of stalwart-mail. <2025-04-12>
     testScript = _: let
-      acme_scripts = import ../../../common/acme/scripts.nix {inherit pkgs;};
+      acme = import ../../../common/acme {inherit pkgs;};
     in
-      /*
-      python
-      */
+      acme.prepare ["mail_server" "bob"]
+      # Python
       ''
-        # Start dependencies for the other services
-        acme.start()
-        acme.wait_for_unit("pebble.service")
-        name_server.start()
-        name_server.wait_for_unit("nsd.service")
-
-        # Start the actual testing machines
-        start_all()
-
         mail_server.wait_for_unit("stalwart-mail.service")
         mail_server.wait_for_open_port(993) # imap
         mail_server.wait_for_open_port(465) # smtp
 
         bob.wait_for_unit("multi-user.target")
 
-        with subtest("Add pebble ca key to all services"):
-          for node in [name_server, mail_server, bob]:
-            node.wait_for_unit("network-online.target")
-            node.succeed("${acme_scripts.add_pebble_acme_ca}")
-
         with subtest("The mailserver successfully started all services"):
           import json
           def all_services_running(host):