HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //opt/osm/venv/lib64/python3.10/site-packages/psutil/tests/__pycache__/test_sudo.cpython-310.pyc
o

=i��@s�dZddlZddlZddlZddlZddlmZddlmZddlmZddlmZddl	m
Z
ddl	mZd	d
�Zdd�Z
Gd
d�de�ZdS)z�Tests which are meant to be run as root.

NOTE: keep this module compatible with unittest: we want to run this
file with the unittest runner, since pytest may not be installed for
the root user.
�N)�FREEBSD)�LINUX)�OPENBSD)�WINDOWS)�
CI_TESTING)�PsutilTestCasecCs(ttd�rttd�rt�tj�St��S)N�
clock_gettime�CLOCK_REALTIME)�hasattr�timerr	�rr�D/opt/osm/venv/lib/python3.10/site-packages/psutil/tests/test_sudo.py�get_systimesrcCs�ttd�r!ttd�r!z
t�tj|�WdSty t�d��wtrkddl}ddl	}t
j
�|t
jj
�}z|�|j|j|��d|j|j|j|jt|jd��WdS|jyj}z|jdkret�d���d}~wwt�d	��)
N�
clock_settimer	z
needs rootr�i�i"zneeds Administrator userzsetting systime not supported)r
rrr	�PermissionError�unittestZSkipTestr�
pywintypes�win32api�datetime�
fromtimestamp�timezone�utcZ
SetSystemTime�year�month�
isoweekday�day�hour�minute�second�int�microsecond�error�winerror)Zsecsrr�dt�errrrr
�set_systime!s8
�

�


��
r&c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Ze�	e
d
�dd��Ze�	ed
�e�	e
d�e�	ed�dd����Ze�	ed�dd��ZdS)�TestUpdatedSystemTimez$Tests which update the system clock.cCsd|_t�|_t��|_dS)NF)�time_updatedr�	orig_timer�	monotonic�time_started��selfrrr
�setUpBszTestUpdatedSystemTime.setUpcCs*|jrt��|j}t|j|�dSdS�N)r(rr*r+r&r))r-Zextra_trrr
�tearDownGs�zTestUpdatedSystemTime.tearDowncCst|jd�d|_dS)N�T)r&r)r(r,rrr
�update_systimeLs
z$TestUpdatedSystemTime.update_systimecCsDt��}|��t��}|�||�t||�}|j|ddd�dS�Nr1�)�delta)�psutilZ	boot_timer2Z
assertGreaterr �assertAlmostEqual�r-�t1�t2�diffrrr
�test_boot_timeQsz$TestUpdatedSystemTime.test_boot_timezbroken on WINDOWScCs@t����}|��t����}t||�}|j|ddd�dSr3)r6�Process�create_timer2r r7r8rrr
�test_proc_create_timeZs
z+TestUpdatedSystemTime.test_proc_create_timezskipped on CI for nowzbroken on OPENBSDzbroken on FREEBSDcCs<t��}|��t��}|�|��|���|�||�dSr/)r6r=r2�assertEqualZ
_get_ident)r-�p1Zp2rrr
�test_proc_identes
z%TestUpdatedSystemTime.test_proc_identz
LINUX onlycCsFt��jjdd�}|��t�d�t��jjdd�}|�||�dS)NT)r*g�������?)r6r=�_procr>r2r�sleepr@)r-r9r:rrr
�test_linux_monotonic_proc_timeos

z4TestUpdatedSystemTime.test_linux_monotonic_proc_timeN)�__name__�
__module__�__qualname__�__doc__r.r0r2r<rZskipIfrr?rrrrBrrErrrr
r'?s
	




r')rIrrrr6rrrrZpsutil.testsrrrr&r'rrrr
�<module>s