From ce5093b7872009c27070520e48f460a2e16e6e6f Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Sun, 25 Sep 2022 21:40:28 +0100 Subject: [PATCH] bind: enable unit tests --- pkgs/servers/dns/bind/default.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/dns/bind/default.nix b/pkgs/servers/dns/bind/default.nix index 2047436d8ce6..952ef5690201 100644 --- a/pkgs/servers/dns/bind/default.nix +++ b/pkgs/servers/dns/bind/default.nix @@ -4,6 +4,7 @@ , enablePython ? false, python3 , enableGSSAPI ? true, libkrb5 , buildPackages, nixosTests +, cmocka, tzdata }: stdenv.mkDerivation rec { @@ -59,8 +60,18 @@ stdenv.mkDerivation rec { EOF ''; - doCheck = false; # requires root and the net enableParallelBuilding = true; + doCheck = !stdenv.hostPlatform.isStatic; + checkTarget = "unit"; + checkInputs = [ + cmocka + ] ++ lib.optionals (!stdenv.hostPlatform.isMusl) [ + tzdata + ]; + preCheck = lib.optionalString stdenv.hostPlatform.isMusl '' + # musl doesn't respect TZDIR, skip timezone-related tests + sed -i '/^ISC_TEST_ENTRY(isc_time_formatISO8601L/d' tests/isc/time_test.c + ''; passthru.tests = { inherit (nixosTests) bind;