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__/dnscmd.cpython-310.pyc
o

�/a�@s�ddlZddlZddlZddlmZddlmZddlmZm	Z	ddl
mZddlm
Z
ddlZddlmZGdd	�d	e
�ZdS)
�N)�system_session)�SamDB)�
ndr_unpack�ndr_pack)�dnsp)�SambaToolCmdTest)�dsdb_dnscs�eZdZ�fdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Z�ZS)5�DnsCmdTestCasec		sNtt|���dtjd|_dtjdtjdf|_|�d|j|j�|_t	|j�
��|_d|_d|_
|�|j�|��d	d
ddd
ddddg}gd�}ddg}gd�}ddg}gd�}|D]}|�d|�|�d|�q`|D]}|�d|�|�d|�qsddggd�|||||gd�d�|_d d!ggd"�|||||d#�|_dS)$Nz	ldap://%s�SERVERz-U%s%%%s�DC_USERNAME�DC_PASSWORDz-Hz
192.168.0.193z
192.168.0.194�SAMDOM.EXAMPLE.COMz
1.EXAMPLE.COMz
%sEXAMPLE.COMz�1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.�EXAMPLEz!@#$%^&*()_u
HIGHÿBYTEz
@.EXAMPLE.COM�.)z...z.EXAMPLE.COMz	.EXAMPLE.�zSAMDOM..EXAMPLE.COMzSAMDOM.EXAMPLE.COM 65530zSAMDOM.EXAMPLE.COM     0)zSAMDOM.EXAMPLE.COM -1r
� zSAMDOM.EXAMPLE.COM 1 1z%SAMDOM.EXAMPLE.COM SAMDOM.EXAMPLE.COMz$SAMDOM.EXAMPLE.COM 65530 65530 65530z$SAMDOM.EXAMPLE.COM     1     1     1)zSAMDOM.EXAMPLE.COM 0 65536 0zSAMDOM.EXAMPLE.COM 0 0 65536zSAMDOM.EXAMPLE.COM 65536 0 0z%s 1z%s 0 0 0z192.168.0.1z255.255.255.255)
z'1234:5678:9ABC:DEF0:0000:0000:0000:0000z'0000:0000:0000:0000:0000:0000:0000:0000z'1234:5678:9ABC:DEF0:1234:5678:9ABC:DEF0z1234:1234:1234::z1234:5678:9ABC:DEF0::z0000:0000::0000z#1234::5678:9ABC:0000:0000:0000:0000z::1z::z1:1:1:1:1:1:1:1)�textrz@#!�
)�A�AAAA�PTR�CNAME�NS�MX�SRV�TXTz
192.168.0.500z255.255.255.255/32)z'GGGG:1234:5678:9ABC:0000:0000:0000:0000z)0000:0000:0000:0000:0000:0000:0000:0000/1z'AAAA:AAAA:AAAA:AAAA:G000:0000:0000:1234z,1234:5678:9ABC:DEF0:1234:5678:9ABC:DEF0:1234z"1234:5678:9ABC:DEF0:1234:5678:9ABCz1111::1111::1111)rrrrrrr)�superr	�setUp�os�environ�dburl�creds_string�getSamDB�samdb�str�get_config_basedn�	config_dn�testip�testip2�
addCleanup�
deleteZone�addZone�append�good_records�bad_records)	�self�good_dns�bad_dns�good_mx�bad_mx�good_srv�bad_srv�bad_dn�good_dn��	__class__��?/usr/lib/python3/dist-packages/samba/tests/samba_tool/dnscmd.pyr sl
����
���zDnsCmdTestCase.setUpcCs|��|��dS)N)r*r+)r/r:r:r;�	resetZoneyszDnsCmdTestCase.resetZonecCs:d|_|�ddtjd|j|j�\}}}|�|||�dS)N�zone�dns�
zonecreater
)r=�	runsubcmdrrr!�assertCmdSuccess�r/�result�out�errr:r:r;r+}s
�zDnsCmdTestCase.addZonecCs4|�ddtjd|j|j�\}}}|�|||�dS)Nr>�
zonedeleter
)r@rrr=r!rArBr:r:r;r*�s
�zDnsCmdTestCase.deleteZonecCsfd|�d|j����}d}|jj|tj|ddgd�}i}|D]}|dd��}t|d�||<q|S)N�DC=�#,CN=MicrosoftDNS,DC=DomainDNSZones,z/(&(objectClass=dnsNode)(!(dNSTombstoned=TRUE)))�	dnsRecord�name��base�scope�
expression�attrsr)r#�get_default_basedn�search�ldb�
SCOPE_SUBTREE�decode�list)r/�	zone_name�zone_dnrN�nodes�
record_map�noderJr:r:r;�get_all_records�s��zDnsCmdTestCase.get_all_recordscCs�|jjd|j��tjddgd�}|D]}|t|j�vr!|j}nq|jj|tjddgd�}|D]}|t|j�vrH|jttj	|dd�fSq0dS)NzDC=DomainDnsZones,%sz(objectClass=dnsZone)�cnrKz(objectClass=dnsNode)rIr)
r#rQrPrRrSr$�dnrr�DnssrvRpcRecord)r/rV�record_name�zonesr=rW�records�old_packed_recordr:r:r;�get_record_from_db�s2����
����z!DnsCmdTestCase.get_record_from_dbc

Cstd}d}|�ddtjd|jd|||j�\}}}|�|||d||f�|�|jd�\}}d|_|j�	||g�}|durA|�
d	�g}	|�dd
tjd|jd||j�\}}}z|�|||d�|�d|voh||vd�Wnty~}
zWYd}
~
nd}
~
ww|�ddtjd|jd|||j�\}}}z|�
|d
�Wnty�}
z|	�|
�WYd}
~
nd}
~
ww|�ddtjd|jd|||j�\}}}z
|�|||d�Wnty�}
z|	�|
�WYd}
~
nd}
~
ww|�dd
tjd|jd||j�\}}}z|�
|d�Wnt�y}
z|	�|
�WYd}
~
nd}
~
wwt|	�dk�r8d}|	D]}|dt|�}�q(t|��dS)Nz
192.168.50.50rr>�addr
�
testrecord�'Failed to add record '%s' with type %s.rz2Unable to update dns record to have DNS_RANK_NONE.�queryz4Failed to query for a recordwhich had DNS_RANK_NONE.zVQuery for a record which had DNS_RANK_NONEsucceeded but produced no resulting records.zBSuccessfully added duplicate recordof one which had DNS_RANK_NONE.�deletez/Failed to delete recordwhich had DNS_RANK_NONE.z?Successfully queried for deleted recordwhich had DNS_RANK_NONE.z0Failed appropriate behaviour with DNS_RANK_NONE:r)r@rrr=r!rArc�rankr#�dns_replace_by_dn�fail�
assertTrue�AssertionError�
assertCmdFailr,�lenr$)
r/�
record_str�record_type_strrCrDrEr]�record�res�errors�e�err_str�errorr:r:r;�test_rank_none�s�
�
��

�
����
���
���
����zDnsCmdTestCase.test_rank_nonec
CsLd}g}|jD]�}|j|D]~}za|�ddtjd|jd|||j�\}}}|�|||d||f�|�ddtjd|jd||j�\}}}|�|||d||f�|�dd	tjd|jd|||j�\}}}|�|||d
||f�Wqty�}z|d}|�|�WYd}~qd}~wwq|dkr�|D]}	t	|	�q�|�
d
|�dSdS)zN
        For all good records, attempt to add, query and delete them.
        rr>rdr
rez$Failed to addrecord %s with type %s.rgz+Failed to queryrecord %s with qualifier %s.rhz'Failed to removerecord %s with type %s.�N�@Failed to accept valid commands. %d total failures.Errors above.)r-r@rrr=r!rArmr,�printrk)
r/�num_failures�failure_msgs�dnstyperrrCrDrEru�msgr:r:r;�test_accept_valid_commands�sZ

��
��
�
���� 

��z)DnsCmdTestCase.test_accept_valid_commandsc
Cs�d}g}|jD]�}|j|D]�}z |�ddtjd|jd|||j�\}}}|�|d||f�WntyO}z|d}|�|�|�	�WYd}~nd}~wwz |�dd	tjd|jd|||j�\}}}|�|d
||f�Wqty�}z|d}|�|�|�	�WYd}~qd}~wwq|jD]�}|j|D]�}	|j
|d}
zb|�ddtjd|jd||
|j�\}}}|�|||d||f�|�ddtjd|jd||
|	|j�	\}}}|�|d
|
||	f�|�dd	tjd|jd||
|j�\}}}|�|||d|
|f�Wq�t�y&}z|d}|�|�|�	�WYd}~q�d}~wwq�|dk�r@|D]}t|��q/|�
d|�dSdS)z}
        For all bad records, attempt to add them and update to them,
        making sure that both operations fail.
        rr>rdr
rez3Successfully added invalidrecord '%s' of type '%s'.ryNrhzJSuccessfully deleted invalidrecord '%s' of type '%s' whichshouldn't exist.rf�updatez\Successfully updated valid record '%s' of type '%s' to invalid record '%s' of the same type.�0Could not delete valid record '%s' of type '%s'.zCFailed to reject invalid commands. %d total failures. Errors above.)r.r@rrr=r!rnrmr,r<r-rAr{rk)r/r|r}r~rrrCrDrEru�
bad_record�good_recordrr:r:r;�test_reject_invalid_commands(s�

�
�
��
�
�
���

��
��
�
�
���
%
��z+DnsCmdTestCase.test_reject_invalid_commandsc	
Csd}|D]|}|j|d}|�ddtjd|jd|||j�\}}}|�|||d||f�|D]P}||kr6q/|j|d}|�ddtjd|jd||||j�	\}}}|�|d	||||f�|�ddtjd|jd||||j�	\}}}|�|d
||||f�q/qdS)a�Make sure that a record can't be updated to another type leaving
        the data the same, where that data would be incompatible with
        the new type. This is not always enforced at the C level.

        We don't try with all types, because many types are compatible
        in their representations (e.g. A records could be TXT or CNAME
        records; PTR record values are exactly the same as CNAME
        record values, etc).
        )rrrrr>rdr
re�%Failed to add record %s with type %s.r�ziSuccessfully updated record '%s' to '%s', even though the latter is of type '%s' where '%s' was expected.ziSuccessfully updated record '%s' to '%s', even though the former is of type '%s' where '%s' was expected.N�r-r@rrr=r!rArn)	r/�dnstypes�dnstype1�record1rCrDrE�dnstype2�record2r:r:r;�test_update_invalid_type|sH

��
�
�
�
���z'DnsCmdTestCase.test_update_invalid_typec
Cs|jD]r}|j|D]j}|�ddtjd|jd|||j�\}}}|�|||d||f�|dkr5|dkr5q
|�ddtjd|jd||||j�	\}}}|�|||d	|�|�dd
tjd|jd|||j�\}}}|�|||d||f�q
q|jdD]�}|�ddtjd|jdd||j�\}}}|�|||d
|�|��}tt	|d�d�}d|d|d|d|f}|�ddtjd|jdd|||j�	\}}}|�|||d|d|f�|�ddtjd|jdd|j�\}}}|�|||d|df�|�dd
tjd|jdd||j�\}}}|�|||d|df�q{|jD]d}t
|j|�dk�r*�q|j|d}	|j|d}
|j|d}|�ddtjd|jd||	|j�\}}}|�|||d|	|f�|�ddtjd|jd||
||j�	\}}}|�|d|	|
|f��qdS)Nr>rdr
rer�rrr�z4Could not update record '%s' to be exactly the same.rhr�rz(Failed to add record %s with type 'SRV'.�ryz%s %s %s %sr�z2Failed to update record '%s' of type '%s' to '%s'.rgz-Failed to query for record '%s' of type '%s'.zeSuccessfully updated record '%s' from '%s' to '%s', even though the given source record is incorrect.)r-r@rrr=r!rA�splitr$�introrn)r/r~rrrCrDrEr��new_bit�
new_record�used_record�
unused_recordr:r:r;�test_update_valid_type�s�

��
�
��
���&
��
��
��
��

��
�
��z%DnsCmdTestCase.test_update_valid_typec
CsL|�ddtjd|jddd|j�\}}}|�|d�|�d|vd	|�dS)
Nr>rdr
re�SOA�testzNSuccessfully added record of type SOA, when this type should not be available.ztype SOA is not supportedzEInvalid error message '%s' when attempting to add record of type SOA.)r@rrr=r!rnrlrBr:r:r;�test_invalid_typess
�
��z!DnsCmdTestCase.test_invalid_typesc	Cs�d}|jD]�}|j|d}|jD]�}|d7}|ddkrq||kr#q|j|d}|�ddtjd|jd|||j�\}}}|�|||d||f�|�ddtjd|jd|||j�\}}}|�|||d	||||f�|�dd
tjd|jd||j�\}}}|�|||d||||f�|�dd
tjd|jd||j�\}}}|�|||d||||f�|�dd
tjd|jd|||j�\}}}|�|||d||f�|�dd
tjd|jd|||j�\}}}|�|||d||f�qqdS)zp
        Make sure that we can add an entry with the same name as an existing one but a different type.
        rry�r>rdr
rez'Failed to add record '%s' of type '%s'.zaFailed to add record '%s' of type '%s' when a record '%s' of type '%s' with the same name exists.rgznFailed to query for record '%s' of type '%s' when a new record '%s' of type '%s' with the same name was added.zuFailed to query record '%s' of type '%s' which should have been added with the same name as record '%s' of type '%s'.rhz*Failed to delete record '%s' of type '%s'.N)r-r@rrr=r!rA)	r/�ir�r�r�r�rCrDrEr:r:r;�#test_add_overlapping_different_type&s�


��
�
�
�
�
�
�
��
����z2DnsCmdTestCase.test_add_overlapping_different_typec
Cs||�ddtjd|jdd|j|j�|�ddtjd|jdd|j|j�|�ddtjd|jdd|j�\}}}|�|�dS)Nr>rdr
rerrhrg�r@rrr=r'r!rnrBr:r:r;�test_query_deleted_recordqs��
�z(DnsCmdTestCase.test_query_deleted_recordcCs|jD]z}|�ddtjd|jd||j|d|j�\}}}|�|||�|�ddtjd|jd||j|d|j�\}}}|�|�|�ddtjd|jd||j�\}}}|�|||�|�ddtjd|jd||j|d|j�\}}}|�|||�qdS)Nr>rdr
rerrgrhr�)r/�record_typerCrDrEr:r:r;�test_add_duplicate_record}s@

�
�

�
��z(DnsCmdTestCase.test_add_duplicate_recordc
Cs�|�ddtjd|jdd|j|j�|�ddtjd|jdd|j|j�|�ddtjd|jdd|j|j�\}}}|�|�|�ddtjd|jdd|j�\}}}|�|�|�ddtjd|jdd|j|j�\}}}|�|�dS)	Nr>rdr
rerrhrg�testrecord2r�rBr:r:r;�test_remove_deleted_record�s0��

�

�


�z)DnsCmdTestCase.test_remove_deleted_recordc
CsH|�ddtjd|jdd|j|j�d�d|j���}|�ddtjd|jdd||j�|�ddtjd|jd	d
||j�|�ddtjd|jdd||j�d
�|�}|�ddtjd|jdd||j�|�ddtjd||j�dD].}|jj	d�|j�
��tjd�|�dgd�}|�
t|�d�|D]}|�
t|d�d�q�qsdS)z;
        Test dns cleanup command is working fine.
        r>rdr
�testar�{0}.{1}�	testcnamer�testnsr�testptrr�{0} 65530 65530 65530�testsrvr�cleanup)r�r�r�r�r��DC=DomainDnsZones,{0}�"(&(objectClass=dnsNode)(name={0}))�
dNSTombstonedrKry�TRUEN�r@rrr=r'r!�format�lowerr#rQrPrRrS�assertEqualror$�r/�dnshostname�
srv_recordr_rarrr:r:r;�test_cleanup_record�s@�
�
�
�

�����z"DnsCmdTestCase.test_cleanup_recordc
Csl|�ddtjd|jdd|j|j�d�d|j���}|�ddtjd|jdd	||j�|�ddtjd|jd
d||j�|�ddtjd|jdd
||j�d�|�}|�ddtjd|jdd||j�|�ddtjd|jdd|j|j�|�ddtjd||j�dD].}|jj	d�|j�
��tjd�|�dgd�}|�
t|�d�|D]}|�
t|d�d�q�q�dS)zB
        Test dns cleanup command works with no A record.
        r>rdr
�notestarr�r��notestcnamer�notestnsr�	notestptrrr��	notestsrvrrhr�)r�r�r�r�r�r�r�rKryr�Nr�r�r:r:r;�test_cleanup_record_no_A_record�sF�
�
�
�

������z.DnsCmdTestCase.test_cleanup_record_no_A_recordcCs�ddg}d}|D]3}|�ddtjd|j|d|j|j�d�||j���}d	�|�}|�ddtjd|j|d
||j�q|jj	d�|j�
��tjd�|�d
gd�}|�
t|dd
�d�d�|j���}|�ddtjd||j�|jj	d�|j�
��tjd�|�d
dgd�}|�
t|dd
�d�|dd
d}ttj|�}	d�|j���}
|�
|	jj|
�|�d|dvp�t|dd�dk�dS)a?
        Test dns cleanup command for multi-valued SRV record.

        Steps:
        - Add 2 A records host1 and host2
        - Add a SRV record srv1 and points to both host1 and host2
        - Run cleanup command for host1
        - Check records for srv1, data for host1 should be gone and host2 is kept.
        �host1�host2�srv1r>rdr
rr�r�rr�r�rIrKrr�z	host1.{0}r�r�ryz	host2.{0}�FALSEN)r@rrr=r'r!r�r�r#rQrPrRrSr�rorrr^�data�
nameTargetrlr$)r/�hosts�srv_name�hostr�r�ra�dnshostname1�dns_record_bin�dns_record_obj�dnshostname2r:r:r;�test_cleanup_multi_srv_recordsH�

�����z,DnsCmdTestCase.test_cleanup_multi_srv_recordc
Cs�d}g}ddg}|D]�\}}}}z|�ddtjd|j||||j�\}}	}
|�||	|
d|||f�|�ddtjd|j|||j�\}}	}
|�||	|
d	||f�|�ddtjd|j|||j�\}}	}
|�|d	||f�|�dd
tjd|j||||j�\}}	}
|�||	|
d||f�Wq
ty�}z|d}|�|�WYd
}~q
d
}~ww|dkr�|D]}t	|�q�|�
d|�d
Sd
S)zT
        Ensure that DNS wild card entries can be added deleted and queried
        r)z*.�MISSrz1.1.1.1)z*.SAMDOMzMISS.SAMDOMrz1.1.1.2r>rdr
z*Failed to add record %s (%s) with type %s.rgz,Failed to query record %s with qualifier %s.rhz(Failed to remove record %s with type %s.ryNrz)r@rrr=r!rArnrmr,r{rk)
r/r|r}rarJ�missr~rrrCrDrErurr:r:r;�test_dns_wildcardsNs��
���
���	
���
�����

��z!DnsCmdTestCase.test_dns_wildcardsc	CsRdD]$}|�ddd|tjd|j�\}}}|�|||d|�|�|dk�qdS)N)�w2k�dotnet�longhornr>�
serverinfoz--client-versionr
z1Failed to print serverinfo with client version %sr)r@rrr!rArl)r/�vrCrDrEr:r:r;�test_serverinfo�s 
����zDnsCmdTestCase.test_serverinfocCsD|�ddtjd|j|j�\}}}|�|||d�|�|dk�dS)Nr>�zoneinfor
zFailed to print zoneinfor)r@rrr=r!rArlrBr:r:r;�
test_zoneinfo�s
��zDnsCmdTestCase.test_zoneinfoc

Csrdgddidfdgddidfdgddidfd	gidfd	d
gidfdd
gddd�dfdd
gddd�dfgd�dddd�dfgd�idfdgidfdgidffD]h\}}}|jddtjd|j|jg|�R�\}}}|rq|�|d�n|�|||d�|�ddtjd|j|j�\}}}	|�|||	d�dd�t�d|tj	�D�}
|�
�D]\}}|�||
�|�||
|�q�qNdS)Nz	--aging=1�fAgingr�F�	--aging=0r�z
--aging=-1Tz	--aging=2z--norefreshinterval=1�1)r��dwNoRefreshIntervalz--norefreshinterval=0�0)r�z--norefreshinterval=99�--refreshinterval=99�99)r�r��dwRefreshInterval)r�z--norefreshinterval=-99r�z--refreshinterval=9999999z--norefreshinterval=9999999r>�zoneoptionsr
zzoneoptions should fail�zoneoptions shouldn't failr�z)zoneinfo shouldn't fail after zoneoptionscSsi|]\}}||�qSr:r:)�.0�kr�r:r:r;�
<dictcomp>�sz9DnsCmdTestCase.test_zoneoptions_aging.<locals>.<dictcomp>z^\s*(\w+)\s*:\s*(\w+)\s*$)
r@rrr=r!rnrA�re�findall�	MULTILINE�items�assertInr�)
r/�options�valsrwrCrDrE�info_r�info_out�info_err�infor�r�r:r:r;�test_zoneoptions_aging�sv

�
����

����
�����z%DnsCmdTestCase.test_zoneoptions_agingcCs�d|�d|j�d|j����}g}|D]*}t��}|�dtj�|_tj|_	d|_
|�dd�|_|�dd	�|_|�
t|��qtj�|j|d
dg|d��}|j�|�dS)
NrGz,DC=rH�wTypei��dwTimeStamprr�z10.10.10.10�top�dnsNode)r]�objectClassrI)r=r#rPrr^�get�
DNS_TYPE_Ar��
DNS_RANK_ZONEri�dwTtlSecondsr�r�r,rrR�Message�	from_dictrd)r/rJrar]�dns_records�r�recrr:r:r;�ldap_add_node_with_records�s&�
��z)DnsCmdTestCase.ldap_add_node_with_recordscCs�tjtjtjf}t��}t�t|��}|�|j	�}i}|�
�D]6\}}g}|||<|D])}	ttj|	�}
|
j
}t||�dkr@d}|
j|vrM|�d|f�q+|�d|f�q+q|S)Nr��nowish�R�-)rr��
DNS_TYPE_AAAA�DNS_TYPE_TXT�timer�unix_to_dns_timestampr�r[r=r�rr^r��absr�r,)r/�	re_wtypes�t�nowra�tsmapr��recs�mr�r��	timestampr:r:r;�get_timestamp_map�s*�
�z DnsCmdTestCase.get_timestamp_mapcCsdd|_|jD]A}|j|dd�D]5}|�ddtjd|jd|||j�|�ddtjd|jd|||j�|�ddtjd|jd|||j�qqd	D]}d
|��}|�|d|ig�qJg}d	D]}d|d
?d@�d|d?d@�d|d@��}|�||d��q_|�d|�|�	�}dgigdfddgigd�dfdgdgdggd�d�gd�dfdgigdfdgigdfdgdgd �id!gdfd"d#gigd$�dfd%gdgd �id&gdfd'gdgd(�id)gdfd*gigdfd+d,gigd-fd.d,gigd-fd.d/gid0gdfd1gigdfd2gdgd3�id4gdfd5dgid6d7gdfd,ggd3�dggd8�d9�gd:�dfd+ggd �gd �d;gd;gd;gd;ggd<�gd �d=�gd>�dffD]k\}}	}
}|jdd?tjd|j|jg|�R�\}}
}|�rm|�
|d@|�dA��n|�||
|dB�|�	�}|�t
|�t
|��i}|D]}||||k�r�||||<�q�|�|	|�|
D]	}|�||
��q�|}�qDdS)CNi'r�r>rdr
�frobitz�weergly�snizle)r�di@B逖�zts-r�z10.��r�)r�r��ts-multiz$--mark-old-records-static=1971-13-04zbad datez$--mark-old-records-static=1971-03-04z	--dry-run)z1would make 1/1 records static on ts-1000000.zone.z-would make 1/1 records static on ts-100.zone.z/would make 2/4 records static on ts-multi.zone.F�r�r)rrr�r�r)�ts-100�
ts-1000000r)z+made 1/1 records static on ts-1000000.zone.z'made 1/1 records static on ts-100.zone.z)made 2/4 records static on ts-multi.zone.z$--mark-old-records-static=1972-03-04z --mark-records-static-regex=snizz!--mark-records-dynamic-regex=sniz)�r�r�rrr�rrrrrrrrrrrrr�)made 6/16 records dynamic on snizle.zone.z!--mark-records-dynamic-regex=[sw]z-n)z0would make 3/4 records dynamic on ts-multi.zone.z,would make 1/1 records dynamic on ts-0.zone.z2would make 1/1 records dynamic on ts-1000000.zone.z0would make 6/16 records dynamic on weergly.zone.z.would make 1/1 records dynamic on ts-100.zone.z--mark-records-dynamic-regex=z�*made 6/16 records dynamic on frobitz.zone.z --mark-records-dynamic-regex=[i])rrrrz*made 3/4 records dynamic on ts-multi.zone.z+--mark-records-dynamic-regex=^aloooooo[qw]+z--mark-records-dynamic-regex=.z--mark-records-static-regex=.Tz$--mark-old-records-static=1997-07-07r�zSet Aging to 0z--mark-records-static-regex=weez--mark-records-static-regex=obi)rrrrrrrrrrrrrrrrz)made 6/16 records static on frobitz.zone.z$--mark-old-records-static=2222-03-04z.would make 6/16 records static on snizle.zone.z/would make 3/4 records static on ts-multi.zone.)rrrr)r�ts-10000000r)z)made 4/4 records static on ts-multi.zone.z,made 1/1 records static on ts-10000000.zone.z(made 6/16 records static on snizle.zone.r)rrrr)rrzts-0rrrrr)z*made 4/4 records dynamic on ts-multi.zone.rz&made 1/1 records dynamic on ts-0.zone.z,made 1/1 records dynamic on ts-1000000.zone.z-made 1/1 records dynamic on ts-10000000.zone.z(made 1/1 records dynamic on ts-100.zone.rz*made 6/16 records dynamic on weergly.zone.r�zzoneoptions should fail (�)r�)�maxDiffr-r@rrr=r!r�r,r
rnrAr��sortedr�)r/r~rr�tsrJr
�addrr	r��diff�output_substringsrwrCrDrE�	new_tsmap�changesr��sr:r:r;�test_zoneoptions_mark_recordss`
����
*	��
���	�
��
�
��
������
�

������9
���2�������z,DnsCmdTestCase.test_zoneoptions_mark_records)�__name__�
__module__�__qualname__rr<r+r*r[rcrxr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r
r*�
__classcell__r:r:r8r;r	s6Y	F-T2lK.2=C6r	)rrRr��
samba.authr�samba.samdbr�	samba.ndrrr�samba.dcerpcr�samba.tests.samba_tool.baserr�sambarr	r:r:r:r;�<module>s