1import ./make-test-python.nix (
2 { pkgs, lib, ... }:
3 {
4 name = "technitium-dns-server";
5
6 nodes = {
7 machine =
8 { pkgs, ... }:
9 {
10 services.technitium-dns-server = {
11 enable = true;
12 openFirewall = true;
13 };
14 };
15 };
16
17 testScript = ''
18 import json
19
20 start_all()
21 machine.wait_for_unit("technitium-dns-server.service")
22 machine.wait_for_open_port(53)
23 curl_cmd = 'curl --fail-with-body -X GET "http://localhost:5380/api/user/login?user=admin&pass=admin"'
24 output = json.loads(machine.wait_until_succeeds(curl_cmd, timeout=10))
25 print(output)
26 assert "ok" == output['status'], "status not ok"
27 '';
28
29 meta.maintainers = with lib.maintainers; [ fabianrig ];
30 }
31)