def test_cmdline(self):
cmdline = [PYTHON, "-c", "import time; time.sleep(60)"]
sproc = get_test_subprocess(cmdline)
try:
self.assertEqual(' '.join(psutil.Process(sproc.pid).cmdline()),
' '.join(cmdline))
except AssertionError:
# XXX - most of the times the underlying sysctl() call on Net
# and Open BSD returns a truncated string.
# Also /proc/pid/cmdline behaves the same so it looks
# like this is a kernel bug.
if NETBSD or OPENBSD:
self.assertEqual(
psutil.Process(sproc.pid).cmdline()[0], PYTHON)
else:
raise
评论列表
文章目录