From 46b4a9d74a1b78978a8058eac07feaea613bf096 Mon Sep 17 00:00:00 2001 From: Yorick van Pelt Date: Tue, 11 Oct 2022 13:01:23 +0200 Subject: [PATCH] pimilter: fix some tests using libredirect --- pkgs/development/python-modules/pymilter/default.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/pymilter/default.nix b/pkgs/development/python-modules/pymilter/default.nix index 6362ba2cfb35..46ca3d27c3aa 100644 --- a/pkgs/development/python-modules/pymilter/default.nix +++ b/pkgs/development/python-modules/pymilter/default.nix @@ -1,4 +1,4 @@ -{ lib, python, buildPythonPackage, fetchFromGitHub, libmilter, bsddb3, pydns }: +{ lib, python, buildPythonPackage, fetchFromGitHub, libmilter, bsddb3, pydns, iana-etc, libredirect }: buildPythonPackage rec { pname = "pymilter"; @@ -19,7 +19,15 @@ buildPythonPackage rec { ''; # requires /etc/resolv.conf - doCheck = false; + # testpolicy: requires makemap (#100419) + # using exec -a makemap smtpctl results in "unknown group smtpq" + preCheck = '' + echo "nameserver 127.0.0.1" > resolv.conf + export NIX_REDIRECTS=/etc/protocols=${iana-etc}/etc/protocols:/etc/resolv.conf=$(realpath resolv.conf) + export LD_PRELOAD=${libredirect}/lib/libredirect.so + sed -i '/testpolicy/d' test.py + rm testpolicy.py + ''; meta = with lib; { homepage = "http://bmsi.com/python/milter.html";