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: //lib/python3/dist-packages/samba/tests/samba_tool/__pycache__/demote.cpython-310.pyc
o

�/a��@s(ddlZddlmZGdd�de�ZdS)�N)�SambaToolCmdTestcs(eZdZdZ�fdd�Zdd�Z�ZS)�DemoteCmdTestCasez,Test for samba-tool domain demote subcommandcs\tt|���d�tjdtjd�|_tjd|_dtjd|_|�	d|j|j�|_
dS)Nz	-U{0}%{1}�DC_USERNAME�DC_PASSWORD�	DC_SERVERz	ldap://%sz-H)�superr�setUp�format�os�environ�creds_string�	dc_server�dburl�getSamDB�samdb)�self��	__class__��?/usr/lib/python3/dist-packages/samba/tests/samba_tool/demote.pyrs�zDemoteCmdTestCase.setUpc	Cs�tjd}tjd��}|�dd|||j�\}}}|�|||�|�dd|j||dd|j�\}}}|�|||�|�dd|j||d|j�\}}}|�|||�d	�||�}d
�|�}|�dd|j|dd||j�|�dd|j|dd|j�\}}}|�|||�d
D].}|�dd|j|d|||j�|�|||�|�dd|j|dd|j�\}}}|�|||�q�|�ddd|jdtjddtjd|j�	\}}}|�|||�|�dd|j||d|j�\}}}|�|�|�dd|j|dd|j�\}}}|�|�dS)zL
        Test domain demote command will also remove dns references
        �SERVER�REALM�dns�zoneinfo�add�Az
192.168.0.193�queryz{0}.{1}z{0} 65530 65530 65530�
testrecord�SRV)�CNAME�NS�PTR�domain�demotez--serverz--configfile�
CONFIGFILEz--workgroup�DOMAIN�ALLN)	r
r�lower�	runsubcmdr�assertCmdSuccessr
r	�
assertCmdFail)	r�server�zone�result�out�err�dnshostname�
srv_record�type_rrr�test_demote_and_remove_dns#sr

�


�

�
�

�
�

�


�

�


�z,DemoteCmdTestCase.test_demote_and_remove_dns)�__name__�
__module__�__qualname__�__doc__rr3�
__classcell__rrrrrs	r)r
�samba.tests.samba_tool.baserrrrrr�<module>s