···11-import ../make-test-python.nix ({ pkgs, ... }: {
11+{ lib, pkgs, ... }:
22+33+{
24 name = "dnscrypt-wrapper";
35 meta = with pkgs.lib.maintainers; {
46 maintainers = [ rnhmjoj ];
···5052 server.wait_for_unit("dnscrypt-wrapper")
5153 server.wait_for_file("/var/lib/dnscrypt-wrapper/2.dnscrypt-cert.server.key")
5254 server.wait_for_file("/var/lib/dnscrypt-wrapper/2.dnscrypt-cert.server.crt")
5555+ almost_expiration = server.succeed("date --date '4days 23 hours 56min'").strip()
53565457 with subtest("The client can connect to the server"):
5558 server.wait_for_unit("tinydns")
5659 client.wait_for_unit("dnscrypt-proxy2")
5757- assert "1.2.3.4" in client.succeed(
6060+ assert "1.2.3.4" in client.wait_until_succeeds(
5861 "host it.works"
5962 ), "The IP address of 'it.works' does not match 1.2.3.4"
60636164 with subtest("The server rotates the ephemeral keys"):
6265 # advance time by a little less than 5 days
6363- server.succeed("date -s \"$(date --date '4 days 6 hours')\"")
6464- client.succeed("date -s \"$(date --date '4 days 6 hours')\"")
6666+ server.succeed(f"date -s '{almost_expiration}'")
6767+ client.succeed(f"date -s '{almost_expiration}'")
6568 server.wait_for_file("/var/lib/dnscrypt-wrapper/oldkeys")
66696770 with subtest("The client can still connect to the server"):
6871 server.wait_for_unit("dnscrypt-wrapper")
6972 client.succeed("host it.works")
7073 '';
7171-})
7272-7474+}