mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
nixos/whois: add test
This commit is contained in:
parent
7cc3f54c2f
commit
8c4a9691c1
2 changed files with 44 additions and 0 deletions
|
|
@ -1745,6 +1745,7 @@ in
|
|||
wg-access-server = runTest ./wg-access-server.nix;
|
||||
whisparr = runTest ./whisparr.nix;
|
||||
whoami = runTest ./whoami.nix;
|
||||
whois = runTest ./whois.nix;
|
||||
whoogle-search = runTest ./whoogle-search.nix;
|
||||
wiki-js = runTest ./wiki-js.nix;
|
||||
windmill = import ./windmill {
|
||||
|
|
|
|||
43
nixos/tests/whois.nix
Normal file
43
nixos/tests/whois.nix
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
{ lib, ... }:
|
||||
{
|
||||
name = "whois";
|
||||
meta.maintainers = with lib.maintainers; [ Cryolitia ];
|
||||
|
||||
nodes.machine = {
|
||||
imports = [ ../modules/profiles/minimal.nix ];
|
||||
|
||||
programs.whois = {
|
||||
enable = true;
|
||||
settings = [
|
||||
{
|
||||
pattern = "\\.dn42$";
|
||||
server = "whois.dn42";
|
||||
}
|
||||
{
|
||||
pattern = "\\-DN42$";
|
||||
server = "whois.dn42";
|
||||
}
|
||||
{
|
||||
pattern = "^as424242[0-9]{4}$";
|
||||
server = "whois.dn42";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
start_all()
|
||||
|
||||
machine.succeed("command -v whois")
|
||||
|
||||
whois_conf = machine.succeed("cat /etc/whois.conf").strip()
|
||||
expected = """
|
||||
# Generated by NixOS.
|
||||
# See whois.conf(5) for the file format.
|
||||
\\.dn42$ whois.dn42
|
||||
\\-DN42$ whois.dn42
|
||||
^as424242[0-9]{4}$ whois.dn42
|
||||
""".strip()
|
||||
assert whois_conf == expected
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue