summary refs log tree commit diff
diff options
context:
space:
mode:
authorRobert Scott <code@humanleg.org.uk>2023-03-04 19:55:08 +0000
committerGitHub <noreply@github.com>2023-03-04 19:55:08 +0000
commit6fa6198586691e1665ded75f471c54c28792754c (patch)
tree7a1d7199af5eb7e1dc69c8e81a899dea6b362913
parent1c663ac590ef547e81b472b64145722ada1665fe (diff)
parentce5093b7872009c27070520e48f460a2e16e6e6f (diff)
downloadnixpkgs-6fa6198586691e1665ded75f471c54c28792754c.tar
nixpkgs-6fa6198586691e1665ded75f471c54c28792754c.tar.gz
nixpkgs-6fa6198586691e1665ded75f471c54c28792754c.tar.bz2
nixpkgs-6fa6198586691e1665ded75f471c54c28792754c.tar.lz
nixpkgs-6fa6198586691e1665ded75f471c54c28792754c.tar.xz
nixpkgs-6fa6198586691e1665ded75f471c54c28792754c.tar.zst
nixpkgs-6fa6198586691e1665ded75f471c54c28792754c.zip
Merge pull request #192962 from risicle/ris-bind-unit-tests
bind: enable unit tests
-rw-r--r--pkgs/servers/dns/bind/default.nix13
1 files changed, 12 insertions, 1 deletions
diff --git a/pkgs/servers/dns/bind/default.nix b/pkgs/servers/dns/bind/default.nix
index 2047436d8ce..952ef569020 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;