AnonSec Shell
Server IP : 92.204.138.22  /  Your IP : 18.188.51.137
Web Server : Apache
System : Linux ns1009439.ip-92-204-138.us 4.18.0-553.8.1.el8_10.x86_64 #1 SMP Tue Jul 2 07:26:33 EDT 2024 x86_64
User : internationaljou ( 1019)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /proc/self/root/lib64/python3.6/site-packages/systemd/test/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /proc/self/root/lib64/python3.6/site-packages/systemd/test/test_login.py
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()

Anon7 - 2022
AnonSec Team