Current File : //usr/local/apps/python3/lib/python3.11/test/__pycache__/test_ioctl.cpython-311.pyc |
�
�Ke� � �L � d dl Z d dlZd dlmZ d dlmZ d dlZd dlZ ed� � Z ed� � Z ee d� � e
dd� � Ze5 e� ee j
d � � Zddd� � n# 1 swxY w Y ej d
e� � d Ze ej � � ej d � � fvr ej d� � �[[[n# e$ r ej d� � �w xY w d dlZn
# e$ r dZY nw xY w G d
� dej � � Zedk r ej � � dS dS )� N)�
get_attribute)�
import_module�fcntl�termios� TIOCGPGRP�/dev/tty�rb� �izBNeither the process group nor the session are attached to /dev/ttyzUnable to open /dev/ttyc �4 � e Zd Zd� Zdd�Zd� Zd� Zd� Zd� ZdS ) �
IoctlTestsc �T � t j � � t j d� � f}t dd� � 5 }t � |t j d� � }t j d|� � d }| �
||� � d d d � � d S # 1 swxY w Y d S )Nr r r r
r )�os�getpgrp�getsid�openr �ioctlr r �struct�unpack�assertIn)�self�ids�tty�r�rpgrps �9/usr/local/apps/python3/lib/python3.11/test/test_ioctl.py�
test_ioctlzIoctlTests.test_ioctl s� � � �z�|�|�R�Y�q�\�\�*��
�*�d�
#�
#� &�s����C��!2�F�;�;�A��M�#�q�)�)�!�,�E��M�M�%��%�%�%� &� &� &� &� &� &� &� &� &� &� &� &���� &� &� &� &� &� &s �AB�B!�$B!Nc �H � t j d� � }|j }t j � � t j d� � f}d}|�C|� |g||z z � � | � t |� � |z |� � n|� |� � t dd� � 5 }t � |t j
|d� � }d d d � � n# 1 swxY w Y |d }| � |d� � | � ||� � d S )Nr r i���r r T)�array�itemsizer r r �extend�assertEqual�len�appendr r r r r r ) r �nbytes�buf�intsizer �fillr r r s r �_check_ioctl_mutate_lenz"IoctlTests._check_ioctl_mutate_len'