a
    œcl_o	  ã                   @   sT   d Z ddlmZ ddlmZmZ ddlmZmZ G dd„ deƒZ	G dd„ deƒZ
d	S )
zTests for samba.dceprc.rpcecho.é    )Úecho)Úndr_packÚ
ndr_unpack)ÚRpcInterfaceTestCaseÚTestCasec                       s\   e Zd Z‡ fdd„Zdd„ Zdd„ Zdd„ Zd	d
„ Zdd„ Zdd„ Z	dd„ Z
dd„ Z‡  ZS )ÚRpcEchoTestsc                    s$   t t| ƒ ¡  t d|  ¡ ¡| _d S )Núncalrpc:)Úsuperr   ÚsetUpr   ÚrpcechoÚget_loadparmÚconn©Úself©Ú	__class__© ú</usr/lib/python3/dist-packages/samba/tests/dcerpc/rpcecho.pyr
      s    zRpcEchoTests.setUpc                 C   s0   t jd|  ¡ | jd| _|  d| j d¡¡ d S )Nr   )Zbasis_connectioné   é   )r   r   r   r   Zconn2ÚassertEqualÚAddOner   r   r   r   Útest_two_contexts   s    zRpcEchoTests.test_two_contextsc                 C   s   |   d| jj¡ d S )N)z$60a15ec5-4de8-11d7-a637-005056a20182é   )r   r   Zabstract_syntaxr   r   r   r   Útest_abstract_syntax#   s    ÿz!RpcEchoTests.test_abstract_syntaxc                 C   s   |   d| j d¡¡ d S )Nr   r   )r   r   r   r   r   r   r   Útest_addone'   s    zRpcEchoTests.test_addonec                 C   s    |   g d¢| j g d¢¡¡ d S )N)r   r   r   )r   r   ZEchoDatar   r   r   r   Útest_echodata*   s    zRpcEchoTests.test_echodatac                 C   s   |   d| j d¡¡ d S )NZfoobar)r   r   ZTestCallr   r   r   r   Ú	test_call-   s    zRpcEchoTests.test_callc                 C   s<   t  ¡ }d|_g d¢|_| j |¡}|  ddg |j¡ d S )Né   )r   r   r   r   é   r   )r   ZSurroundingÚxZsurroundingr   ZTestSurroundingr   )r   Zsurrounding_structÚyr   r   r   Útest_surrounding0   s
    
zRpcEchoTests.test_surroundingc                 C   s"   |   d| j dtdƒd ¡¡ d S )Ns      r   r   )r   r   ZrequestÚchrr   r   r   r   Útest_manual_request7   s    z RpcEchoTests.test_manual_requestc                 C   s   |   d | jj¡ d S )N)r   r   Zserver_namer   r   r   r   Útest_server_name:   s    zRpcEchoTests.test_server_name)Ú__name__Ú
__module__Ú__qualname__r
   r   r   r   r   r   r"   r$   r%   Ú__classcell__r   r   r   r   r      s   r   c                   @   s   e Zd Zdd„ Zdd„ ZdS )ÚNdrEchoTestsc                 C   s"   t  ¡ }d|_|  dt|ƒ¡ d S )Né*   ó   *)r   Úinfo1Úvr   r   ©r   r    r   r   r   Útest_info1_push@   s    zNdrEchoTests.test_info1_pushc                 C   s   t tjdƒ}|  |jd¡ d S )Nó   BéB   )r   r   r-   r   r.   r/   r   r   r   Útest_info1_pullE   s    zNdrEchoTests.test_info1_pullN)r&   r'   r(   r0   r3   r   r   r   r   r*   >   s   r*   N)Ú__doc__Zsamba.dcerpcr   Z	samba.ndrr   r   Zsamba.testsr   r   r   r*   r   r   r   r   Ú<module>   s
   %