Skip to content

Commit

Permalink
test for locan DNS resolution in machine hosting leng (#78)
Browse files Browse the repository at this point in the history
This adds a failing test to keep track of progress to hopefully resolve_
#75
  • Loading branch information
cottand authored Dec 14, 2024
1 parent 7387ccb commit 0aee0f9
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
2 changes: 2 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@
systemctl-start = pkgs.callPackage ./nixos-tests/systemctl-start.nix { inherit self; };
custom-dns = pkgs.callPackage ./nixos-tests/custom-dns.nix { inherit self; };
doh-upstream = pkgs.callPackage ./nixos-tests/doh-upstream.nix { inherit self; };
# test fails, see https://github.com/cottand/leng/issues/75
#local-resolution = pkgs.callPackage ./nixos-tests/local-resolution.nix { inherit self; };
};

}))
Expand Down
41 changes: 41 additions & 0 deletions nixos-tests/local-resolution.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{ self, pkgs, home-manager, ... }:
let
nixpkgs = self.inputs.nixpkgs;
in
(nixpkgs.lib.nixos.runTest {
hostPkgs = pkgs;
defaults.documentation.enable = false;
node.specialArgs = { inherit self; };

name = "leng-local-resolution";

nodes = {
server = { config, pkgs, ... }: {
imports = [ self.nixosModules.default ];
environment.systemPackages = [ pkgs.dig ];
networking.firewall.allowedUDPPorts = [ 53 ];
networking.nameservers = [ "127.0.0.1" ];

services.leng.enable = true;
services.leng.configuration = {
blocking.sourcesStore = "/tmp";
customdnsrecords = [
"example.com IN A 1.2.3.4"
];
};
};
};

testScript =
''
start_all()
server.wait_for_unit("leng", timeout=10)
server.wait_for_open_port(53)
server.succeed(
"dig example.com"
)
'';

}).config.result

0 comments on commit 0aee0f9

Please sign in to comment.