python312Packages.dissect-extfs: 3.11 -> 3.12
[NixPkgs.git] / nixos / tests / blocky.nix
blob18e7f45e1c738cebecd50730483bfe7eb6f2dccb
1 import ./make-test-python.nix {
2   name = "blocky";
4   nodes = {
5     server = { pkgs, ... }: {
6       environment.systemPackages = [ pkgs.dnsutils ];
7       services.blocky = {
8         enable = true;
10         settings = {
11           customDNS = {
12             mapping = {
13               "printer.lan" = "192.168.178.3,2001:0db8:85a3:08d3:1319:8a2e:0370:7344";
14             };
15           };
16           upstream = {
17             default = [ "8.8.8.8" "1.1.1.1" ];
18           };
19           port = 53;
20           httpPort = 5000;
21           logLevel = "info";
22         };
23       };
24     };
25   };
27   testScript = ''
28     with subtest("Service test"):
29         server.wait_for_unit("blocky.service")
30         server.wait_for_open_port(53)
31         server.wait_for_open_port(5000)
32         server.succeed("dig @127.0.0.1 +short -x 192.168.178.3 | grep -qF printer.lan")
33   '';