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 ddlmZmZmZ ddl m Z ddlmZ e d�Z e d�Ze d �Ze rBerBerBdd lmZ ddlmZ G dd � d e�ZdS )z! Tests for L{twisted.conch.tap}. � )�StreamServerEndpointService)�error)�ISSHPrivateKey�IUsernamePassword�UsernamePassword)� requireModule)�TestCase�cryptography�pyasn1ztwisted.conch.unix)�tap)�OpenSSHFactoryc @ sl e Zd ZdZes dZesdZesdZdZdd� Z dd � Z d d� Zdd � Zdd� Z dd� Zdd� Zdd� ZdS )�MakeServiceTestsz' Tests for L{tap.makeService}. zcan't run without cryptographyzCannot run without PyASN1z can't run on non-posix computers)s iamusers thisispasswordc C sV | � � | _t| jd��}|�d�| j�� W d � n1 sw Y t�� | _dS )z/ Create a file with two users. zwb+� :N) �mktemp�filename�open�write�join�usernamePasswordr �Options�options)�self�f� r �=/usr/lib/python3/dist-packages/twisted/conch/test/test_tap.py�setUp( s �zMakeServiceTests.setUpc C s@ t �� }t �|�}| �|t� | �|jjd� | �|jt � dS )z� L{tap.makeService} returns a L{StreamServerEndpointService} instance running on TCP port 22, and the linked protocol factory is an instance of L{OpenSSHFactory}. � N) r r �makeService�assertIsInstancer �assertEqual�endpoint�_port�factoryr )r �config�servicer r r � test_basic1 s zMakeServiceTests.test_basicc C sN d}| � t| jd d� | � t| jd d� | �|t| jd �d|f � dS )z� Make sure that if the C{--auth} command-line option is not passed, the default checkers are (for backwards compatibility): SSH and UNIX � �credInterfacesz)SSH should be one of the default checkersz*UNIX should be one of the default checkers�credCheckersz&There should be %d checkers by defaultN)�assertInr r r r �len)r �numCheckersr r r �test_defaultAuths= s ���z"MakeServiceTests.test_defaultAuthsc C s0 | j �dd| j g� | �t| j d �d� dS )z� The C{--auth} command-line option will add a checker to the list of checkers, and it should be the only auth checker �--auth�file:r( � N�r �parseOptionsr r r* �r r r r �test_authAddedT s zMakeServiceTests.test_authAddedc C s4 | j �dd| j ddg� | �t| j d �d� dS )z� Multiple C{--auth} command-line options will add all checkers specified to the list ofcheckers, and there should only be the specified auth checkers (no default checkers). r- r. zmemory:testuser:testpasswordr( r&