%PDF-1.4 %Óëéá 1 0 obj <> endobj 3 0 obj <> endobj 4 0 obj <
| Server IP : 212.252.79.165 / Your IP : 216.73.216.45 [ Web Server : Apache System : Linux 212-252-79-165.cprapid.com 5.15.0-153-generic #163-Ubuntu SMP Thu Aug 7 16:37:18 UTC 2025 x86_64 User : cehaburo ( 1001) PHP Version : 8.1.33 Disable Function : exec,passthru,shell_exec,system Domains : 48 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /lib/python3/dist-packages/systemd/test/ |
Upload File : |
from __future__ import print_function
import select
import contextlib
import errno
from systemd import login
import pytest
@contextlib.contextmanager
def skip_oserror(code):
try:
yield
except (OSError, IOError) as e:
if e.errno == code:
pytest.skip()
raise
def test_seats():
# just check that we get some sequence back
with skip_oserror(errno.ENOENT):
seats = login.seats()
assert len(seats) >= 0
def test_sessions():
with skip_oserror(errno.ENOENT):
sessions = login.sessions()
assert len(sessions) >= 0
def test_machine_names():
with skip_oserror(errno.ENOENT):
machine_names = login.machine_names()
assert len(machine_names) >= 0
def test_uids():
with skip_oserror(errno.ENOENT):
uids = login.uids()
assert len(uids) >= 0
def test_monitor():
p = select.poll()
with skip_oserror(errno.ENOENT):
m = login.Monitor("machine")
p.register(m, m.get_events())
login.machine_names()
p.poll(1)
login.machine_names()