Server : LiteSpeed
System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
User : nandedex ( 1060)
PHP Version : 8.1.33
Disable Function : NONE
Directory :  /opt/cppython/lib/python3.8/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]


Current File : //opt/cppython/lib/python3.8/test/__pycache__/test_ioctl.cpython-38.pyc
U

>��g��	@sddlZddlZddlmZmZddlZddlZed�Zed�Zeed�ze	dd�Z
Wnek
rve�d��YnXXe
�e�
e
ejd	�ZW5QRXe�d
e�dZee��e�d�fkr�e�d��[
[[zddlZWnek
r�dZYnXGdd
�d
ej�Zedk�re��dS)�N)�
import_module�
get_attribute�fcntl�termios�	TIOCGPGRP�/dev/tty�rbzUnable to open /dev/tty�    �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}|�
||�W5QRXdS)Nrrrr	r
)�os�getpgrp�getsid�openr�ioctlrr�struct�unpack�assertIn)�self�ids�tty�r�rpgrp�r�./opt/cppython/lib/python3.8/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�}W5QRX|d}|�|d�|�||�dS)Nr
ri���rr�)�array�itemsizerr
r�extendZassertEqual�len�appendrrrrrr)	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)Nir&r'rrr�test_ioctl_mutate_1024;sz!IoctlTests.test_ioctl_mutate_1024cCs|�d�dS)Nir&r'rrr�test_ioctl_mutate_2048@sz!IoctlTests.test_ioctl_mutate_2048c	Cs�tst�d��t��\}}zltjdkr8tj}tjd@}ntj}t�	dt�
dtj��\}t�
ddddd�}t�|||�}t�|||�}W5t�|�t�|�XdS)	Nzpty module requiredrl��r
�IZHHHH�P�)
�pty�unittest�SkipTest�openptyr�closerZ
TIOCSWINSZrr�packrr)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*r4rrrrrs	
r�__main__)rr/Ztest.supportrrrrrrrr�OSErrorr0rrrrrr
rr.�ImportErrorZTestCaserr5�mainrrrr�<module>s.


>


F1le Man4ger