at 18.09-beta 740 B view raw
1import ./make-test.nix { 2 name = "bind"; 3 4 machine = { pkgs, lib, ... }: { 5 services.bind.enable = true; 6 services.bind.extraOptions = "empty-zones-enable no;"; 7 services.bind.zones = lib.singleton { 8 name = "."; 9 file = pkgs.writeText "root.zone" '' 10 $TTL 3600 11 . IN SOA ns.example.org. admin.example.org. ( 1 3h 1h 1w 1d ) 12 . IN NS ns.example.org. 13 14 ns.example.org. IN A 192.168.0.1 15 ns.example.org. IN AAAA abcd::1 16 17 1.0.168.192.in-addr.arpa IN PTR ns.example.org. 18 ''; 19 }; 20 }; 21 22 testScript = '' 23 $machine->waitForUnit('bind.service'); 24 $machine->waitForOpenPort(53); 25 $machine->succeed('host 192.168.0.1 127.0.0.1 | grep -qF ns.example.org'); 26 ''; 27}