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