HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/samba/tests/__pycache__/dckeytab.cpython-310.pyc
o

�/aq�@slddlZddlZddlZddlmZddlmZddlmZddlm	Z	e�dd�Z
Gdd	�d	ej�ZdS)
�N)�Net)�enable_net_export_keytab)�tests)�LoadParmcCs$tjddkr
t|dd�St|d�S)Nr��ignore)�errors�rb)�sys�version_info�open)�filename�r�6/usr/lib/python3/dist-packages/samba/tests/dckeytab.py�
open_bytes s
rcs0eZdZ�fdd�Z�fdd�Zdd�Z�ZS)�
DCKeytabTestscsZtt|���t�|_|j��|j|��d�|_t	j
�|j�d�d�|_
|j��|_dS)N)�templatezprivate dirztest.keytab)�superr�setUpr�lp�load_default�insta_creds�get_credentials�creds�os�path�join�get�ktfile�
get_principal�	principal��self��	__class__rrr(s
zDCKeytabTests.setUpcstt|���t�|j�dS)N)rr�tearDownr�removerr!r#rrr%0szDCKeytabTests.tearDowncCs�td|j�}|j|j|jd�tj�|j�sJd��t|j��1}d}|�	�D]}|t
jvr1||7}q&|j�d�}|d|vrD|d|vsHJd��Wd�dS1sSwYdS)N)�keytabr zkeytab was not created��@r�z'Principal not found in generated keytab)
rr�
export_keytabrr rr�existsr�read�string�	printable�split)r"�net�bytes_kt�result�c�principal_partsrrr�test_export_keytab4s
��"�z DCKeytabTests.test_export_keytab)�__name__�
__module__�__qualname__rr%r6�
__classcell__rrr#rr'sr)
rr
r.�	samba.netr�sambarr�samba.paramrr�TestCaserrrrr�<module>s