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: //usr/local/lib/python3.7/test/__pycache__/test_ioctl.cpython-37.pyc
B

��g��@sddlZddlZddlmZmZddlZddlZed�Zed�Zeed�ye	dd�Z
Wnek
rve�d��YnPXe�
e
ejd	�Ze
��e�d
e�dZee��e�d�fkr�e�d��[
[[yddlZWnek
r�dZYnXGdd
�d
ej�Zedk�re��dS)�N)�
import_module�
get_attribute�fcntl�termios�	TIOCGPGRPz/dev/tty�rbzUnable to open /dev/ttyz    �izBNeither the process group nor the session are attached to /dev/ttyc@s>eZdZdd�Zddd�Zdd�Zdd	�Zd
d�Zdd
�ZdS)�
IoctlTestsc	CsXt��t�d�f}tdd��2}t�|tjd�}t�	d|�d}|�
||�WdQRXdS)Nrz/dev/ttyrz    r)�os�getpgrp�getsid�openr�ioctlrr�struct�unpack�assertIn)�self�ids�tty�r�rpgrp�r�+/usr/local/lib/python3.7/test/test_ioctl.py�
test_ioctls
zIoctlTests.test_ioctlNc		Cs�t�d�}|j}t��t�d�f}d}|dk	rX|�|g||�|�t|�||�n
|�|�t	dd��}t
�|tj
|d�}WdQRX|d}|�|d�|�||�dS)Nrri���z/dev/ttyr�)�array�itemsizer
rr�extendZassertEqual�len�appendr
rrrrr)	r�nbytes�bufZintsizer�fillrrrrrr�_check_ioctl_mutate_len&s

z"IoctlTests._check_ioctl_mutate_lencCs|��dS)N)r#)rrrr�test_ioctl_mutate8szIoctlTests.test_ioctl_mutatecCs|�d�dS)Ni)r#)rrrr�test_ioctl_mutate_1024;sz!IoctlTests.test_ioctl_mutate_1024cCs|�d�dS)Ni)r#)rrrr�test_ioctl_mutate_2048@sz!IoctlTests.test_ioctl_mutate_2048c	Cs�tst�d��t��\}}zltjdkr8tj}tjd@}ntj}t�dt�dtj��\}t�ddddd�}t	�
|||�}t	�
|||�}Wdt�|�t�|�XdS)	Nzpty module requiredrl��r�IZHHHH�P�)
�pty�unittest�SkipTest�openptyrZ
TIOCSWINSZrr�packrrr
�close)rZmfdZsfdZset_winsz_opcode_maybe_negZset_winsz_opcode_posZ	our_winszZ	new_winszrrr�%test_ioctl_signed_unsigned_code_paramDs


z0IoctlTests.test_ioctl_signed_unsigned_code_param)N)	�__name__�
__module__�__qualname__rr#r$r%r&r0rrrrr	s	
r	�__main__)rr+Ztest.supportrrr
rrrr
r�OSErrorr,rrrr/rrrrr*�ImportErrorZTestCaser	r1�mainrrrr�<module>s.


>