about summary refs log tree commit diff
path: root/smoke-test.nix
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2023-07-21 18:18:05 +0300
committerVika <vika@fireburn.ru>2023-07-21 18:18:05 +0300
commita87120c2fd537ca7ae92a2999984f16afebe5621 (patch)
tree3455e58506205d05e57cf76f597cdf7142ffcfc9 /smoke-test.nix
parenta6129fb8053bf4fdec23a925ecbb2b4a46b69042 (diff)
Allow socket-activation for Kittybox
This complements passing sockets as FDs and graceful shutdown to allow
for zero-downtime restarts.
Diffstat (limited to 'smoke-test.nix')
-rw-r--r--smoke-test.nix11
1 files changed, 9 insertions, 2 deletions
diff --git a/smoke-test.nix b/smoke-test.nix
index df7583e..139117f 100644
--- a/smoke-test.nix
+++ b/smoke-test.nix
@@ -6,6 +6,8 @@ kittybox:
     kittybox = { config, pkgs, lib, ... }: {
       imports = [ kittybox.nixosModules.default ];
 
+      systemd.services.kittybox.wantedBy = lib.mkForce [];
+
       services.kittybox = {
         enable = true;
         logLevel = "info,kittybox=debug,retainer::cache=warn,h2=warn,rustls=warn";
@@ -21,9 +23,14 @@ kittybox:
   # Potentially using WebDriver
   # Could also be implemented with fantoccini
   testScript = ''
-    with subtest("Verify that Kittybox started correctly..."):
-        kittybox.wait_for_open_port(8080)
+    kittybox.wait_for_unit("default.target")
+    with subtest("Ensure that Kittybox service is socket activated..."):
+        kittybox.fail("systemctl is-active kittybox.service")
+        kittybox.succeed("systemctl is-active kittybox.socket")
+
+    with subtest("Verify that Kittybox starts correctly..."):
         kittybox.succeed("xh --no-check-status http://localhost:8080/.kittybox/micropub")
+        kittybox.succeed("systemctl is-active kittybox.service")
 
     with subtest("Onboarding should correctly work..."):
         kittybox.copy_from_host("${./onboarding.json}", "/root/onboarding.json")