%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/twisted/names/test/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/twisted/names/test/__pycache__/test_names.cpython-312.pyc

�

Ϫ�f\�����dZddlZddlZddlZddlmZmZddlmZddl	m
Z
ddlmZm
Z
mZddlmZddlmZmZmZdd	lmZmZmZmZmZdd
lmZddlmZmZm Z m!Z!m"Z"m#Z#ddl$m%Z%dd
l&m'Z'm(Z(ddl)m*Z*ddl+m,Z,ddl-m.Z.d�Z/Gd�dej`�Z1ejDdddddddd��Z2ejDddddd d!d"d#��Z3ejDd$d%d&d'dd(d�)�Z4e1de2fe2ejBd*�ejjd+�ejld,�ejld-d.�ejnd/d0�ejpd1d2�3�ejrd4�ejtd5�ejvd6�ejxd7d8�ejzdd9d:�ejzd;d<d=�ejzd>d?d@�ejxdA�ej|dB�ej~dCdD�E�ej�ddF�G�ej�dHdI�J�ej�dKej�dL�ej�dd/dMdNdO�ej�dP�gej�dQdRdSdT�gejBdU�ejBdV�gejBdW�ejBdX�gejrd�gejBdY�gdZ��[�ZGe1de3fd\ej�d]�e3gi�[�ZIe1d^e4fd^e4ejBdYd_�`�ejjdadb�`�ejjdcdd�`�ej�dQdRdSdTde�`�gi�[�ZJGdf�dge.j��ZLGdh�die.j��ZMGdj�dke.j��ZNGdl�dme.j��ZOGdn�doe.j��ZPGdp�dqe.j��ZQGdr�dse.j��ZRGdt�due.j��ZSGdv�dwe.j��ZTdxZUGdy�dze.j��ZVd{ZWGd|�d}e.j��ZXy)~z
Test cases for twisted.names.
�N)�partial�reduce)�BytesIO)�pack)�defer�error�reactor)�succeed)�MemoryReactorClock�StringTransport�waitUntilAllDisconnected)�	authority�client�common�dns�server)�Resolver)�SOA�Message�Query�Record_A�
Record_SOA�RRHeader)�DomainError)�SecondaryAuthority�SecondaryAuthorityService)�nativeString)�FilePath)�unittestc�F�|dD�cgc]}|j��c}Scc}w�Nr��payload)�results�rs  �?/usr/lib/python3/dist-packages/twisted/names/test/test_names.py�justPayloadr'!s��&�q�z�*�!�A�I�I�*�*��*s�c��eZdZd�Zy)�NoFileAuthorityc�`�tjj|�||c|_|_y�N)r�ResolverBase�__init__�soa�records)�selfr.r/s   r&r-zNoFileAuthority.__init__&s&�����$�$�T�*�!$�g����$�,�N)�__name__�
__module__�__qualname__r-�r1r&r)r)%s��.r1r)�test-domain.comzroot.test-domain.com�d��i��H?&����mname�rname�serial�refresh�minimum�expire�retry�ttls93.84.28.in-addr.arpa�xi1�i~����
my-domain.comspostmaster.test-domain.com�i90i?B)r=r>r?r@rArBrCs	127.0.0.1s39.28.189.39�#v=spf1 mx/30 mx:example.org/30 -all�v=spf1 +mx a:colo�.example.com/28 -all not valid�
�host.test-domain.com�Linux�A Fast One, Dontcha know)�os�cpuscanonical.name.comsmailbox.test-domain.comsmail.group.someplace�A First piece of Text�a SecoNd pieces
ABCD::4321r1�s	0:0069::0ssome.network.tld�s$0:5634:1294:AFCB:56AC:48EF:34C3:01FFs
tra.la.la.net�+Some more text, haha!  Yes.    Still here?smail.redirect.or.whatevers
r mail boxs
e mail box)�rmailbx�emailbxsafsdb.test-domain.com)�subtype�hostnameswhatever.i.dunnossome.more.text)�mbox�txts12.54.78.12����u�sip+E2U�!!^.*$!sip:information@domain.tld!s'AF43:5634:1294:AFCB:56AC:48EF:34C3:01FF��?骪ssome.other.place.fool�123.242.1.5�0.255.0.255s255.255.255.254s0.0.0.0s1.2.3.4)r6shttp.tcp.test-domain.com�host.test-domain.comshost-two.test-domain.comscname.test-domain.comsanothertest-domain.com�r.r/s123.93.84.28.in-addr.arpastest.host-reverse.lookup.coms
my-domain.com�1S�rDs
ns1.domains2Ms
ns2.domain�3H�4Dc��eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z y) �ServerDNSTestsz/
    Test cases for DNS server and client.
    c�>�tjtttgd��|_t
j|j
�}	tjd|j
d��}|j|j�|j�j}	tj||d��}|j|j�	||_||_t'j(d|fg��|_y#tj $rYnwxYw��)N�)�verboser�	127.0.0.1)�	interface��servers)r�DNSServerFactory�test_domain_com�reverse_domain�
my_domain_com�factoryr�DNSDatagramProtocolr	�	listenTCP�
addCleanup�
stopListening�getHost�port�	listenUDPr�CannotListenError�listenerTCP�listenerUDPrr�resolver)r0�pr�r�r�s     r&�setUpzServerDNSTests.setUp�s����.�.�
�n�m�<�a�
���
�#�#�D�L�L�1���!�+�+�A�t�|�|�{�S�K�
�O�O�K�5�5�6��&�&�(�-�-�D�
�%�/�/��a�;�O������ 9� 9�:��&���&������+�t�1D�0E�F��
���*�*�
��
��s�$D�D�Dc��|jjddD]}|jj��t	t
|jjdd�S)zu
        Clean up any server connections associated with the
        L{DNSServerFactory} created in L{setUp}
        N)r{�connections�	transport�loseConnectionr
r	)r0�conns  r&�tearDownzServerDNSTests.tearDown�sP���L�L�,�,�Q�/�	,�D��N�N�)�)�+�	,�(�����1I�1I�!�1L�M�Mr1c�8�����fd�}|j|�|S)aD
        Assert that the DNS response C{querying} will eventually fire with
        contains exactly a certain collection of records.

        @param querying: A L{Deferred} returned from one of the DNS client
            I{lookup} methods.

        @param expectedRecords: A L{list} of L{IRecord} providers which must be
            in the response or the test will be failed.

        @return: A L{Deferred} that fires when the assertion has been made.  It
            fires with a success result if the assertion succeeds and with a
            L{Failure} if it fails.
        c�d��t|�}�jt��t|��yr+)r'�assertEqual�set)�response�receivedRecords�expectedRecordsr0s  ��r&�checkResultsz.ServerDNSTests.namesTest.<locals>.checkResults�s'���)�(�3�O����S��1�3��3G�Hr1)�addCallback)r0�queryingr�r�s` ` r&�	namesTestzServerDNSTests.namesTest�s��� 	I�	���\�*��r1c��|j|jjd�tjdd��g�S)z"Test simple DNS 'A' record queries�test-domain.comrsr9rk�r�r��
lookupAddressrr�r0s r&�test_addressRecord1z"ServerDNSTests.test_addressRecord1�s7���~�~��M�M�'�'�(9�:�
�\�\�+�8�
4�5�
�	
r1c��|j|jjd�tjdd��tjdd��g�S)z1Test DNS 'A' record queries with multiple answersrOz123.242.1.5r9rkz0.255.0.255r�r�s r&�test_addressRecord2z"ServerDNSTests.test_addressRecord2�sG���~�~��M�M�'�'�(>�?����]��9����]��9�
�
�	
r1c��|j|jjd�tjdd��tjdd��g�S)z+Test DNS 'A' record queries with edge caseszhost-two.test-domain.comz255.255.255.254r9rk�0.0.0.0r�r�s r&�test_addressRecord3z"ServerDNSTests.test_addressRecord3�sH���~�~��M�M�'�'�(B�C����.�H�=����Y�H�5�
�
�	
r1c�b�|j|jjd�tg�S)zTest DNS 'SOA' record queriesr�)r�r��lookupAuthority�
soa_recordr�s r&�test_authorityzServerDNSTests.test_authority�s*���~�~��M�M�)�)�*;�<�z�l�
�	
r1c	���|j|jjd�tjddd��tj
dd��tj
dd��g�S)z�
        The DNS client can issue an MX query and receive a response including
        an MX record as well as any A record hints.
        r6rNrhr9rkrfrg)r�r��lookupMailExchanger�	Record_MXrr�s r&�test_mailExchangeRecordz&ServerDNSTests.test_mailExchangeRecordsZ��
�~�~��M�M�,�,�-?�@��
�
�b�"9�x�H����^��:����^��:�
�
�	
r1c��|j|jjd�tjdd��g�S)zTest DNS 'NS' record queriesr�z39.28.189.39r9rk)r�r��lookupNameserversr�	Record_NSr�s r&�test_nameserverzServerDNSTests.test_nameservers7���~�~��M�M�+�+�,=�>�
�]�]�>�x�
8�9�
�	
r1c��|j|jjd�tjddd��g�S)zTest DNS 'HINFO' record queriesr�rPrQr9)rRrSrD)r�r��lookupHostInfor�Record_HINFOr�s r&�
test_HINFOzServerDNSTests.test_HINFOsA���~�~��M�M�(�(�):�;�� � ��%@�h��
�
�	
r1c��|j|jjd�tjdd��g�S)zTest DNS 'PTR' record queriesz123.93.84.28.in-addr.arpaztest.host-reverse.lookup.comrFrk)r�r��
lookupPointerr�
Record_PTRr�s r&�test_PTRzServerDNSTests.test_PTR s8���~�~��M�M�'�'�(C�D�
�^�^�:��
I�J�
�	
r1c��|j|jjd�tjdd��g�S)zTest DNS 'CNAME' record queriesr�zcanonical.name.comr9rk)r�r��lookupCanonicalNamer�Record_CNAMEr�s r&�
test_CNAMEzServerDNSTests.test_CNAME's:���~�~��M�M�-�-�.?�@�
�
�
�2��
A�B�
�	
r1c��|j|jjd�tjdd��g�S)zTest DNS 'MB' record queriesr�zmailbox.test-domain.comr9rk)r�r��
lookupMailBoxr�	Record_MBr�s r&�test_MBzServerDNSTests.test_MB.s8���~�~��M�M�'�'�(9�:�
�]�]�4�(�
C�D�
�	
r1c��|j|jjd�tjdd��g�S)zTest DNS 'MG' record queriesr�zmail.group.someplacer9rk)r�r��lookupMailGroupr�	Record_MGr�s r&�test_MGzServerDNSTests.test_MG5s8���~�~��M�M�)�)�*;�<�
�]�]�1�x�
@�A�
�	
r1c��|j|jjd�tjdd��g�S)zTest DNS 'MR' record queriesr�zmail.redirect.or.whateverr9rk)r�r��lookupMailRenamer�	Record_MRr�s r&�test_MRzServerDNSTests.test_MR<s8���~�~��M�M�*�*�+<�=�
�]�]�6�H�
E�F�
�	
r1c��|j|jjd�tjddd��g�S)zTest DNS 'MINFO' record queriesr�z
r mail boxz
e mail boxr9)rYrZrD)r�r��lookupMailboxInfor�Record_MINFOr�s r&�
test_MINFOzServerDNSTests.test_MINFOCs@���~�~��M�M�+�+�,=�>�� � �(�,�H��
�
�	
r1c
��|j|jjd�tjddddd��g�S)zTest DNS 'SRV' record querieszhttp.tcp.test-domain.comrcrdre�some.other.place.foolr9rk)r�r��
lookupServicer�
Record_SRVr�s r&�test_SRVzServerDNSTests.test_SRVNs>���~�~��M�M�'�'�(B�C�
�^�^�C���/F�H�
U�V�
�	
r1c��|j|jjd�tjddd��g�S)zTest DNS 'AFSDB' record queriesr�r;zafsdb.test-domain.comr9)r[r\rD)r�r��lookupAFSDatabaser�Record_AFSDBr�s r&�
test_AFSDBzServerDNSTests.test_AFSDBUsA���~�~��M�M�+�+�,=�>�� � ��(?�X��
�
�	
r1c��|j|jjd�tjddd��g�S)zTest DNS 'RP' record queriesr�zwhatever.i.dunnozsome.more.textr9)r]r^rD)r�r��lookupResponsibilityr�	Record_RPr�s r&�test_RPzServerDNSTests.test_RP`s?���~�~��M�M�.�.�/@�A��
�
�+�1A�x��
�
�	
r1c��|j|jjd�tjddd��tjdd��g�S)zTest DNS 'TXT' record queriesr�rTrUr9rkrX)r�r��
lookupTextr�
Record_TXTr�s r&�test_TXTzServerDNSTests.test_TXTksR���~�~��M�M�$�$�%6�7����,�.?�X�����C���	
�

�
	
r1c	��|j|jjd�tjdd��tjddd��g�S)zH
        L{DNSServerFactory} can serve I{SPF} resource records.
        r�rKr9rkrLrM)r�r��lookupSenderPolicyr�
Record_SPFr�s r&�test_spfzServerDNSTests.test_spfysQ���~�~��M�M�,�,�->�?����E�8�T����*�5� ��
�

�
	
r1c	��|j|jjd�tjdt
jdd��g�S)zTest DNS 'WKS' record queriesr�z12.54.78.12r_r9rk)r�r��lookupWellKnownServicesr�
Record_WKS�socket�IPPROTO_TCPr�s r&�test_WKSzServerDNSTests.test_WKS�sI���~�~��M�M�1�1�2C�D����!��&�&�3� �	�
�

�
	
r1c�l�tjt�}tj|_|j	|j
j
d�|tjdd��tjdd��tjdd��tjd	d
ddd
��g�S)NrI�1.2.3.4rjrkz
ns1.domain�2Mz
ns2.domainrlrcrdrer�rm)�copy�my_soarBrDr�r��lookupAllRecordsrrr�r�)r0�
result_soas  r&�test_someRecordsWithTTLsz'ServerDNSTests.test_someRecordsWithTTLs�s����Y�Y�v�&�
����
���~�~��M�M�*�*�?�;�����Y�D�1��
�
�l��5��
�
�l��5����s�E�5�2I�t�T�
�	
�		
r1c��|j|jjd�tjdd��g�S)z%Test DNS 'AAAA' record queries (IPv6)r�z'AF43:5634:1294:AFCB:56AC:48EF:34C3:01FFr9rk)r�r��lookupIPV6Addressr�Record_AAAAr�s r&�	test_AAAAzServerDNSTests.test_AAAA�s8���~�~��M�M�+�+�,=�>�
�_�_�F�H�
U�V�
�	
r1c���|j|jjd�tjdddd��tjddd	d��tjd
ddd��g�S)
z#Test DNS 'A6' record queries (IPv6)r�rz
ABCD::4321�r9rkrVz	0:0069::0zsome.network.tldrWz$0:5634:1294:AFCB:56AC:48EF:34C3:01FFz
tra.la.la.net)r�r��lookupAddress6r�	Record_A6r�s r&�test_A6zServerDNSTests.test_A6�sh���~�~��M�M�(�(�):�;��
�
�a��r�x�@��
�
�b�+�/A�x�P��
�
��:�#� �	�	
�
�	
r1c��tj}ttjt
jj��D�cgc]}tj|���}}|D]}|j��||_	�|j|jjd�jd��|�Scc}w)z9
        Test DNS 'AXFR' queries (Zone transfer)
        r�c��|dddfS)Nr���r5)r%s r&�<lambda>z2ServerDNSTests.test_zoneTransfer.<locals>.<lambda>�s��1�Q�4���9�,�r1)r�rBr�operator�addrxr/�valuesr�rDr�r��
lookupZoner�)r0�default_ttlr%r$s    r&�test_zoneTransferz ServerDNSTests.test_zoneTransfer�s���!�'�'��"(�����7N�7N�7U�7U�7W�"X�
��D�I�I�a�L�
��
��	$�A��u�u�}�#���	$��~�~��M�M�$�$�%6�7�C�C�&�
�
�	
�	
��

s�	B=c�z�tdg��}|j|jd�tj�S)zu
        A failed AXFR TCP connection errbacks the L{Deferred} returned
        from L{Resolver.lookupZone}.
        )znameserver.invalid�5ruzimpossible.invalid)r�
assertFailurerr�DNSLookupError)r0r�s  r&� test_zoneTransferConnectionFailsz/ServerDNSTests.test_zoneTransferConnectionFails�s<��
�%?�$@�A���!�!���� 4�5�u�7K�7K�
�	
r1c��|j|jjd�tjdd��g�S)z6Tests that unrelated zones don't mess with each other.zanothertest-domain.comr�r9rkr�r�s r&�test_similarZonesDontInterferez-ServerDNSTests.test_similarZonesDontInterfere�s7���~�~��M�M�'�'�(@�A�
�\�\�)��
2�3�
�	
r1c��|j|jjd�tjdddddd��g�S)	z2
        Test DNS 'NAPTR' record queries.
        r�r7rNr`rarbr9rk)r�r��lookupNamingAuthorityPointerr�Record_NAPTRr�s r&�
test_NAPTRzServerDNSTests.test_NAPTR�sM���~�~��M�M�6�6�7H�I�� � �����8� �
�	
�
�	
r1N)!r2r3r4�__doc__r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrr	r
r5r1r&roro�s����G�<N��.
�
�
�
�
�
�	
�
�
�
�
�
�	
�
�	
�	
�
�
� 
�
�
�
� 
�$
�
�
r1roc��eZdZd�Zy)�HelperTestsc���|j�}tj|�}td�D]-}tj|�}|j	||k�|}�/y)N�)�mktempr�	getSerial�range�
assertTrue)r0�f�a�i�bs     r&�test_serialGeneratorz HelperTests.test_serialGenerator�sU���K�K�M������"���r��	�A��#�#�A�&�A��O�O�A��E�"��A�	r1N)r2r3r4rr5r1r&rr�s��r1rc�*�eZdZd�Zd�Zd�Zd�Zd�Zy)�	AXFRTestsc��d|_tj�|_|jj	|j
�t
jd|j�|_tjdtjtjddtjddddddd	d
����|_|jtjdtjtjd
dtj dd
����tjdtj"tjd
dtj$ddd
����tjdtj&tjd
dtj(dd
����|jg|_y)N�	fooby.comi�QFzhooj.fooby.comr7��i,i�i�iX)r=r>r?r@rCrBrArD��name�type�clsrD�authr#��ns.twistedmatrix.com�r"rDrNz
mail.mv3d.com)�
preference�exchangerDz
64.123.27.105)�addressrD)r$r�Deferred�dr��_gotResultsr�AXFRController�
controllerrrr�INrr.�NSr��MXr��Arr/r�s r&r�zAXFRTests.setUp�sH��������!��������4�+�+�,� �/�/��T�V�V�D����<�<�����������N�N�!�&�������	�

���&
�H�H��L�L� ��V�V��F�F����
�
�+A�s�K�

�
�L�L� ��V�V��F�F����
�
��o�SV�W�

�
�L�L� ��U�U��F�F������_�#�F�

�
�H�H�5
��r1c�>�tjddddddddd��	S)N��r;r�	�id�answer�opCode�recDes�recAvr%�rCode�trunc�maxSize)rrr�s r&�_makeMessagezAXFRTests._makeMessage2s.���{�{����������

�
	
r1c�<�|j�}tjdtjtj�g|_|j|_|jj|d�|j|j|j�y)Nr)r@rr�AXFRr1�queriesr/�answersr0�messageReceivedr�r$)r0�ms  r&�test_bindAndTNamesStylez!AXFRTests.test_bindAndTNamesStyle@sf��������Y�Y�{�C�H�H�c�f�f�=�>��	��L�L��	����'�'��4�0�������t�|�|�4r1c��||_yr+)r$)r0�results  r&r.zAXFRTests._gotResultsHs	����r1c��|jdd}|rM|j�}g|_|jd�g|_|j
j
|d�|r�M|j|j|j�yr!)	r/r@rC�poprDr0rEr�r$)r0r/rFs   r&�
test_DJBStylezAXFRTests.test_DJBStyleKsl���,�,�q�/����!�!�#�A��A�I� ���Q��(�A�I��O�O�+�+�A�t�4�	�
	
������t�|�|�4r1N)r2r3r4r�r@rGr.rLr5r1r&rr�s��3
�j
�5��5r1rc��eZdZd�Zd�Zy)�ResolvConfHandlingTestsc��|j�}tj|��}|j|jdg�|j
j
�y)N��resolv�rsr)rrrr��
dynServers�
_parseCall�cancel�r0�
resolvConfr%s   r&�test_missingz$ResolvConfHandlingTests.test_missingWsC���[�[�]�
��O�O�:�.��������(9�':�;�	�����r1c���|j�}t|d�j�tj|��}|j|jdg�|jj�y)N�wrPrR)	r�open�closerrr�rSrTrUrVs   r&�
test_emptyz"ResolvConfHandlingTests.test_empty]sV���[�[�]�
��Z���#�#�%��O�O�:�.��������(9�':�;�	�����r1N)r2r3r4rXr]r5r1r&rNrNVs���r1rNc�:�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
y	)
�AuthorityTestszs
    Tests for the basic response record selection code in L{FileAuthority}
    (independent of its fileness).
    c��t}d|jdz}|j|j|��}|j	|j
t�y)aJ
        L{FileAuthority} lookup methods errback with L{DomainError} if
        the requested C{name} shares a common suffix with its zone but
        is not actually a descendant of its zone, in terms of its
        sequence of DNS name labels. eg www.the-example.com has
        nothing to do with the zone example.com.
        �nonexistent.prefix-rN)rxr.�failureResultOfr��assertIsInstance�valuer)r0�
testDomain�testDomainNamers    r&�'test_domainErrorForNameWithCommonSuffixz6AuthorityTests.test_domainErrorForNameWithCommonSuffixksK��%�
�/�*�.�.��2C�C��� � ��!9�!9�.�!I�J�����a�g�g�{�3r1c
�H�ttjjtftjjtt	j
d�gi��}|j
|jtjj��\}}}|j|g�|j|t	jtjjtjtjtd��g�|j|g�y)a!
        If a L{FileAuthority} has a zone which includes an I{NS} record for a
        particular name and that authority is asked for another record for the
        same name which does not exist, the I{NS} record is not included in the
        authority section of the response.
        r�riT�rDr#r%N)r)r�r=r"rr��successResultOfr�r�r�TYPErB)r0rr9�
additionals    r&�test_recordMissingz!AuthorityTests.test_recordMissingxs���$��!�!�&�&�
�3�� � �%�%���M�M�)�,�(��
�	�)-�(<�(<�#�I�#�#�J�$4�$4�$9�$9�:�)
�%��	�:�	
�����$���������$�$�)�)��O�O�"�)�)�&���
�	
�	
����R�(r1c��t}d|jdz}ttj�dz}|j|j
t||����}|j|jt�y)z�
        Requesting a record of unknown type where no records exist for the name
        in question results in L{DomainError}.
        rarr;�r"r#N)rxr.�maxr�typeToMethodrb�queryrrcrdr)r0rerf�unknownTypers     r&�test_unknownTypeNXDOMAINz'AuthorityTests.test_unknownTypeNXDOMAIN�sl��
%�
�/�*�.�.��2C�C���&�-�-�.��2��� � ����U��[�I�J�
��	
���a�g�g�{�3r1c���ttj�dz}|jtjt
d|����\}}}|j|g�y)z�
        Requesting a record of unknown type where other records exist for the
        name in question results in an empty answer set.
        r;rIroN)rprrqrjrzrrrr�)r0rsr9rrls     r&�test_unknownTypeMissingz&AuthorityTests.test_unknownTypeMissing�sW��
�&�-�-�.��2��(,�(<�(<�����?�� M�N�)
�%��	�:�	
�����$r1c
���dtjjz}tjd�}ttjjtf||gi��}t
||�|�}|j|�\}}}|j|g�|j|tj|tjtj|d��g�|j|g�y)z�
        Create an authority and make a request against it.  Then verify that the
        result is a referral, including no records in the answers or additional
        sections, but with an I{NS} record in the authority section.
        sexample.r�riFriN)r�r=r"rr�r)�getattrrjr�rr2rB)r0�method�	subdomain�
nameserverrr-r9rls        r&�
_referralTestzAuthorityTests._referralTest�s��� �*�"2�"2�"7�"7�7�	��]�]�9�-�
�#��!�!�&�&�
�3�����
�	�
'�G�I�v�&�y�1��(,�(<�(<�Q�(?�%��	�:������$����������F�F�"�)�)�&���
�	
�	
����R�(r1c�&�|jd�y)a
        When an I{NS} record is found for a child zone, it is included in the
        authority section of the response. It is marked as non-authoritative if
        the authority is not also authoritative for the child zone (RFC 2181,
        section 6.1).
        r�N�r|r�s r&�
test_referralzAuthorityTests.test_referral�s��	
���?�+r1c�&�|jd�y)zT
        A referral is also generated for a request of type C{ALL_RECORDS}.
        r�Nr~r�s r&�test_allRecordsReferralz&AuthorityTests.test_allRecordsReferral�s��	
���-�.r1N)r2r3r4rrgrmrtrvr|rr�r5r1r&r_r_es,���
4� )�D4�	%�)�B,�/r1r_c��eZdZdZej
d�Zejd�Zd�Z	d�Z
d�Zd�Zd�Z
d	�Zd
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zy)�AdditionalProcessingTestszz
    Tests for L{FileAuthority}'s additional processing for those record types
    which require it (MX, CNAME, etc).
    s10.0.0.1sf080::1c���t|jj|f|jj||�g||i��}t||�tjj�S)a
        Perform a DNS lookup against a L{FileAuthority} configured with records
        as defined by C{makeRecord} and C{addresses}.

        @param method: The name of the lookup method to use; for example,
            C{"lookupNameservers"}.
        @type method: L{str}

        @param soa: A L{Record_SOA} for the zone for which the L{FileAuthority}
            is authoritative.

        @param makeRecord: A one-argument callable which accepts a name and
            returns an L{IRecord} provider.  L{FileAuthority} is constructed
            with this record.  The L{FileAuthority} is queried for a record of
            the resulting type with the given name.

        @param target: The extra name which the record returned by
            C{makeRecord} will be pointed at; this is the name which might
            require extra processing by the server so that all the available,
            useful information is returned.  For example, this is the target of
            a CNAME record or the mail exchange host pointed to by an MX record.
        @type target: L{bytes}

        @param addresses: A L{list} of records giving addresses of C{target}.

        @return: A L{Deferred} that fires with the result of the resolver
            method give by C{method}.
        ri)r)r=r"rxr�)r0ryr.�
makeRecord�target�	addressesrs       r&�_lookupSomeRecordsz,AdditionalProcessingTests._lookupSomeRecords�s_��:$�������%��	�	����F�!3� 4��	��
�	�*�w�y�&�)�*�*:�*:�*?�*?�@�@r1c�Z�d�}|jt||��t||���y)a

        Assert that the L{RRHeader} instances given by C{expected} and
        C{computed} carry all the same information but without requiring the
        records appear in the same order.

        @param expected: A L{list} of L{RRHeader} instances giving the expected
            records.

        @param computed: A L{list} of L{RRHeader} instances giving the records
            computed by the scenario under test.

        @raise self.failureException: If the two collections of records
            disagree.
        c��|jSr+)r#)�rrs r&r�z>AdditionalProcessingTests.assertRecordsMatch.<locals>.<lambda>$s
�����r1)�keyN)r��sorted)r0�expected�computedr�s    r&�assertRecordsMatchz,AdditionalProcessingTests.assertRecordsMatchs'��$!�������c�2�F�8��4M�Nr1c�D�dtjjz}|j|t|||�}|j	|�\}}}|j|D�	cgc]4}	t
j||	jtj|	d����6c}	|�ycc}	w)aT
        Verify that certain address records are included in the I{additional}
        section of a response generated by L{FileAuthority}.

        @param method: See L{_lookupSomeRecords}

        @param makeRecord: See L{_lookupSomeRecords}

        @param addresses: A L{list} of L{IRecord} providers which the
            I{additional} section of the response is required to match
            (ignoring order).

        @raise self.failureException: If the I{additional} section of the
            response consists of different records than those given by
            C{addresses}.
        smail.TriN)
r�r=r"r�rjr�rrrkrB)
r0ryr�r�r�r-r9rrlr+s
          r&�_additionalTestz)AdditionalProcessingTests._additionalTest's���"�J�,�,�1�1�1���#�#�F�J�
�F�I�V��(,�(<�(<�Q�(?�%��	�:���� )�	
�������L�L�"�)�)�#���	
�
�	
��	
s�9Bc�Z�|jdttjd�|�y)z�
        Verify that a response to an MX query has certain records in the
        I{additional} section.

        @param addresses: See C{_additionalTest}
        r�rNN)r�rrr��r0r�s  r&�_additionalMXTestz+AdditionalProcessingTests._additionalMXTestJs$��	
��� �'�#�-�-��"<�i�	
r1c�<�|j|jg�y)z�
        If the name of the MX response has A records, they are included in the
        additional section of the response.
        N)r��_Ar�s r&�test_mailExchangeAdditionalAz6AdditionalProcessingTests.test_mailExchangeAdditionalAU���
	
������y�)r1c�<�|j|jg�y)z�
        If the name of the MX response has AAAA records, they are included in
        the additional section of the response.
        N)r��_AAAAr�s r&�test_mailExchangeAdditionalAAAAz9AdditionalProcessingTests.test_mailExchangeAdditionalAAAA\���
	
����
�
�|�,r1c�R�|j|j|jg�y)z�
        If the name of the MX response has both A and AAAA records, they are
        all included in the additional section of the response.
        N)r�r�r�r�s r&�test_mailExchangeAdditionalBothz9AdditionalProcessingTests.test_mailExchangeAdditionalBothc���
	
���������4�5r1c�F�|jdtj|�y)z�
        Verify that a response to an NS query has certain records in the
        I{additional} section.

        @param addresses: See C{_additionalTest}
        r�N)r�rr�r�s  r&�_additionalNSTestz+AdditionalProcessingTests._additionalNSTestjs��	
���0�#�-�-��Kr1c�<�|j|jg�y)z�
        If the name of the NS response has A records, they are included in the
        additional section of the response.
        N)r�r�r�s r&�test_nameserverAdditionalAz4AdditionalProcessingTests.test_nameserverAdditionalAsr�r1c�<�|j|jg�y)z�
        If the name of the NS response has AAAA records, they are included in
        the additional section of the response.
        N)r�r�r�s r&�test_nameserverAdditionalAAAAz7AdditionalProcessingTests.test_nameserverAdditionalAAAAzr�r1c�R�|j|j|jg�y)z�
        If the name of the NS response has both A and AAAA records, they are
        all included in the additional section of the response.
        N)r�r�r�r�s r&�test_nameserverAdditionalBothz7AdditionalProcessingTests.test_nameserverAdditionalBoth�r�r1c�*�dtjjz}|jdttj
||�}|j
|�\}}}t	jtjjtjtjt	j
|�d��}|j|D�cgc]4}t	j||jtj|d����6c}|gz|�ycc}w)z�
        Verify that a response to a CNAME query has certain records in the
        I{answer} section.

        @param addresses: See C{_additionalTest}
        swww.r�TriN)r�r=r"r�rr�rjr�CNAMErBr�rk)	r0r�r�r-r9rrl�aliasr+s	         r&�_answerCNAMETestz*AdditionalProcessingTests._answerCNAMETest�s����:�+�+�0�0�0���#�#�!�:�s�/?�/?���
��)-�(<�(<�Q�(?�%��	�:�������!�!��I�I��!�!��$�$�V�,��
��	
��� )�	
�������L�L�"�)�)�#���	
��g�

�
�
	
��	
s�
9Dc�<�|j|jg�y)z�
        If the name of the CNAME response has A records, they are included in
        the answer section of the response.
        N)r�r�r�s r&�test_canonicalNameAnswerAz3AdditionalProcessingTests.test_canonicalNameAnswerA�s��
	
���t�w�w�i�(r1c�<�|j|jg�y)z�
        If the name of the CNAME response has AAAA records, they are included
        in the answer section of the response.
        N)r�r�r�s r&�test_canonicalNameAnswerAAAAz6AdditionalProcessingTests.test_canonicalNameAnswerAAAA�s��
	
���t�z�z�l�+r1c�R�|j|j|jg�y)z�
        If the name of the CNAME response has both A and AAAA records, they are
        all included in the answer section of the response.
        N)r�r�r�r�s r&�test_canonicalNameAnswerBothz6AdditionalProcessingTests.test_canonicalNameAnswerBoth�s��
	
���t�w�w��
�
�3�4r1N)r2r3r4rrrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r5r1r&r�r��sz���

����k�	"�B��C�O�O�J�'�E�$A�LO�*!
�F	
�*�-�6�L�*�-�6�!
�F)�,�5r1r�c��eZdZd�Zy)�NoInitialResponseTestsc�����fd�}d�}tdg��}||_g�|jtjd|�tj
dtjtjddtjd	d�
���g}tjdd
ddd
d
ddd��	}||_
�j|�|j|jd�tj�S)z�
        If a request returns a L{dns.NS} response, but we can't connect to the
        given server, the request fails with the error returned at connection.
        c�8��t�jd��Sr!)r
rK)r0�args�messagess  �r&rrz3NoInitialResponseTests.test_noAnswer.<locals>.query�s����8�<�<��?�+�+r1c�R�tjtjd��S)NzCouldn't connect)r�failr��gaierror)r0r��kwargss   r&�
queryProtocolz;NoInitialResponseTests.test_noAnswer.<locals>.queryProtocol�s���:�:�f�o�o�.@�A�B�Br1)r�rrurrz	fooba.comr&Fr'r(r!r6r;rr7r)r�_query�patchrr|rr2r1r�rrD�appendr�
getHostByNamer�r�)r0rrr�r�r/rFr�s      @r&�
test_noAnswerz$NoInitialResponseTests.test_noAnswer�s����	,�
	C��^�$4�5�������	
�
�
�3�*�*�G�]�C�
�L�L� ��V�V��F�F����
�
�+A�s�K�

�	
��
�K�K����������

����	�������!�!�(�"8�"8��"E�v���W�Wr1N)r2r3r4r�r5r1r&r�r��s��,Xr1r�c�"�eZdZdZd�Zd�Zd�Zy)�SecondaryAuthorityServiceTestsz�
    Tests for L{SecondaryAuthorityService}, a service which keeps one or more
    authorities up to date by doing zone transfers from a master.
    c��d}t|ddg�}|j|j|�|j|jd�|j|jdj|�|j|jdjd�|j|jdj
d�|j|jdj|�|j|jdjd�|j|jdj
d�y)	a
        L{SecondaryAuthorityService} can be constructed with a C{str} giving a
        master server address and several domains, causing the creation of a
        secondary authority for each domain and that master server address and
        the default DNS port.
        �192.168.1.2�example.comzexample.orgrrr;sexample.orgN)rr��primary�_port�domains�domain�r0r��services   r&�test_constructAuthorityFromHostz>SecondaryAuthorityServiceTests.test_constructAuthorityFromHost�s��� ��+�G�n�m�5T�U��������'�2��������+��������+�3�3�W�=��������+�1�1�2�6��������+�2�2�N�C��������+�3�3�W�=��������+�1�1�2�6��������+�2�2�N�Cr1c��d}d}tj||fddg�}|j|j|�|j|jd�|j|j
dj|�|j|j
dj|�|j|j
djd�|j|j
dj|�|j|j
dj|�|j|j
djd�y)	a\
        L{SecondaryAuthorityService.fromServerAddressAndDomains} constructs a
        new L{SecondaryAuthorityService} from a C{str} giving a master server
        address and DNS port and several domains, causing the creation of a secondary
        authority for each domain and that master server address and the given
        DNS port.
        �192.168.1.3i�zexample.net�example.edur�example.netr;N)r�fromServerAddressAndDomainsr�r�r�r�r�)r0r�r�r�s    r&�&test_constructAuthorityFromHostAndPortzESecondaryAuthorityServiceTests.test_constructAuthorityFromHostAndPorts�� ����+�G�G�
�d�O�m�^�<�
��	
������'�2��������-��������+�3�3�W�=��������+�1�1�4�8��������+�2�2�N�C��������+�3�3�W�=��������+�1�1�4�8��������+�2�2�N�Cr1c��d}t|j�ddg�}|j|j|�|j|jdj|�|j|jdj
d�|j|jdj|�|j|jdj
d�y)aQ
        L{SecondaryAuthorityService.fromServerAddressAndDomains} constructs a
        new L{SecondaryAuthorityService} from a C{bytes} giving a master server
        address and several domains, causing the creation of a secondary
        authority for each domain and that master server address and the given
        DNS port.
        r�r�zexample.edurr;r�N)r�encoder�r�r�r�r�s   r&� test_constructAuthorityFromBytesz?SecondaryAuthorityServiceTests.test_constructAuthorityFromBytes#s��� ��+��N�N��
�]�+�
��	
������'�2��������+�3�3�W�=��������+�2�2�N�C��������+�3�3�W�=��������+�2�2�N�Cr1N)r2r3r4rr�r�r�r5r1r&r�r��s���
D�(D�0Dr1r�c�(�eZdZdZd�Zd�Zd�Zd�Zy)�SecondaryAuthorityTestsz�
    L{twisted.names.secondary.SecondaryAuthority} correctly constructs objects
    with a specified IP address and optionally specified DNS port.
    c���tdd�}|j|jd�|j|jd�|j|jd�y)zp
        When constructed using L{SecondaryAuthority.__init__}, the default port
        of 53 is used.
        �192.168.1.1�
inside.comr�
inside.comN)rr�r�r�r��r0�	secondarys  r&�test_defaultPortz(SecondaryAuthorityTests.test_defaultPort?sP��
'�}�l�C�	�����*�*�M�:�������"�-�����)�)�=�9r1c���tjdd�}|j|jd�|j|jd�|j|j
d�y)z~
        When constructed using L{SecondaryAuthority.fromServerAddressAndDomain},
        the specified port is used.
        )r���r�r�r�r�N)r�fromServerAddressAndDomainr�r�r�r�r�s  r&�test_explicitPortz)SecondaryAuthorityTests.test_explicitPortIs[��
'�A�A�!�<�
�	�	
����*�*�M�:�������$�/�����)�)�=�9r1c�^�tjdd�}t�x|_}|j	�|j
j
d�\}}}}}|j|d�|j|d�|j||f�}t�}	|j|	�t�}
|
jt|	j�dd��|jtj dtj"tj$�g|
j&�y)z�
        An attempt is made to transfer the zone for the domain the
        L{SecondaryAuthority} was constructed with from the server address it
        was constructed with when L{SecondaryAuthority.transfer} is called.
        �r�r8�example.comrr�r8rqN)rr�r�_reactor�transfer�
tcpClientsrKr��
buildProtocolr�makeConnectionr�decoderrdrrrBr1rC)r0r�r	�hostr�r{�timeout�bindAddress�protor��msgs           r&�
test_transferz%SecondaryAuthorityTests.test_transferUs���'�A�A�!�=�
�	�(:�';�;�	��W�����5<�4F�4F�4J�4J�1�4M�1��d�G�W�k�����}�-�����t�$��%�%�t�T�l�3��#�%�	�
���Y�'��i��	�
�
�7�9�?�?�,�Q�R�0�1�2����#�)�)�M�3�8�8�S�V�V�D�E�s�{�{�Sr1c
�t�tjdd�}t�x|_}|j	�|j
j
d�\}}}}}|j||f�}t�}	|j|	�tdd��}
|
jt|	j�dd��tdd	d
ddd
dd��}tdd��}t|
j dd��}
|
j"j%t'dt(|��t'd|��t'dt(|��g�|
j+�}|j-t/dt1|��|z�|j3|j5d��}|j7t'd|d��gggf|�y)z�
        L{SecondaryAuthority.lookupAddress} returns a L{Deferred} that fires
        with the I{A} records the authority has cached from the primary.
        r�r�rr;)r9r%rqNsns1.example.comzadmin.example.comi@�ii�i i�%i�.r<s192.168.1.2rk)r8r9r%)r#r#r"z!Hr�T)r#r%)rr�rr�r�r�rKr�rr�rr�rrdrrr8rD�extendrr�toStr�dataReceivedr�lenrjr�r�)r0r�r	r�r�r{r�r�r�r�rrr.rr9�datarIs                r&�test_lookupAddressz*SecondaryAuthorityTests.test_lookupAddressss���
'�A�A�!�>�
�	�(:�';�;�	��W�����4;�4F�4F�4J�4J�1�4M�1��d�G�W�k��%�%�t�T�l�3��#�%�	�
���Y�'��q�q�)��
���W�Y�_�_�.�q�r�2�3�4��$�%�������	
��
�^��+���E�H�H�Q�Q�7���������c�3�?����3���c�3�?�
�	
��|�|�~��
���4��c�$�i�0�4�7�8��%�%�i�&=�&=�m�&L�M������~�q�t�<�
=�r�2�F��	
r1N)r2r3r4rr�r�r�r�r5r1r&r�r�9s���
:�
:�T�<0
r1r�sY$ORIGIN example.com.
$TTL    1w
example.com. IN SOA dns.example.com (
            2013120201 ; serial number of this zone file
            1d         ; slave refresh
            2h         ; slave retry time in case of a problem
            4w         ; slave expiration time
            1h         ; maximum caching time in case of failed lookups
            )

; A comment.
@                  IN AAAA 2001:db8:10::1
example.com.       IN A 10.0.0.1
no-in.example.com. A 10.0.0.2  ; technically wrong but used to work
not-fqdn           IN MX 10 mx.example.com
www                IN CNAME example.comc�L�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
y)
�BindAuthorityTestsz=
    Tests for L{twisted.names.authority.BindAuthority}.
    c��t|j�jd��}|j|�t	j
|j�S)z�
        Create a new L{twisted.names.authority.BindAuthority} from C{s}.

        @param s: A string with BIND zone data.
        @type s: bytes

        @return: a new bind authority
        @rtype: L{twisted.names.authority.BindAuthority}
        �ascii)rrr��
setContentr�
BindAuthority�path)r0�s�fps   r&�loadBindStringz!BindAuthorityTests.loadBindString�s@���d�k�k�m�*�*�7�3�
4��
�
�
�a���&�&�r�w�w�/�/r1c�8�|jt�|_yr+)r�sampleBindZoner%r�s r&r�zBindAuthorityTests.setUp�s���'�'��7��	r1c���|jjj�D]>}|jj|D] }|jd|jk(��"�@y)zG
        Loads the default $TTL and applies it to all records.
        �:	N)r%r/�keysrrD)r0�dom�recs   r&�test_ttlzBindAuthorityTests.test_ttl�sY���9�9�$�$�)�)�+�	3�C��y�y�(�(��-�
3������#�'�'� 1�2�
3�	3r1c��|jd|jj�|jd|jj�y)z,
        Loads the default $ORIGIN.
        sexample.com.�not-fqdn.example.comN)r�r%�origin�assertInr/r�s r&�test_originFromFilez&BindAuthorityTests.test_originFromFile�s@��	
�����I�I���	
�	
�
�
�#��I�I���	
r1c���dD]g\}}|j|jj|��\\}\\|jt	j
|d�|j��iy)�'
        A records are loaded.
        �)r�z10.0.0.1)�no-in.example.comz10.0.0.2rN�rjr%r�r�rrr#�r0r
�ipr�s    r&�
test_aRecordsz BindAuthorityTests.test_aRecords�si��
�	�G�C��"�1�1�$�)�)�2I�2I�#�2N�O�N�T�b�2�r�����������
�
�
�	r1c���|j|jjd��\\}\\|jt	j
dd�|j�y)�*
        AAAA records are loaded.
        r��2001:db8:10::1rN�rjr%r�r�rr�r#�r0r�s  r&�test_aaaaRecordsz#BindAuthorityTests.test_aaaaRecords�sY���-�-��I�I�'�'��7�
���"�r�2�	
����O�O� ��
�
�J�J�	
r1c���|j|jjd��\\}\\|jt	j
ddd��|j�y)�(
        MX records are loaded.
        rrNzmx.example.comr)r)r"rDN�rjr%r�r�rr�r#rs  r&�test_mxRecordsz!BindAuthorityTests.test_mxRecordss]���-�-��I�I�(�(�)@�A�
���"�r�2�	
����M�M��%��
�

�J�J�
	
r1c���|j|jjd��\}\\|d}|jt	j
dd��|j�y)�+
        CNAME records are loaded.
        �www.example.comrr�rr(N�rjr%r�r�rr�r#�r0rDr�s   r&�test_cnameRecordsz$BindAuthorityTests.test_cnameRecordssd��!�0�0��I�I�'�'�(:�;�
���"�b��Q�Z��������"��
�
�J�J�	
r1c���|jt�5}|jd�ddd�|jdjj
d�y#1swY�3xYw)zO
        loadBindString raises NotImplementedError on invalid records.
        sexample.com. IN LOL 192.168.0.1NzRecord type 'LOL' not supportedr)�assertRaises�NotImplementedErrorrr��	exceptionr�)r0�es  r&�test_invalidRecordClassz*BindAuthorityTests.test_invalidRecordClass%s]���
�
�2�
3�	D�q���� B�C�	D����:�A�K�K�<L�<L�Q�<O�P�	D�	D�s�A�A#c��dD]i}|jt�5}|j|dz�ddd�|jt	|dz�j
jd��ky#1swY�AxYw)zC
        $INCLUDE and $GENERATE raise NotImplementedError.
        )s$INCLUDEs	$GENERATEs doesNotMatterNs directive not implementedr)r+r,rr�rr-r�)r0�	directiver.s   r&�test_invalidDirectivesz)BindAuthorityTests.test_invalidDirectives-s��5�	�I��"�"�#6�7�
C�1��#�#�I�0A�$A�B�
C�����Y�)F�F�G���� � ��#�
�	�
C�
C�s�A0�0A9	N)r2r3r4rrr�rrrrr#r)r/r2r5r1r&r�r��s:���
0�8�3�
��"

�
� 
� Q�
r1r�a�zone = [
    SOA(
        # For whom we are the authority
        'example.com',

        # This nameserver's name
        mname = "dns.example.com",

        # Mailbox of individual who handles this
        rname = "root.example.com",

        # Unique serial identifying this SOA data
        serial = 86400,

        # Time interval before zone should be refreshed
        refresh = "2H",

        # Interval before failed refresh should be retried
        retry = "1H",

        # Upper limit on time interval before expiry
        expire = "1H",

        # Minimum TTL
        minimum = "3H"

    ),

    AAAA('example.com', '2001:db8:10::1'),
    A('example.com', '10.0.0.1'),
    NS('example.com', 'dns.example.com'),
    A('no-in.example.com', '10.0.0.2'),
    PTR('2.0.0.10.in-addr.arpa', 'no-in.example.com'),

    CNAME('www.example.com', 'example.com'),
    CNAME('ftp.example.com', 'example.com'),

    MX('not-fqdn.example.com', 10, 'mail.example.com'),
]
c�@�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zy
)�PySourceAuthorityTestszA
    Tests for L{twisted.names.authority.PySourceAuthority}.
    c���t|j��}t|jd�5}|j	|�ddd�tj|j�S#1swY�(xYw)a
        Create a new L{twisted.names.authority.PySourceAuthority} from C{s}.

        @param s: A string with BIND zone data in a Python source file.
        @type s: L{str}

        @return: a new bind authority
        @rtype: L{twisted.names.authority.PySourceAuthority}
        rZN)rrr[r�writer�PySourceAuthority)r0rrrs    r&�loadPySourceStringz)PySourceAuthorityTests.loadPySourceStringjs[���d�k�k�m�
$��
�"�'�'�3�
�	�1�
�G�G�A�J�	��*�*�2�7�7�3�3�	�	�s�A)�)A2c�8�|jt�|_yr+)r8�samplePySourcer%r�s r&r�zPySourceAuthorityTests.setUpzs���+�+�N�;��	r1c���dD]f\}}|j|jj|��\\}\\|jt	j
|�|j��hy)rrNrrs    r&rz$PySourceAuthorityTests.test_aRecords}sa��
�	�G�C��"�1�1�$�)�)�2I�2I�#�2N�O�N�T�b�2�r�������R� ��
�
�
�	r1c���|j|jjd��\\}\\|jt	j
d�|j�y)rr�rNrrs  r&rz'PySourceAuthorityTests.test_aaaaRecords�sR���-�-��I�I�'�'��7�
���"�r�2�	
����O�O�,�-��J�J�	
r1c���|j|jjd��\\}\\|jt	j
dd��|j�y)r!rrNzmail.example.com)r)r"Nr"rs  r&r#z%PySourceAuthorityTests.test_mxRecords�sZ���-�-��I�I�(�(�)@�A�
���"�r�2�	
����M�M��'�
�
�J�J�	
r1c���|j|jjd��\}\\|d}|jt	j
d��|j�y)r%r&rr��r"Nr'r(s   r&r)z(PySourceAuthorityTests.test_cnameRecords�sa��!�0�0��I�I�'�'�(:�;�
���"�b��Q�Z��������"�
�
�J�J�		
r1c���|j|jjd��\}\\|d}|jt	j
d��|j�y)z)
        PTR records are loaded.
        s2.0.0.10.in-addr.arparrr?N)rjr%r�r�rr�r#r(s   r&r�zPySourceAuthorityTests.test_PTR�s_��!�0�0��I�I�#�#�$<�=�
���"�b��Q�Z������N�N�)�
�
�J�J�		
r1c�J�d}|jt|j|�y)z1
        Input file has no zone variable
        znothing = []N)r+�
ValueErrorr8)r0�badPySources  r&�test_badInputNoZonez*PySourceAuthorityTests.test_badInputNoZone�s!��%�����*�d�&=�&=�{�Kr1N)r2r3r4rr8r�rrr#r)r�rDr5r1r&r4r4es0���4� <��

�

�

�

�Lr1r4)Yrr�r�r��	functoolsrr�ior�structr�twisted.internetrrr	�twisted.internet.deferr
�twisted.internet.testingrrr
�
twisted.namesrrrrr�twisted.names.clientr�twisted.names.dnsrrrrrr�twisted.names.errorr�twisted.names.secondaryrr�twisted.python.compatr�twisted.python.filepathr�
twisted.trialrr'�
FileAuthorityr)r��reverse_soar�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�r�rxr�ryrz�TestCaserorrrNr_r�r�r�r�rr�r:r4r5r1r&�<module>rVs����
��
�%���2�2�*���
A�@�)�Q�Q�+�Q�.�,�"�+�.�i�-�-�.��S�^�^�
�
 �����
�	�	�
��c�n�n�
"�
"�����
�	�	��
����
�
'���
��

�
��"�	�Z�(�
��C�L�L��&��C�M�M�/�*��C�N�N�A�B��C�N�N�1�3T�U��C�M�M�"�4�5��C����.I�J��C���2�3��C�M�M�4�5��C�M�M�1�2��C�N�N�3�5F�G��C�M�M�!�]�C�0��C�M�M�"�l�,?�@��C�M�M�!�D�FV�W��C�N�N�J�K��C�M�M�6�7��C���]�M�J��C���Q�1I�J��C�M�M�2�8I�J��C�N�N��� 2� 2�4S�
�
�C����R��z�+O�
�
�C�O�O�F�G�5
�:
�C�N�N�3��u�.F�G�&
�
�C�L�L��(��C�L�L��(�"
�
�C�L�L�+�,��C�L�L��$�
&
�$4�3�#3�#3�4F�#G�"H�$0�C�L�L��$<�#=�[.
�1��f!�	!�;�/�$��C�N�N�:�;��'
�
��� �	�6�"����C�L�L���.��C�M�M�-�U�3��C�M�M�-�T�2��C�N�N�3��u�.F�D�Q�
�
��
�W
�X�&�&�W
�t
�(�#�#��W5��!�!�W5�t�h�/�/��{/�X�&�&�{/�|[5�� 1� 1�[5�|-X�X�.�.�-X�`ED�X�%6�%6�ED�Pj
�h�/�/�j
�Z+��&~��*�*�~�B(��VdL�X�.�.�dLr1

Zerion Mini Shell 1.0