···1-import ../make-test-python.nix ({ pkgs, ... }: {
002 name = "dnscrypt-wrapper";
3 meta = with pkgs.lib.maintainers; {
4 maintainers = [ rnhmjoj ];
···50 server.wait_for_unit("dnscrypt-wrapper")
51 server.wait_for_file("/var/lib/dnscrypt-wrapper/2.dnscrypt-cert.server.key")
52 server.wait_for_file("/var/lib/dnscrypt-wrapper/2.dnscrypt-cert.server.crt")
05354 with subtest("The client can connect to the server"):
55 server.wait_for_unit("tinydns")
56 client.wait_for_unit("dnscrypt-proxy2")
57- assert "1.2.3.4" in client.succeed(
58 "host it.works"
59 ), "The IP address of 'it.works' does not match 1.2.3.4"
6061 with subtest("The server rotates the ephemeral keys"):
62 # advance time by a little less than 5 days
63- server.succeed("date -s \"$(date --date '4 days 6 hours')\"")
64- client.succeed("date -s \"$(date --date '4 days 6 hours')\"")
65 server.wait_for_file("/var/lib/dnscrypt-wrapper/oldkeys")
6667 with subtest("The client can still connect to the server"):
68 server.wait_for_unit("dnscrypt-wrapper")
69 client.succeed("host it.works")
70 '';
71-})
72-
···1+{ lib, pkgs, ... }:
2+3+{
4 name = "dnscrypt-wrapper";
5 meta = with pkgs.lib.maintainers; {
6 maintainers = [ rnhmjoj ];
···52 server.wait_for_unit("dnscrypt-wrapper")
53 server.wait_for_file("/var/lib/dnscrypt-wrapper/2.dnscrypt-cert.server.key")
54 server.wait_for_file("/var/lib/dnscrypt-wrapper/2.dnscrypt-cert.server.crt")
55+ almost_expiration = server.succeed("date --date '4days 23 hours 56min'").strip()
5657 with subtest("The client can connect to the server"):
58 server.wait_for_unit("tinydns")
59 client.wait_for_unit("dnscrypt-proxy2")
60+ assert "1.2.3.4" in client.wait_until_succeeds(
61 "host it.works"
62 ), "The IP address of 'it.works' does not match 1.2.3.4"
6364 with subtest("The server rotates the ephemeral keys"):
65 # advance time by a little less than 5 days
66+ server.succeed(f"date -s '{almost_expiration}'")
67+ client.succeed(f"date -s '{almost_expiration}'")
68 server.wait_for_file("/var/lib/dnscrypt-wrapper/oldkeys")
6970 with subtest("The client can still connect to the server"):
71 server.wait_for_unit("dnscrypt-wrapper")
72 client.succeed("host it.works")
73 '';
74+}
0