-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test for locan DNS resolution in machine hosting leng (#78)
This adds a failing test to keep track of progress to hopefully resolve_ #75
- Loading branch information
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |