From d29570fd37ed95954bfa58f8306dd212f506746a Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Sun, 13 Dec 2020 23:34:13 -0500 Subject: [PATCH] pythonPackages.python-prctl: disabled tests causing build failure Now disables tests using pytestCheckHook + disabledTests instead of patch file. Disables: - test_speculation_ctrl - test_mpx Enables: - test_mce_kill - test_proctitle --- .../python-modules/python-prctl/default.nix | 19 ++++++++++- .../python-prctl/skip_bad_tests.patch | 34 ------------------- 2 files changed, 18 insertions(+), 35 deletions(-) delete mode 100644 pkgs/development/python-modules/python-prctl/skip_bad_tests.patch diff --git a/pkgs/development/python-modules/python-prctl/default.nix b/pkgs/development/python-modules/python-prctl/default.nix index 2fd88858de7..dc967b54305 100644 --- a/pkgs/development/python-modules/python-prctl/default.nix +++ b/pkgs/development/python-modules/python-prctl/default.nix @@ -2,6 +2,7 @@ , buildPythonPackage , fetchPypi , libcap +, pytestCheckHook }: buildPythonPackage rec { @@ -13,9 +14,25 @@ buildPythonPackage rec { sha256 = "b4ca9a25a7d4f1ace4fffd1f3a2e64ef5208fe05f929f3edd5e27081ca7e67ce"; }; - patches = [ ./skip_bad_tests.patch ]; buildInputs = [ libcap ]; + checkInputs = [ pytestCheckHook ]; + + disabledTests = [ + # Intel MPX support was removed in GCC 9.1 & Linux kernel 5.6 + "test_mpx" + + # The Nix build sandbox has no_new_privs already enabled + "test_no_new_privs" + + # The Nix build sandbox has seccomp already enabled + "test_seccomp" + + # This will fail if prctl(PR_SET_SPECULATION_CTRL, PR_SPEC_FORCE_DISABLE) + # has been set system-wide, even outside the sandbox + "test_speculation_ctrl" + ]; + meta = { description = "Python(ic) interface to the linux prctl syscall"; homepage = "https://github.com/seveas/python-prctl"; diff --git a/pkgs/development/python-modules/python-prctl/skip_bad_tests.patch b/pkgs/development/python-modules/python-prctl/skip_bad_tests.patch deleted file mode 100644 index 19d70f234a9..00000000000 --- a/pkgs/development/python-modules/python-prctl/skip_bad_tests.patch +++ /dev/null @@ -1,34 +0,0 @@ ---- ./test_prctl.py 2018-01-26 16:02:52.000000000 -0500 -+++ ./test_prctl.py 2018-06-21 18:26:43.370065009 -0400 -@@ -154,6 +154,7 @@ - prctl.set_keepcaps(False) - self.assertEqual(prctl.get_keepcaps(), False) - -+ @unittest.skip("No access to /proc in the Nix build sandbox") - @require('set_mce_kill') - def test_mce_kill(self): - """Test the MCE_KILL setting""" -@@ -173,6 +174,7 @@ - prctl.set_name(name) - self.assertEqual(prctl.get_name(), name[:15]) - -+ @unittest.skip("The Nix build sandbox has no_new_privs already enabled") - @require('get_no_new_privs') - def test_no_new_privs(self): - """Test the no_new_privs function""" -@@ -189,6 +191,7 @@ - self.assertNotEqual(sp.returncode, 0) - os._exit(0) - -+ @unittest.skip("No access to /proc in the Nix build sandbox") - def test_proctitle(self): - """Test setting the process title, including too long titles""" - title = "This is a test!" -@@ -225,6 +228,7 @@ - os._exit(0) - self.assertRaises(OSError, prctl.set_ptracer, new_pid) - -+ @unittest.skip("The Nix build sandbox has seccomp already enabled") - @require('get_seccomp') - def test_seccomp(self): - """Test manipulation of the seccomp setting"""