summary refs log tree commit diff
path: root/nixos/tests/resolv.nix
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2022-10-07 11:40:33 +0200
committerFlorian Klink <flokli@flokli.de>2022-10-07 14:19:56 +0200
commit1224368495429216cac2418225e0f46c6f8acbe4 (patch)
tree26248bf998a329dee138d17677896b060a845655 /nixos/tests/resolv.nix
parent4e385bec15402eab76edd1c6e40a2a0638faa31a (diff)
downloadnixpkgs-1224368495429216cac2418225e0f46c6f8acbe4.tar
nixpkgs-1224368495429216cac2418225e0f46c6f8acbe4.tar.gz
nixpkgs-1224368495429216cac2418225e0f46c6f8acbe4.tar.bz2
nixpkgs-1224368495429216cac2418225e0f46c6f8acbe4.tar.lz
nixpkgs-1224368495429216cac2418225e0f46c6f8acbe4.tar.xz
nixpkgs-1224368495429216cac2418225e0f46c6f8acbe4.tar.zst
nixpkgs-1224368495429216cac2418225e0f46c6f8acbe4.zip
nixosTests.nscd: init, move DynamicUser test into there
nixosTests.systemd is quite heavy, it requires a full graphical system,
which is quite a big of a rebuild if the only thing you want to test is
whether dynamic users work.

This is now moved to an `nscd` test, which tests various NSS lookups,
making extra sure that the nscd path is tested, not the fallback path
(by hiding /etc/nsswitch.conf and /etc/hosts for getent).

nixosTests.resolv is removed. It didn't check for reverse lookups,
didn't catch nscd breaking halfway in between, and also had an
ambiguous reverse lookup - 192.0.2.1 could either reverse lookup to
host-ipv4.example.net, or host-dual.example.net.
Diffstat (limited to 'nixos/tests/resolv.nix')
-rw-r--r--nixos/tests/resolv.nix46
1 files changed, 0 insertions, 46 deletions
diff --git a/nixos/tests/resolv.nix b/nixos/tests/resolv.nix
deleted file mode 100644
index f0aa7e42aaf..00000000000
--- a/nixos/tests/resolv.nix
+++ /dev/null
@@ -1,46 +0,0 @@
-# Test whether DNS resolving returns multiple records and all address families.
-import ./make-test-python.nix ({ pkgs, ... } : {
-  name = "resolv";
-  meta = with pkgs.lib.maintainers; {
-    maintainers = [ ckauhaus ];
-  };
-
-  nodes.resolv = { ... }: {
-    networking.extraHosts = ''
-      # IPv4 only
-      192.0.2.1 host-ipv4.example.net
-      192.0.2.2 host-ipv4.example.net
-      # IP6 only
-      2001:db8::2:1 host-ipv6.example.net
-      2001:db8::2:2 host-ipv6.example.net
-      # dual stack
-      192.0.2.1 host-dual.example.net
-      192.0.2.2 host-dual.example.net
-      2001:db8::2:1 host-dual.example.net
-      2001:db8::2:2 host-dual.example.net
-    '';
-  };
-
-  testScript = ''
-    def addrs_in(hostname, addrs):
-        res = resolv.succeed("getent ahosts {}".format(hostname))
-        for addr in addrs:
-            assert addr in res, "Expected output '{}' not found in\n{}".format(addr, res)
-
-
-    start_all()
-    resolv.wait_for_unit("nscd")
-
-    ipv4 = ["192.0.2.1", "192.0.2.2"]
-    ipv6 = ["2001:db8::2:1", "2001:db8::2:2"]
-
-    with subtest("IPv4 resolves"):
-        addrs_in("host-ipv4.example.net", ipv4)
-
-    with subtest("IPv6 resolves"):
-        addrs_in("host-ipv6.example.net", ipv6)
-
-    with subtest("Dual stack resolves"):
-        addrs_in("host-dual.example.net", ipv4 + ipv6)
-  '';
-})