aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSoispha Peetz <soispha@b-peetz.de>2026-11-26 01:17:57 +0100
committerSoispha Peetz <soispha@b-peetz.de>2026-11-27 00:55:53 +0100
commit35a4a961db8202df701c10f014ff500da92b21e4 (patch)
tree4e105784a7e206bf790e6b985bdc4eca48ee448c
parenttests/common/dns/{server,client}: Adopt to the new `unbound` dns server (diff)
downloadnixos-server-35a4a961db8202df701c10f014ff500da92b21e4.zip
tests: Wait for nginx to reload before checking certificate acquisition
Diffstat (limited to '')
-rw-r--r--tests/default.nix29
1 files changed, 18 insertions, 11 deletions
diff --git a/tests/default.nix b/tests/default.nix
index 6ab6b5f..b9d741b 100644
--- a/tests/default.nix
+++ b/tests/default.nix
@@ -17,6 +17,13 @@
value = attr.${name};
};
+ nodeImports = [
+ ./common/acme/client.nix
+ ./common/dns/client.nix
+
+ ../modules
+ ];
+
vhack.runTest = {
name,
# Node definition, like in a normal nixos vm test.
@@ -24,11 +31,13 @@
# Extra DNS configuration with the node's config as input.
# Example:
# ```
- # server1 = {config, ...}: {
- # "domain.example.org" = {
- # TXT = [ "test" ];
- # };
- # };
+ # {
+ # server1 = {config, ...}: {
+ # "domain.example.org" = {
+ # TXT = [ "test" ];
+ # };
+ # };
+ # }
# ```
# That will add the TXT record to the `domain.example.org` domain, the `config` will
# be from the `server1` node.
@@ -126,12 +135,7 @@
args.nodes
(builtins.mapAttrs (_: _: {
- imports = [
- ./common/acme/client.nix
- ./common/dns/client.nix
-
- ../modules
- ];
+ imports = nodeImports;
})
args.nodes)
];
@@ -251,6 +255,9 @@
case ("exited", "dead") | ("exited", "dead") if renewRan:
# The unit is done, so it should be good?
+ # Wait until nginx is up and running again (so nginx has time to reload
+ # after getting the new certificates.)
+ host.wait_for_unit("nginx")
host.require_unit_state(unitMain, "active")
host.succeed(f"${pkgs.lib.getExe pkgs.openssl} s_client -connect {domain}:443 -verify_return_error </dev/null")
return ("Done", None, None)