Server IP : 209.38.156.173 / Your IP : 216.73.216.122 [ Web Server : Apache/2.4.52 (Ubuntu) System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.1.2-1ubuntu2.22 Disable Function : NONE Domains : 2 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/lib/python3/dist-packages/twisted/conch/test/__pycache__/ |
Upload File : |
o �b� � @ s� d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl m Z ddlmZ ddl mZ dd lmZ ed �Zed�ZerFerFddlmZmZ G d d� de�ZdS )z) Tests for L{twisted.conch.manhole_tap}. � )�StreamServerEndpointService)�MultiService)�telnet)�error)�UsernamePassword)�usage)� requireModule)�TestCase�cryptography�pyasn1)�manhole_ssh�manhole_tapc @ sL e Zd ZdZes dZesdZdZdd� Zdd� Z d d � Z dd� Zd d� ZdS )�MakeServiceTestsz/ Tests for L{manhole_tap.makeService}. zcan't run without cryptographyzCannot run without PyASN1)s iamusers thisispasswordc C sV | � � | _t| jd��}|�d�| j�� W d � n1 sw Y t�� | _dS )z8 Create a passwd-like file with a user. �wb� :N) �mktemp�filename�open�write�join�usernamePasswordr �Options�options)�self�f� r �E/usr/lib/python3/dist-packages/twisted/conch/test/test_manhole_tap.py�setUp% s �zMakeServiceTests.setUpc C sR | � tj��}t�� �g � W d � n1 sw Y | �|jjd d� dS )zk L{manhole_tap.makeService} requires either 'telnetPort' or 'sshPort' to be given. Nr z<At least one of --telnetPort and --sshPort must be specified) �assertRaisesr � UsageErrorr r �parseOptions�assertEqual� exception�args)r �er r r �test_requiresPort. s � �z"MakeServiceTests.test_requiresPortc C s~ | j �ddg� t�| j �}| �|t� | �t|j�d� | �|jd t � | �|jd j jtj� | �|jd j jd� dS )z� L{manhole_tap.makeService} will make a telnet service on the port defined by C{--telnetPort}. It will not make a SSH service. �--telnetPortztcp:222� r �� N)r r r �makeService�assertIsInstancer r! �len�servicesr �factory�protocol�makeTelnetProtocol�endpoint�_port�r �servicer r r �test_telnetPort; s �z MakeServiceTests.test_telnetPortc C s� | j �d| �� ddddg� t�| j �}| �|t� | �t|j �d� | �|j d t � | �|j d jtj � | �|j d jjd� d S ) z� L{manhole_tap.makeService} will make a SSH service on the port defined by C{--sshPort}. It will not make a telnet service. z--sshKeyDirz--sshKeySize�512z --sshPortztcp:223r'