OXIESEC PANEL
- Current Dir:
/
/
opt
/
cloudlinux
/
venv
/
lib
/
python3.11
/
site-packages
/
psutil
/
tests
Server IP: 2a02:4780:11:1084:0:327f:3464:10
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/07/2025 10:01:34 PM
rwxr-xr-x
📄
__init__.py
57.85 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
__main__.py
293 bytes
12/18/2024 10:23:15 AM
rw-r--r--
📁
__pycache__
-
02/07/2025 10:01:34 PM
rwxr-xr-x
📄
runner.py
10.94 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
test_aix.py
4.4 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
test_bsd.py
20.56 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
test_connections.py
20.42 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
test_contracts.py
27.1 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
test_linux.py
93.05 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
test_memleaks.py
14.68 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
test_misc.py
33.84 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
test_osx.py
6.43 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
test_posix.py
16.62 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
test_process.py
61.61 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
test_sunos.py
1.3 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
test_system.py
35.08 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
test_testutils.py
14.28 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
test_unicode.py
11.94 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
test_windows.py
34.34 KB
12/18/2024 10:23:15 AM
rw-r--r--
Editing: test_sunos.py
Close
#!/usr/bin/env python3 # Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Sun OS specific tests.""" import os import unittest import psutil from psutil import SUNOS from psutil.tests import PsutilTestCase from psutil.tests import sh @unittest.skipIf(not SUNOS, "SUNOS only") class SunOSSpecificTestCase(PsutilTestCase): def test_swap_memory(self): out = sh('env PATH=/usr/sbin:/sbin:%s swap -l' % os.environ['PATH']) lines = out.strip().split('\n')[1:] if not lines: raise ValueError('no swap device(s) configured') total = free = 0 for line in lines: line = line.split() t, f = line[-2:] total += int(int(t) * 512) free += int(int(f) * 512) used = total - free psutil_swap = psutil.swap_memory() self.assertEqual(psutil_swap.total, total) self.assertEqual(psutil_swap.used, used) self.assertEqual(psutil_swap.free, free) def test_cpu_count(self): out = sh("/usr/sbin/psrinfo") self.assertEqual(psutil.cpu_count(), len(out.split('\n'))) if __name__ == '__main__': from psutil.tests.runner import run_from_name run_from_name(__file__)