make sysutils/py-psutil build on SecBSD
This commit is contained in:
parent
09b3080379
commit
e2e2ced49d
15 changed files with 528 additions and 3 deletions
|
@ -0,0 +1,74 @@
|
|||
Index: psutil/tests/test_process.py
|
||||
--- psutil/tests/test_process.py.orig
|
||||
+++ psutil/tests/test_process.py
|
||||
@@ -30,6 +30,7 @@ from psutil import NETBSD
|
||||
from psutil import OPENBSD
|
||||
from psutil import OSX
|
||||
from psutil import POSIX
|
||||
+from psutil import SECBSD
|
||||
from psutil import SUNOS
|
||||
from psutil import WINDOWS
|
||||
from psutil._common import open_text
|
||||
@@ -503,7 +504,7 @@ class TestProcess(PsutilTestCase):
|
||||
# thread number, since we always have with 1 thread per process,
|
||||
# but this does not apply across all platforms (MACOS, Windows)
|
||||
p = psutil.Process()
|
||||
- if OPENBSD:
|
||||
+ if OPENBSD or SECBSD:
|
||||
try:
|
||||
step1 = p.num_threads()
|
||||
except psutil.AccessDenied:
|
||||
@@ -524,7 +525,7 @@ class TestProcess(PsutilTestCase):
|
||||
@unittest.skipIf(not HAS_THREADS, 'not supported')
|
||||
def test_threads(self):
|
||||
p = psutil.Process()
|
||||
- if OPENBSD:
|
||||
+ if OPENBSD or SECBSD:
|
||||
try:
|
||||
step1 = p.threads()
|
||||
except psutil.AccessDenied:
|
||||
@@ -546,7 +547,7 @@ class TestProcess(PsutilTestCase):
|
||||
@unittest.skipIf(not HAS_THREADS, 'not supported')
|
||||
def test_threads_2(self):
|
||||
p = self.spawn_psproc()
|
||||
- if OPENBSD:
|
||||
+ if OPENBSD or SECBSD:
|
||||
try:
|
||||
p.threads()
|
||||
except psutil.AccessDenied:
|
||||
@@ -715,7 +716,7 @@ class TestProcess(PsutilTestCase):
|
||||
# Also /proc/pid/cmdline behaves the same so it looks
|
||||
# like this is a kernel bug.
|
||||
# XXX - AIX truncates long arguments in /proc/pid/cmdline
|
||||
- if NETBSD or OPENBSD or AIX:
|
||||
+ if NETBSD or OPENBSD or SECBSD or AIX:
|
||||
self.assertEqual(p.cmdline()[0], PYTHON_EXE)
|
||||
else:
|
||||
if MACOS and CI_TESTING:
|
||||
@@ -1030,7 +1031,7 @@ class TestProcess(PsutilTestCase):
|
||||
self.assertEqual(p.num_fds(), start)
|
||||
|
||||
@skip_on_not_implemented(only_if=LINUX)
|
||||
- @unittest.skipIf(OPENBSD or NETBSD, "not reliable on OPENBSD & NETBSD")
|
||||
+ @unittest.skipIf(OPENBSD or SECBSD or NETBSD, "not reliable on OPENBSD & NETBSD")
|
||||
def test_num_ctx_switches(self):
|
||||
p = psutil.Process()
|
||||
before = sum(p.num_ctx_switches())
|
||||
@@ -1267,7 +1268,7 @@ class TestProcess(PsutilTestCase):
|
||||
except psutil.NoSuchProcess:
|
||||
pass
|
||||
except psutil.AccessDenied:
|
||||
- if OPENBSD and fun_name in ('threads', 'num_threads'):
|
||||
+ if (OPENBSD or SECBSD) and fun_name in ('threads', 'num_threads'):
|
||||
return
|
||||
raise
|
||||
else:
|
||||
@@ -1399,7 +1400,7 @@ class TestProcess(PsutilTestCase):
|
||||
elif name == "name":
|
||||
assert name, name
|
||||
|
||||
- if not OPENBSD:
|
||||
+ if not (OPENBSD or SECBSD):
|
||||
self.assertIn(0, psutil.pids())
|
||||
assert psutil.pid_exists(0)
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue