Date: Thursday, March 4, 2021 @ 13:05:22
  Author: yan12125
Revision: 880321

upgpkg: python-prctl 1.8.1-1; fix a test, skip tests that do not work with 
systemd-nspawn

Added:
  python-prctl/trunk/skip-tests.diff
Modified:
  python-prctl/trunk/PKGBUILD

-----------------+
 PKGBUILD        |   19 +++++++++++++++----
 skip-tests.diff |   37 +++++++++++++++++++++++++++++++++++++
 2 files changed, 52 insertions(+), 4 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2021-03-04 12:49:00 UTC (rev 880320)
+++ PKGBUILD    2021-03-04 13:05:22 UTC (rev 880321)
@@ -1,7 +1,8 @@
 # Maintainer: Felix Yan <felixonm...@archlinux.org>
+# Co-Maintainer: Chih-Hsuan Yen <yan12...@archlinux.org>
 
 pkgname=python-prctl
-pkgver=1.8
+pkgver=1.8.1
 pkgrel=1
 pkgdesc='Python(ic) interface to the linux prctl syscall'
 arch=('x86_64')
@@ -10,9 +11,19 @@
 depends=('python' 'libcap')
 makedepends=('python-setuptools')
 checkdepends=('iputils' 'procps-ng')
-source=("$pkgname-$pkgver.tar.gz::https://github.com/seveas/python-prctl/archive/v$pkgver.tar.gz";)
-sha512sums=('759e16053829ad556c79e9431da396bc6b740a758624ab895c1e30b3b999c1f1e29b754407a3ed226c7c69d52cf6d8f21845755a11747267f2541ffd95c77549')
+source=("$pkgname-$pkgver.tar.gz::https://github.com/seveas/python-prctl/archive/v$pkgver.tar.gz";
+        
"$pkgname-kernel-5.10.patch::https://github.com/seveas/python-prctl/pull/33.patch";
+        "skip-tests.diff")
+sha512sums=('a251b0aefbd6a16d69fd664cadf87ba16af87e7551ae474846858876007028c13b619e227518688e876f95726d327eb4793c37a34317ec8a1bf2c6ea02a31b21'
+            
'839bd732ebe4318dd11a2f0037fd60e6b79de84374ef575278cd787eac87c19b00290f5871e70ebb14301fb8a7eb2dc718a754290285cc6f2e9abe6ef161b802'
+            
'd7aa5bf2a1854892d2a62fd78f713e6a9df5ff7b6d44a676316970dba348590151d6db5e0583d039db816d361793c8d2f143836bd4113f881e823c741f462bed')
 
+prepare() {
+  cd python-prctl-$pkgver
+  patch -Np1 -i ../$pkgname-kernel-5.10.patch
+  patch -Np1 -i ../skip-tests.diff
+}
+
 build() {
   cd python-prctl-$pkgver
   python setup.py build
@@ -20,7 +31,7 @@
 
 check() {
   cd python-prctl-$pkgver
-  python -m unittest discover || echo "Tests failed"
+  python -m unittest discover
 }
 
 package() {

Added: skip-tests.diff
===================================================================
--- skip-tests.diff                             (rev 0)
+++ skip-tests.diff     2021-03-04 13:05:22 UTC (rev 880321)
@@ -0,0 +1,37 @@
+diff --git a/test_prctl.py b/test_prctl.py
+index 3e01f2f..5e19855 100644
+--- a/test_prctl.py
++++ b/test_prctl.py
+@@ -279,6 +279,7 @@ class PrctlTest(unittest.TestCase):
+             os._exit(0)
+         self.assertRaises(OSError, prctl.set_ptracer, new_pid)
+ 
++    @unittest.skip('systemd-nspawn uses seccomp')
+     @require('get_seccomp')
+     def test_seccomp(self):
+         """Test manipulation of the seccomp setting"""
+@@ -323,6 +324,8 @@ class PrctlTest(unittest.TestCase):
+                 prctl.securebits.noroot = True
+             self.assertRaises(OSError, set_true)
+ 
++    # See https://github.com/seveas/python-prctl/issues/31
++    @unittest.skip('not working in containers')
+     @require('set_speculation_ctrl')
+     def test_speculation_ctrl(self):
+        self.assertTrue(prctl.get_speculation_ctrl(prctl.SPEC_STORE_BYPASS) > 
0)
+@@ -388,6 +391,7 @@ class PrctlTest(unittest.TestCase):
+             self.assertRaises(OSError, prctl.get_unalign)
+             self.assertRaises(OSError, prctl.set_unalign, 
prctl.UNALIGN_NOPRINT)
+ 
++    @unittest.skip('systemd-nspawn adds CAP_SETUID')
+     def test_getcaps(self):
+         """Test the get_caps function"""
+         self.assertEqual(prctl.get_caps(), {prctl.CAP_EFFECTIVE: {}, 
prctl.CAP_INHERITABLE: {}, prctl.CAP_PERMITTED: {}})
+@@ -404,6 +408,7 @@ class PrctlTest(unittest.TestCase):
+             prctl.get_caps((1234,prctl.ALL_FLAGS))
+         self.assertRaises(ValueError, fail)
+ 
++    @unittest.skip('systemd-nspawn adds CAP_SETUID')
+     def test_setcaps(self):
+         """Test the setcaps function"""
+         if self.am_root:

Reply via email to