Current File : //opt/imh-python/lib/python2.7/test/test_socket.pyc
�
��Wc@s�ddlZddlmZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZyddlZWnek
r�eZnXdejd�ZejZdZejo*eddej�ZyddlZddlZWnek
rheZeZnXejZdZdejfd	��YZd
ejfd��YZdfd
��YZ dee fd��YZ!dee fd��YZ"de!fd��YZ#deje fd��YZ$dejfd��YZ%ej&ed�de#fd��Y�Z'ej&ed�de"fd��Y�Z(ej&ed�de!fd��Y�Z)ej&e*ed�d �ej&ed�d!e$fd"��Y��Z+ej&ed�d#e!fd$��Y�Z,ej&ed�d%e#fd&��Y�Z-d'ejfd(��YZ.d)e-fd*��YZ/d+e-fd,��YZ0d-e-fd.��YZ1d/e2fd0��YZ3d1e3e'fd2��YZ4d3ejfd4��YZ5ej&ed�d5ee fd6��Y�Z6ej&ed�d7ee fd8��Y�Z7d9ejfd:��YZ8d;efd<��YZ9d=efd>��YZ:d?ejfd@��YZ;ej&e
j<dAkdB�dCejfdD��Y�Z=ej&ed�dEe#fdF��Y�Z>dGZ?dHZ@dIZAdJ�ZBej&eB�dK�dLejfdM��Y�ZCej&eB�dK�dNeje fdO��Y�ZDdP�ZEeFdQkr�eE�ndS(Ri����N(ttest_supporticCs_y,tj|tj�}|j||f�Wntjtjfk
rLtSX|j�tSdS(sZTry to bind a socket on the given host:port and return True
    if that has been possible.N(tsockettSOCK_STREAMtbindterrortgaierrortFalsetclosetTrue(thosttporttfamilytsock((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttry_addresss
sMichael Gilfix was here
s::1Rt
SocketTCPTestcBseZd�Zd�ZRS(cCsDtjtjtj�|_tj|j�|_|jjd�dS(Ni(RtAF_INETRtservRt	bind_portR
tlisten(tself((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pytsetUp4scCs|jj�d|_dS(N(RRtNone(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttearDown9s
(t__name__t
__module__RR(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR2s	t
SocketUDPTestcBseZd�Zd�ZRS(cCs4tjtjtj�|_tj|j�|_dS(N(RRt
SOCK_DGRAMRRRR
(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR?scCs|jj�d|_dS(N(RRR(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyRCs
(RRRR(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR=s	tThreadableTestcBsMeZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	RS(s�Threadable Test class

    The ThreadableTest class makes it easy to create a threaded
    client/server pair from an existing unit test. To create a
    new threaded class from an existing unit test, use multiple
    inheritance:

        class NewClass (OldClass, ThreadableTest):
            pass

    This class defines two new fixture functions with obvious
    purposes for overriding:

        clientSetUp ()
        clientTearDown ()

    Any new test functions within the class must then define
    tests in pairs, where the test name is preceded with a
    '_' to indicate the client portion of the test. Ex:

        def testFoo(self):
            # Server portion

        def _testFoo(self):
            # Client portion

    Any exceptions raised by the clients during their tests
    are caught and transferred to the main thread to alert
    the testing framework.

    Note, the server setup function cannot call any blocking
    functions that rely on the client thread during setup,
    unless serverExplicitReady() is called just before
    the blocking call (such as in setting up a client/server
    connection and performing the accept() in setUp().
    cCs4|j|_|j|_|j|_|j|_dS(N(Rt_ThreadableTest__setUpRt_ThreadableTest__tearDownt_setUpt	_tearDown(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt__init__mscCs|jj�dS(s�This method allows the server to explicitly indicate that
        it wants the client thread to proceed. This is useful if the
        server is about to execute a blocking routine that is
        dependent upon the client thread during its setup routine.N(tserver_readytset(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pytserverExplicitReadytscCs�tj�|_tj�|_tj�|_tjd�|_|j�}|jd�}||d}t	|d|�}t
j|j|f�|_
|j�|jj�s�|jj�n|jj�dS(Nit.t_(t	threadingtEventR!tclient_readytdonetQueuetqueuetidtrfindtgetattrtthreadtstart_new_threadt	clientRunt
client_threadRtis_setR"twait(Rt
methodnametittest_method((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR{s
cCsI|j�|jj�|jj�sE|jj�}|j|�ndS(N(RR)R4R+temptytgettfail(Rtmsg((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR�s


cCs~|jj�|j�|jj�t|�s?td��ny|�Wn#tk
ro}|jj	|�nX|j
�dS(Ns&test_func must be a callable function.(R!R4tclientSetUpR(R"tcallablet	TypeErrort	ExceptionR+tputtclientTearDown(Rt	test_functstrerror((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR1�s


cCstd��dS(Ns clientSetUp must be implemented.(tNotImplementedError(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR<�scCs|jj�tj�dS(N(R)R"R/texit(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyRA�s
(
RRt__doc__R R#RRR1R<RA(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyRGs$						tThreadedTCPSocketTestcBs&eZdd�Zd�Zd�ZRS(trunTestcCs$tj|d|�tj|�dS(Nt
methodName(RR R(RRI((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR �scCstjtjtj�|_dS(N(RRRtcli(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR<�scCs'|jj�d|_tj|�dS(N(RJRRRRA(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyRA�s
	(RRR R<RA(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyRG�s	tThreadedUDPSocketTestcBs&eZdd�Zd�Zd�ZRS(RHcCs$tj|d|�tj|�dS(NRI(RR R(RRI((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR �scCstjtjtj�|_dS(N(RRRRJ(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR<�scCs'|jj�d|_tj|�dS(N(RJRRRRA(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyRA�s
	(RRR R<RA(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyRK�s	tSocketConnectedTestcBs8eZdd�Zd�Zd�Zd�Zd�ZRS(RHcCstj|d|�dS(NRI(RGR (RRI((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR �scCs9tj|�|j�|jj�\}}||_dS(N(RGRR#Rtaccepttcli_conn(Rtconntaddr((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR�s

cCs'|jj�d|_tj|�dS(N(RNRRRGR(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR�s
	cCs6tj|�|jjt|jf�|j|_dS(N(RGR<RJtconnecttHOSTR
t	serv_conn(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR<�s
cCs'|jj�d|_tj|�dS(N(RSRRRGRA(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyRA�s
	(RRR RRR<RA(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyRL�s
			tSocketPairTestcBs8eZdd�Zd�Zd�Zd�Zd�ZRS(RHcCs'tjj|d|�tj|�dS(NRI(tunittesttTestCaseR R(RRI((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR �scCstj�\|_|_dS(N(Rt
socketpairRRJ(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR�scCs|jj�d|_dS(N(RRR(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR�s
cCsdS(N((R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR<�scCs'|jj�d|_tj|�dS(N(RJRRRRA(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyRA�s
	(RRR RRR<RA(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyRT�s
			tGeneralModuleTestscBs$eZejed.k	d�d��Zd�Zd�Zd�Z	d�Z
d�Zd�Zeje
ed�d	�d
��Zd�Zd�Zd
�Zd�Zd�Zeje
ed�d�d��Zeje
ed�d�d��Zeje
ed�d�d��Zeje
ed�d�d��Zeje
ed�d�d��Zdd�Zd�Zd�Zd�Zd �Zd!�Z d"�Z!eje"j#d#kd$�d%��Z$d&�Z%d'�Z&d(�Z'd)�Z(d*�Z)e*j+d+��Z,eje-d,�d-��Z.RS(/sneed _socket modulecCs�tjtjtj�}z?d|j�|j|j|jf}|jt	|�|�Wd|j
�Xd|j|j|jf}|jt	|�|�dS(Ns7<socket object, fd=%s, family=%s, type=%s, protocol=%s>s7<socket object, fd=-1, family=%s, type=%s, protocol=%s>(t_socketRRRtfilenoRttypetprototassertEqualtreprR(Rtstexpected((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttest_csocket_repr�s"cCs�tjtjtj�}tj|�}|j|j�|j��|j�d}y|j�Wnt	k
rtnX|j
d�dS(NsSocket proxy still exists(RRRtweakreftproxyR]RZRRtReferenceErrorR:(RR_tp((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttest_weakref	s

cCsRtj�j}tj|�}|j|�|�~tj�|j|��dS(N(Rt_sockRbtreftassertIsRt
gc_collecttassertIsNone(RR_tw((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttest_weakref__socks
cCsad�}d�}d�}|jtj|d�|jtj|d�|jtj|d�dS(Nc_s
tj�dS(N(RR(targstkwargs((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pytraise_error sc_s
tj�dS(N(Rtherror(RnRo((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pytraise_herror"sc_s
tj�dS(N(RR(RnRo((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pytraise_gaierror$ssError raising socket exception.(tassertRaisesRR(RRpRrRs((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestSocketErrors			cCs�tjtjtj�}|j|j�|jd
�|j�}|jt��|j	d|�WdQX|jt
��}|j	d|�WdQX|jdt|j
��|jt
��}|j	dd�WdQX|jdt|j
��|jt��|j	dd|�WdQX|jt
��}|j	dd|�WdQX|jdt|j
��|jt
��}|j	ddd�WdQX|jdt|j
��|jt
��}|j	dd|�WdQX|jd	t|j
��|jt
��}|j	ddd�WdQX|jd	t|j
��|jt
��}|j	d�WdQX|jd
t|j
��|jt
��}|j	dd|d�WdQX|jdt|j
��dS(Ntiu☠y@snot complextfoosnot NoneTypetbarsan integer is requireds	(1 given)is	(4 given)(Rvi(RRRt
addCleanupRRtgetsocknameRttUnicodeEncodeErrortsendtoR>tassertIntstrt	exceptionR(RR_tsocknametcm((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestSendtoErrors-s@
cCs<tjtjtjtjtjtjtjtjdS(N(	RRRRtSOCK_RAWtSOCK_RDMtSOCK_SEQPACKETt
SOL_SOCKETtSO_REUSEADDR(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestCrucialConstantsTscCs�tj�}ytj|�}Wn!tjk
rB|jd�nX|j|jd�dkd�ytj|�\}}}Wn!tjk
r�|jd�nX||g|}tj|�}||kr�|j	d|t
|�f�ndS(Nsname lookup failureR$isError resolving host to ip.saddress lookup failures=Error testing host resolution mechanisms. (fqdn: %s, all: %s)(Rtgethostnamet
gethostbynameRtskipTestt
assertTruetfindt
gethostbyaddrtgetfqdnR:R^(Rthostnametipthnametaliasestipaddrstall_host_namestfqhn((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestHostnameRes_stgetrefcountstest needs sys.getrefcount()cCsWy#tjt�}tjtd�Wn-tk
rR|jtjt�|d�nXdS(Nis$socket.getnameinfo loses a reference(tsysR�RRtgetnameinfoR>R](Rtorig((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestRefCountGetNameInfors
cCs/ytjdd�Wntjk
r*nXdS(Ntxi(R�iii(RR�R(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestInterpreterCrash~scCs�idtj6dtj6dtj6dtj6}x�|j�D]�\}}d|>d}xKddddddd	fD].}|j||@||||@��|@�qqW||�}|j||@|�|jt|d�q;WdS(
Ni iliii��iigE#i2Tvi"i��l(	RthtonltntohlthtonstntohstitemsR]Rtt
OverflowError(RtsizestfunctsizetmaskR6tswapped((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestNtoH�s",cCs�ddddddg}ddd	d
ddg}xB|D]:}tj|�tj|�tj|�tj|�q7Wxf|D]^}|jttj|�|jttj|�|jttj|�|jttj|�q|WdS(
Niiillli����i����i����l����l����l����(RR�R�R�R�RtR�(Rtgood_valuest
bad_valuestk((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestNtoHErrors�s




cCs�|j}tjjd�sNtjjd�sNtjjd�sNtjdkrWd
}nd}xE|D]4}ytj|d	�}PWqdtjk
r�qdXqdWtj�tj|�}|||�ytj|d
�}Wntjk
r�d}nX|||�|tj|�|�|tj|d	�|�|dk	rX|tj|d
�|�n|j	t
tjd�|j	t
tjd�dS(Ntlinuxtfreebsdtnetbsdtdarwintdaytimetqotdtdomaintechottcptudpi����i(R�R�R�(R�R�R�(R]R�tplatformt
startswithRt
getservbynameRRt
getservbyportRtR�(RteqtservicestserviceR
tport2tudpport((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt
testGetServBy�s6		
	


cCs|jtj�d�tj�}|j|j�d�|j�tjd�|jtj�d�tj�}|j|j�d�|j�tjd�|jtj�d�tj�}|j|j�d�|j�|jttjd�|jt	tjd�dS(Ni
i����tspam(
R]RtgetdefaulttimeoutRt
gettimeoutRtsetdefaulttimeoutRtt
ValueErrorR>(RR_((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestDefaultTimeout�s 




t	inet_atonstest needs socket.inet_aton()cCs6|jdtjd��|jdtjd��dS(Ntis0.0.0.0s�s255.255.255.255ts����(R]RR�(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestIPv4_inet_aton_fourbytes�st	inet_ptonstest needs socket.inet_pton()cs�ddlm}m�m���fd�}|jd|d��|jd|d��|jd|d	��|jd
|d��|jd|d
��|jd|d��|jd|d��|jd|d	��|jd|d
��dS(Ni����(R�R�Rcs
��|�S(N((ta(RR�(si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt<lambda>�sR�s0.0.0.0s��s255.0.255.0s����s170.170.170.170ss1.2.3.4s����s255.255.255.255(RR�R�RR](Rtftg((RR�si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestIPv4toString�scs�y6ddlm�m�m}|s5|jd�nWntk
rV|jd�nX��fd�}|jd|d��|jd|d	��|jd
d|d��|jd
|d��dS(Ni����(R�tAF_INET6thas_ipv6sIPv6 not availables+could not import needed symbols from socketcs
��|�S(N((R�(R�R�(si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR�	sR�is::s0::0tis1::sE�v�V���$��s$45ef:76cb:1a:56ef:afeb:bac:1924:aeaetR�t(RR�R�R�R�tImportErrorR](RR�R�((R�R�si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestIPv6toStrings
t	inet_ntopstest needs socket.inet_ntop()cs�ddlm}m�m���fd�}|jd|d��|jd|d��|jd|d	��|jd
|d��|jd|d��|jd|d��|jd|d	��dS(Ni����(t	inet_ntoaR�Rcs
��|�S(N((R�(RR�(si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR�ss1.0.1.0ss
170.85.170.85s�U�Us255.255.255.255s����s1.2.3.4s(RR�R�RR](RR�R�((RR�si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestStringToIPv4scs�y6ddlm�m�m}|s5|jd�nWntk
rV|jd�nX��fd�}|jd|d��|jd	|d��|jd|d
��dS(Ni����(R�R�R�sIPv6 not availables+could not import needed symbols from socketcs
��|�S(N((R�(R�R�(si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR�+ss::R�is::1iss!aef:b01:506:1001:ffff:9997:55:170s
�����UpR�tt(RR�R�R�R�R�R](RR�R�((R�R�si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestStringToIPv6"s
s0.0.0.0cCs?tj�}|j|df�|j�\}}|j�|S(s�Use a temporary socket to elicit an unused ephemeral port.

        Args:
            bind_address: Hostname or IP address to search for a port on.

        Returns: A most likely to be unused port.
        i(RRRzR(Rtbind_addressttempsockR	R
((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt_get_unused_port6s

cCs�|j�}tjtjtj�}|j|j�|jd|f�|j�}ytjtj	��}Wn!tj
k
r�|jd�nX|j|dd|fd|d�|j
|d|�dS(Ns0.0.0.0sname lookup failureis
%s invalidi(R�RRRRyRRRzR�R�RR�R}R](RR
Rtnamet
my_ip_addr((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestSockNameDs%cCsZtjtjtj�}|j|j�|jtjtj�}|j|dkd�dS(Nisinitial mode is reuse(	RRRRyRt
getsockoptR�R�tassertFalse(RRtreuse((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestGetSockOptVscCsstjtjtj�}|j|j�|jtjtjd�|jtjtj�}|j	|dkd�dS(Niisfailed to set reuse mode(
RRRRyRt
setsockoptR�R�R�R�(RRR�((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestSetSockOpt^s
cCsLtjtjtj�}|jd�|j�|jtj|jd�dS(NiR�(RRRt
settimeoutRRtRtsend(RR((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestSendAfterClosefs

cCsetjtjtj�}|j|jtj�|j|jtj�|j|jd�|j�dS(Ni(RRRR]RR[R\R(RR((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestNewAttributesms
cCs�tj�}|j|j�tj�}|d}|d}|jt|jt|f�|jt|jt|f�xrt	j
�D]d}tj�}y|jt|f�Wn7tk
r�}|jtj
ks�|dkr��q�q�XPq�WdS(Nii(RRyRRtfind_unused_portRtR�RRRt	itertoolstcounttOSErrorterrnot
EADDRINUSE(RRR
tbig_porttneg_portR6te((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttest_getsockaddrargus


tntsWindows specificcCs�|jttjd��|jttd��|jttd��|jttd��|jttd��tj�}|j|j�|jt|jdd�|jtj	d	�dS(
Ntioctlt
SIO_RCVALLt	RCVALL_ONt
RCVALL_OFFtSIO_KEEPALIVE_VALSi����iid(iidid(
R�thasattrRRyRRtR�R�RR�(RR_((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttest_sock_ioctl�scCsWytjdd�Wn;tjk
rQ}|jtjkrK|jd�n�nXx0tjtd�D]}|jt	|�d�qeWtjdd�tjdd�tjdd�t
r�tjdd�ntjtd�tjtd�tjtd�tjtd�tjtdtj�}x0|D](\}}}}}|j|tj�q-Wtjtdd	tj�}x0|D](\}}}}}|j|tj�q{Wtjtdd	d	tj
�tjtdd	d	d	tj�tjdd	tjtjd	tj�ttd
�rSy#tjddd	d	d	tj�WqStjk
rOqSXndS(Nt	localhostiPsbuggy libc versionis	127.0.0.1s::1thttplPitAI_NUMERICSERV(RtgetaddrinfoRR�tEAI_SERVICER�RRRR]tlent
SUPPORTS_IPV6RRtSOL_TCPt
AI_PASSIVEt	AF_UNSPECRR(RterrtinfotinfosRR%tsocktype((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestGetaddrinfo�sB
cs>ttd�s ttd�r0�jd�n�fd�}�fd�}tj�\}}tjtj|�}z�|r�|jd�n�jt��&tj	d�|j
dtj�WdQX|rtjtj|�tj	d��jtj
|j
dtj�nWdtjtj|�|j�|j�XdS(	NtalarmRWs9signal.alarm and socket.socketpair required for this testcs�jttjd�dS(Ni(RtR�tmathtacosh(Rn(R(si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt
ok_handler�scs"�jttjd�dddS(Nii(RtR�RR(Rn(R(si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pytraising_handler�sg�?iR�(RtsignalRR�RWtSIGALRMR�RttZeroDivisionErrorRtsendallRt
SOCK_MAX_SIZEttimeoutR(Rtwith_timeoutRRtcR_t	old_alarm((Rsi/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pytcheck_sendall_interrupted�s( 


cCs|jt�dS(N(RR(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttest_sendall_interrupted�scCs|jt�dS(N(RR(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt%test_sendall_interrupted_with_timeout�scCsWxPdD]H}tjtjtj�}|jtdf�|j|�|j�qWdS(Nii����(ii����(RRRRRRRR(Rtbacklogtsrv((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttest_listen_backlog�s


cCsbddl}tjtjtj�}|jtdf�|jt|j|j	d�|j
�dS(Ni����ii(t	_testcapiRRRRRRRtR�RtINT_MAXR(RR%R#((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttest_listen_backlog_overflow�s
sIPv6 required for this test.cCs]|jttjdd�tjtjtj�}z|jt|jd�Wd|j�XdS(Ns::1iI����i����(s::1iI����(s::1ii����(RtR�RR�R�RRR(RR_((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt
test_flowinfo�s
N(/RRRUt
skipUnlessRYRRaRfRmRuR�R�R�RR�R�R�R�R�R�R�RR�R�R�R�R�R�R�R�R�R�R�R�tosR�RRRR R!R$Rtcpython_onlyR'RR((((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyRX�sN!
	
			'						)							$	1					s!Threading required for this test.tBasicTCPTestcBs�eZdd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Zd�Ze
jeed�d
�d��Zd�Zd�Zd�Zd�Zd�Zeje�Zejd��ZRS(RHcCstj|d|�dS(NRI(RLR (RRI((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR scCs&|jjd�}|j|t�dS(Ni(RNtrecvR]tMSG(RR;((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestRecvscCs|jjt�dS(N(RSR�R.(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt	_testRecvscCsL|jjtt�d�}|jjd�}||}|j|t�dS(Nii(RNR-RR.R](Rtseg1tseg2R;((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestOverFlowRecvs
cCs|jjt�dS(N(RSR�R.(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt_testOverFlowRecvscCs,|jjd�\}}|j|t�dS(Ni(RNtrecvfromR]R.(RR;RP((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestRecvFromscCs|jjt�dS(N(RSR�R.(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt
_testRecvFrom"scCsX|jjtt�d�\}}|jjd�\}}||}|j|t�dS(Nii(RNR5RR.R](RR1RPR2R;((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestOverFlowRecvFrom%s"
cCs|jjt�dS(N(RSR�R.(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt_testOverFlowRecvFrom,scCsKd}x*|jjd�}|s%Pn||7}q	W|j|dd�dS(NRviR�i(RNR-R](RR;tread((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestSendAll/scCsdd}|jj|�dS(NR�i(RSR(Rt	big_chunk((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt_testSendAll9s
tfromfdssocket.fromfd not availablecCs]|jj�}tj|tjtj�}|j|j�|jd�}|j	|t
�dS(Ni(RNRZRR>RRRyRR-R]R.(RtfdRR;((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt
testFromFd=s
cCs|jjt�dS(N(RSR�R.(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt_testFromFdGscCsB|jj�}|j|j�|jd�}|j|t�dS(Ni(RNtdupRyRR-R]R.(RRR;((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestDupJscCs|jjt�dS(N(RSR�R.(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt_testDupQscCs3|jjd�}|j|t�|jj�dS(Ni(RNR-R]R.R)R4(RR;((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestShutdownTscCs$|jjt�|jjd�dS(Ni(RSR�R.tshutdown(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt
_testShutdown]scCstddl}|jjt�|jt|jj|jd�|jt|jjd|jd�|jjd�dS(Ni����ii(	R%RSR�R.RtR�RFR&tUINT_MAX(RR%((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt_testShutdown_overflowcs(RRR R/R0R3R4R6R7R8R9R;R=RUR)RRR@RARCRDRERGRR+ttestShutdown_overflowRI(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR,s(									
								tBasicUDPTestcBsJeZdd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(RHcCstj|d|�dS(NRI(RKR (RRI((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR qscCs,|jjtt��}|j|t�dS(N(RR-RR.R](RR;((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestSendtoAndRecvtscCs#|jjtdt|jf�dS(Ni(RJR|R.RRR
(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt_testSendtoAndRecvyscCs2|jjtt��\}}|j|t�dS(N(RR5RR.R](RR;RP((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR6|scCs#|jjtdt|jf�dS(Ni(RJR|R.RRR
(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR7�scCs|jt|jjd�dS(Ni����(RtR�RR5(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestRecvFromNegative�scCs#|jjtdt|jf�dS(Ni(RJR|R.RRR
(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt_testRecvFromNegative�s(	RRR RLRMR6R7RNRO(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyRKns					t
TCPCloserTestcBseZd�Zd�ZRS(cCs||jj�\}}|j�|j}tj|gggd�\}}}|j||g�|j|jd�d�dS(Ng�?iRv(RRMRRJtselectR]R-(RRORPtsdR:twriteR((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt	testClose�s
	$cCs*|jjt|jf�tjd�dS(Ng�?(RJRQRRR
ttimetsleep(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt
_testClose�s(RRRTRW(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyRP�s		RWstest needs socket.socketpair()tBasicSocketPairTestcBs8eZdd�Zd�Zd�Zd�Zd�ZRS(RHcCstj|d|�dS(NRI(RTR (RRI((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR �scCs&|jjd�}|j|t�dS(Ni(RR-R]R.(RR;((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR/�scCs|jjt�dS(N(RJR�R.(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR0�scCs|jjt�dS(N(RR�R.(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestSend�scCs&|jjd�}|j|t�dS(Ni(RJR-R]R.(RR;((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt	_testSend�s(RRR R/R0RYRZ(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyRX�s
			tNonBlockingTCPTestscBs}eZdd�Zd�Zd�Zejd��Zeje�Zd�Z	d�Z
d�Zd�Zd	�Z
d
�ZRS(RHcCstj|d|�dS(NRI(RGR (RRI((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR �scCs�|jjt�|j|jj��|jjt�|j|jj�d�tj�}y|jj�Wnt	j
k
r�nXtj�}|j||dkd�dS(Ngg�?s Error setting non-blocking mode.(RtsetblockingRRkR�RR]RURMRRR�(Rtstarttend((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestSetBlocking�scCsdS(N((R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt_testSetBlocking�scCs�ddl}|j|jkr.|jd�n|jjt�|j|jj�d�|jj|jd�|j	|jj��dS(Ni����sneeds UINT_MAX < ULONG_MAXgi(
R%RHt	ULONG_MAXR�RR\RR]R�Rk(RR%((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestSetBlocking_overflow�scCs�|jjd�y|jj�\}}Wntjk
r?nX|jd�tj|jggg�\}}}|j|kr�|jj�\}}|j�n
|jd�dS(Nis'Error trying to do non-blocking accept.s'Error trying to do accept after select.(RR\RMRRR:RQR(RRORPR:RSR((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt
testAccept�s
$
cCs*tjd�|jjt|jf�dS(Ng�������?(RURVRJRQRRR
(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt_testAccept�s
cCs#|jj�\}}|j�dS(N(RRMR(RRORP((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestConnect�scCs-|jjd�|jjt|jf�dS(Ni
(RJR�RQRRR
(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt_testConnect�scCs�|jj�\}}|jd�y|jtt��}Wntjk
rQnX|jd�t	j	|ggg�\}}}||kr�|jtt��}|j
�|j|t�n
|jd�dS(Nis%Error trying to do non-blocking recv.s0Error during select call to non-blocking socket.(RRMR\R-RR.RRR:RQRR](RRORPR;R:RSR((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR/�s

!
cCs:|jjt|jf�tjd�|jjt�dS(Ng�������?(RJRQRRR
RURVR�R.(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR0s
(RRR R_R`RR+Rbt_testSetBlocking_overflowRcRdReRfR/R0(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR[�s							tFileObjectClassTestCasecBs�eZdZdd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Zd�Zd�Z
d
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(i����RHcCstj|d|�dS(NRI(RLR (RRI((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR scCs,tj|�|jjd|j�|_dS(Ntrb(RLRRNtmakefiletbufsizet	serv_file(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyRs
cCs:|jj�|j|jj�tj|�d|_dS(N(RlRR�tclosedRLRR(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyRs

cCs&tj|�|jjd�|_dS(Ntwb(RLR<RSRjtcli_file(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR<s
cCs:|jj�|j|jj�d|_tj|�dS(N(RoRR�RmRRLRA(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyRAs
	cCsL|jjtt�d�}|jjd�}||}|j|t�dS(Ni(RlR:RR.R](Rt	first_segt
second_segR;((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt
testSmallRead%s
cCs!|jjt�|jj�dS(N(RoRSR.tflush(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt_testSmallRead,scCs#|jj�}|j|t�dS(N(RlR:R]R.(RR;((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestFullRead0scCs!|jjt�|jj�dS(N(RoRSR.R(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt
_testFullRead5scCsGd}x*|jjd�}|s%Pn||7}q	W|j|t�dS(NRvi(RlR:R]R.(Rtbuftchar((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestUnbufferedRead9scCs!|jjt�|jj�dS(N(RoRSR.Rs(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt_testUnbufferedReadCscCs#|jj�}|j|t�dS(N(RltreadlineR]R.(Rtline((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestReadlineGscCs!|jjt�|jj�dS(N(RoRSR.Rs(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt
_testReadlineLscCs�|jjtd��}|jd|�|jjtd��}|jd|�|jj�}|jd|�|jj�}|jd|�|jj�}|jt|�dS(Ns
A baloo iss a bears
sA BALOO IS A BEAR.
(RlR:RR]R{R.(Rt
a_baloo_ist_a_bearR|((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestReadlineAfterReadPscCsA|jjd�|jjd�|jjt�|jj�dS(NsA baloo is a bear
sA BALOO IS A BEAR.
(RoRSR.Rs(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt_testReadlineAfterRead\scCsK|jjtd��}|jd|�|jj�}|jd|�dS(NsEnd Of tLine(RlR:RR]R{(Rtend_of_R|((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestReadlineAfterReadNoNewlinebscCs|jjd�dS(NsEnd Of Line(RoRS(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt_testReadlineAfterReadNoNewlinehscCs|j|jj�dS(N(R�RlRm(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestClosedAttrkscCs|j|jj�dS(N(R�RoRm(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt_testClosedAttrns(RRRkR RRR<RARrRtRuRvRyRzR}R~R�R�R�R�R�R�(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyRh	s(									
								tFileObjectInterruptedTestCasecBsreZdZdefd��YZed��Zdd�Zdd�Zd�Z	d�Z
dd	�Zd
�ZRS(s=Test that the file object correctly handles EINTR internally.t
MockSocketcBseZdd�Zd�ZRS(cCst|�|_dS(N(titert
_recv_step(Rt
recv_funcs((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR vscCs|jj��S(N(R�tnext(RR�((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR-{s((RRR R-(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR�uscCstjtj��dS(N(RRR�tEINTR(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt_raise_eintr~si����cKsr|jdd�|jd�d�g�}tj||�}|j|j|�d�|j|j|�d�dS(NR�cSsdS(Ns"This is the first line
And the sec((((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR��scSsdS(Nsond line is here
((((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR��scSsdS(NRv((((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR��ssThis is the first line
sAnd the second line is here
(R�R�Rt_fileobjectR]R{(RR�Rot	mock_socktfo((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt_test_readline�s	cKsY|jdd�|jd�d�g�}tj||�}|j|j|�d�dS(NR�cSsdS(Ns"This is the first line
And the sec((((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR��scSsdS(Nsond line is here
((((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR��scSsdS(NRv((((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR��ss3This is the first line
And the second line is here
(R�R�RR�R]R:(RR�RoR�R�((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt
_test_read�s	cCs8|j�|jdd�|j�|jdd�dS(NR�id(R�R�(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttest_default�s

cCsP|jdd�|jdddd�|jdd�|jdddd�dS(NRkiR�id(R�R�(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttest_with_1k_buffer�scCs�|jdd�d�d�|jd�d�g�}tj|dd�}|j|j|�d	�|j|j|�d
�dS(NR�cSsdS(Ntaa((((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR��scSsdS(Ns
((((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR��scSsdS(NtBB((((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR��scSsdS(Ntbb((((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR��scSsdS(NRv((((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR��sRkisaa
tBBbb(R�R�RR�R]R{(RR�R�R�((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt_test_readline_no_buffer�s	cCsD|j�|jdd�|jdd�|jdddd�dS(NR�iRkiid(R�R�(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttest_no_buffer�s
(
RRRFtobjectR�tstaticmethodR�R�R�R�R�R�R�(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR�rs			
t!UnbufferedFileObjectClassTestCasecBs&eZdZdZd�Zd�ZRS(s�Repeat the tests from FileObjectClassTestCase with bufsize==0.

    In this case (and in this case only), it should be possible to
    create a file object, read a line from it, create another file
    object, read another line from it, without loss of data in the
    first file object's buffer.  Note that httplib relies on this
    when reading multiple requests from the same socket.icCsb|jj�}|j|dt�|jjdd�|_|jj�}|j|dt�dS(NsA. RiisB. (RlR{R]R.RNRj(RR|((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestUnbufferedReadline�s
cCs9|jjdt�|jjdt�|jj�dS(NsA. sB. (RoRSR.Rs(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt_testUnbufferedReadline�s(RRRFRkR�R�(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR��s	t#LineBufferedFileObjectClassTestCasecBs?eZdZdefd��YZd�Zd�Zd�ZRS(it
SocketMemocBsAeZdZd�Zdd�Zdd�Zd�Zd�ZRS(sGA wrapper to keep track of sent data, needed to examine write behaviourcCs||_g|_dS(N(Rgtsent(RR((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR �s	icCs-|jj||�}|jj|| �|S(N(RgR�R�tappend(Rtdatatflagstn((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR��scCs'|jj||�|jj|�dS(N(RgRR�R�(RR�R�((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR�scCst|j|�S(N(R.Rg(Rtattr((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt__getattr__�scCs5g|jD]'}t|t�r+|j�n|^q
S(N(R�t
isinstancet
memoryviewttobytes(RR�((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pytgetsent�s(RRRFR R�RR�R�(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR��s		cCs,tj|�|j|jj�|j_dS(N(RhRR�RlRg(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR�s
cCs�tj�}|j|I|j|IJ|j|I|j|I|j|IJ|jdIJ|jj�d||f}d|||f}d}|j|jjj�|||g�dS(NRvs%s %s
s	%s %s %s
s
(R.tstripRlRsR]RgR�(RR;tmsg1tmsg2tmsg3((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestLinebufferedWrite�s






cCs�tj�}d||f}d|||f}d}|jj�}|j||�|jj�}|j||�|jj�}|j||�dS(Ns%s %s
s	%s %s %s
s
(R.R�RoR{R](RR;R�R�R�tl1tl2tl3((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt_testLinebufferedWrites(RRRkR�R�RR�R�(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR��s
		t$SmallBufferedFileObjectClassTestCasecBseZdZRS(i(RRRk(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR�stNetworkConnectionTestcBseZdZd�ZRS(sProve network connection.cCs+tjt|jf�|_|j|_dS(N(Rtcreate_connectionRRR
RJRS(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR<s(RRRFR<(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR�st
BasicTCPTest2cBseZdZRS(sLTests that NetworkConnection does not break existing TCP functionality.
    (RRRF(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR�stNetworkConnectionNoServercBsNeZdejfd��YZejd��Zd�Zd�Zd�Z	RS(R�cBseZd�ZRS(cGstjd��dS(Ns	timed out(RR(RRn((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyRQ#s(RRRQ(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR�"sccs/tj}|jt_z	dVWd|t_XdS(s*Return a socket which times out on connectN(RR�(Rt
old_socket((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pytmocked_socket_module&s
		cCstj�}tjtjtj�}|j|j�|jtj��}|j	t
|f�WdQX|j|jj
t
j�dS(N(RR�RRRRyRRtRRQRRR]RR�tECONNREFUSED(RR
RJR�((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttest_connect0scCs�tj�}|jtj��}tjt|f�WdQXtjg}t	td�rh|j
tj�n|j|j
j|�dS(NtENETUNREACH(RR�RtRRR�RRR�R�RR�R�R}R(RR
R�texpected_errnos((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttest_create_connection8scCsC|j��1|jtj��tjtdf�WdQXWdQXdS(Ni�(R�RtRRR�RR(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttest_create_connection_timeoutSs
(
RRRR�t
contextlibtcontextmanagerR�R�R�R�(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR�!s

		tNetworkConnectionAttributesTestcBs�eZdd�Zd�Zd�Zd�ZeZd�ZeZd�Z	eZ
d�ZeZd�Z
eZd	�ZeZd
�ZRS(RHcCs$tj|d|�tj|�dS(NRI(RR R(RRI((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR ^scCstj�|_dS(N(RR�tsource_port(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR<bscCs'|jj�d|_tj|�dS(N(RJRRRRA(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyRAes
	cCs#|jj�\}}|j�dS(N(RRMR(RRORP((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt_justAcceptjscCsNtjt|jfdd�|_|j|jj�|j|jjd�dS(NRii(	RR�RRR
RJRyRR]R(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt_testFamilyos!cCsgtjt|jfdddd|jf�|_|j|jj�|j|jj	�d|j�dS(NRitsource_addressRvi(
RR�RRR
R�RJRyRR]Rz(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt_testSourceAddressuscCs�|jtj�dk�tjd�z2tjt|jf�|_|j	|jj
�Wdtjd�X|j|jj�d�dS(Ni*(
R�RR�RR�R�RRR
RJRyRR]R�(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt_testTimeoutDefault~s
cCs�|jtj�dk�tjd�z8tjt|jfdd�|_|j	|jj
�Wdtjd�X|j|jj�d�dS(NiR(
R�RR�RR�R�RRR
RJRyRR]R�(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt_testTimeoutNone�s
!cCs>tjt|jfdd�|_|j|jj�d�dS(NRi(RR�RRR
RJR]R�(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt_testTimeoutValueNamed�s!cCsNtjt|jfd�|_|j|jj�|j|jj�d�dS(Ni(	RR�RRR
RJRyRR]R�(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt_testTimeoutValueNonamed�s(RRR R<RAR�t
testFamilyR�ttestSourceAddressR�ttestTimeoutDefaultR�ttestTimeoutNoneR�ttestTimeoutValueNamedR�ttestTimeoutValueNonamedR�(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR�[s 								tNetworkConnectionBehaviourTestcBsGeZdd�Zd�Zd�Zd�ZeZd�Zd�ZRS(RHcCs$tj|d|�tj|�dS(NRI(RR R(RRI((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR �scCsdS(N((R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR<�scCs'|jj�d|_tj|�dS(N(RJRRRRA(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyRA�s
	cCsC|jj�\}}|j|j�tjd�|jd�dS(Nisdone!(RRMRyRRURVR�(RRORP((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestInsideTimeout�s
cCsBtjt|jf�|_}|jd�}|j|d�dS(Nisdone!(RR�RRR
RJR-R](RRR�((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt_testInsideTimeout�scsEtjt|jfdd�|_�|jtj�fd��dS(NRics
�jd�S(Ni(R-((R(si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR��s(RR�RRR
RJRtR(R((Rsi/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt_testOutsideTimeout�s%(	RRR R<RAR�ttestOutsideTimeoutR�R�(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR��s				tUrllib2FileobjectTestcBseZd�ZRS(cCs�ddd��Y}|�}tj|�}|j�|j|j�|�}tj|dt�}|j�|j|j�dS(NR�cBs eZeZd�Zd�ZRS(cSsdS(N((R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyRs�scSs
t|_dS(N(RRm(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR�s(RRRRmRsR(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR��s	R((RR�RR�RmR(RR�R_R�((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyRT�s	
	
(RRRT(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR��stTCPTimeoutTestcBs>eZd�Zd�Zejeed�d�d��ZRS(cs)�fd�}�jtj|d�dS(Ncs!�jjd��jj�dS(Ng�?(RR�RM(RnRo(R(si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt
raise_timeout�ss*Error generating a timeout exception (TCP)(RtRR(RR�((Rsi/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestTCPTimeout�scCs�t}y#|jjd�|jj�}WnMtjk
rL|jd�n-tjk
ret}n|jd�nX|s�|jd�ndS(Ngs%caught timeout instead of error (TCP)s!caught unexpected exception (TCP)s3accept() returned success when we did not expect it(	RRR�RMRRR:RR(RtokRw((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestTimeoutZero�s	Rstest needs signal.alarm()cs2|jjd�dtfd��Y��fd�}tjtj|�}z�y�tjd�z�y|jj�}Wn_tjk
r�|j	d�nL�k
r�n<|j	dt
j�d tj
�f�nX|j	d�Wdtjd	�XWn�k
r|j	d
�nXWdtjtj|�XdS(Ng@tAlarmcBseZRS((RR(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR��scs
��dS(N((Rtframe(R�(si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt
alarm_handler�siscaught timeout instead of Alarms3caught other exception instead of Alarm: %s(%s):
%ssnothing caughtisgot Alarm in wrong place(RR�R?RRRRMRRR:R�texc_infot	tracebackt
format_exc(RR�RRw((R�si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestInterruptedTimeout�s,

	#
(	RRR�R�RUR)RRR�(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR��s		tUDPTimeoutTestcBseZd�Zd�ZRS(cs)�fd�}�jtj|d�dS(Ncs$�jjd��jjd�dS(Ng�?i(RR�R-(RnRo(R(si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR�ss*Error generating a timeout exception (UDP)(RtRR(RR�((Rsi/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestUDPTimeoutscCs�t}y&|jjd�|jjd�}WnMtjk
rO|jd�n-tjk
rht}n|jd�nX|s�|jd�ndS(Ngis%caught timeout instead of error (UDP)s!caught unexpected exception (UDP)s1recv() returned success when we did not expect it(	RRR�R-RRR:RR(RR�Rw((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR�s	(RRR�R�(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR�s	tTestExceptionscBseZd�ZRS(cCsq|jttjt��|jttjtj��|jttjtj��|jttjtj��dS(N(R�t
issubclassRRR?RqRR(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestExceptionTree*s(RRR�(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR�(sR�sLinux specific testtTestLinuxAbstractNamespacecBs)eZdZd�Zd�Zd�ZRS(ilcCs�d}tjtjtj�}|j|�|jd�tjtjtj�}|j|j��|j�|j|j�|�|j|j	�|�dS(Ntpython-test-hello�i(
RtAF_UNIXRRRRQRzRMR]tgetpeername(Rtaddressts1ts2((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestLinuxAbstractNamespace5s


cCsTdd|jd}tjtjtj�}|j|�|j|j�|�dS(NR�thi(t
UNIX_PATH_MAXRR�RRR]Rz(RR�R_((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestMaxName@s
cCsFdd|j}tjtjtj�}|jtj|j|�dS(NR�R�(R�RR�RRtRR(RR�R_((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestNameOverflowFs(RRR�R�R�R�(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR�0s		tBufferIOTestcBs�eZdZdd�Zd�Zd�Zd�ZeZd�ZeZ	d�Z
d�Zd	�ZeZ
d
�ZeZd�Zd�Zd
�ZeZRS(sF
    Test the buffer versions of socket.recv() and socket.send().
    RHcCstj|d|�dS(NRI(RLR (RRI((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR QscCshtjddd�}|jj|�}|j|tt��|j�tt� }|j|t�dS(NRt i(tarrayRNt	recv_intoR]RR.ttostring(RRwtnbytesR;((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestRecvIntoArrayTs
cCs3tj��tt�}WdQX|jj|�dS(N(Rtcheck_py3k_warningstbufferR.RSR�(RRw((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt_testRecvIntoArray[s
cCsXtd�}|jj|�}|j|tt��|tt� }|j|t�dS(Ni(t	bytearrayRNR�R]RR.(RRwRR;((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestRecvIntoBytearray`s
cCs^td�}|jjt|��}|j|tt��|tt� }|j|t�dS(Ni(RRNR�R�R]RR.(RRwRR;((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestRecvIntoMemoryviewis
cCsntjddd�}|jj|�\}}|j|tt��|j�tt� }|j|t�dS(NRR�i(R�RNt
recvfrom_intoR]RR.R�(RRwRRPR;((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestRecvFromIntoArrayrs
cCs3tj��tt�}WdQX|jj|�dS(N(RRRR.RSR�(RRw((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt_testRecvFromIntoArrayys
cCs^td�}|jj|�\}}|j|tt��|tt� }|j|t�dS(Ni(RRNRR]RR.(RRwRRPR;((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestRecvFromIntoBytearray~s
cCsdtd�}|jjt|��\}}|j|tt��|tt� }|j|t�dS(Ni(RRNRR�R]RR.(RRwRRPR;((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestRecvFromIntoMemoryview�s
cCs,td�}|jt|jj|d�dS(Nii(RRtR�RNR(RRw((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestRecvFromIntoSmallBuffer�scCs3tj��tt�}WdQX|jj|�dS(N(RRRR.RSR�(RRw((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt_testRecvFromIntoSmallBuffer�s
cCs0t�}|jj|�|jj|d�dS(Ni(RRNR(RRw((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestRecvFromIntoEmptyBuffer�s	(RRRFR RRRt_testRecvIntoBytearrayRt_testRecvIntoMemoryviewR	R
Rt_testRecvFromIntoBytearrayRt_testRecvFromIntoMemoryviewR
RRt_testRecvFromIntoEmptyBuffer(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR�Ls$											i�i�i�cCsfttd�stStjjd�s)tStd��+}x!|D]}|jd�r?tSq?WWdQXtS(s�Check if the TIPC module is loaded

    The TIPC module is not loaded automatically on Ubuntu and probably
    other Linux distros.
    tAF_TIPCs
/proc/modulesstipc N(	RRRR*tpathtisfiletopenR�R(R�R|((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pytisTipcAvailable�s
s6TIPC module is not loaded, please 'sudo modprobe tipc'tTIPCTestcBseZd�ZRS(cCs�tjtjtj�}tjtjtj�}|jtjtjd�tjttt	f}|j
|�tjttt	tddf}|jt
|�|jd�\}}|j|j�|�|j|t
�dS(Niiii(RRR�R�R�R�tTIPC_ADDR_NAMESEQt
TIPC_STYPEt
TIPC_LOWERt
TIPC_UPPERRtTIPC_ADDR_NAMER|R.R5R]Rz(RR#RJtsrvaddrtsendaddrR;trecvaddr((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyttestRDM�s	
	(RRR#(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR�stTIPCThreadableTestcBs8eZdd�Zd�Zd�Zd�Zd�ZRS(RHcCs'tjj|d|�tj|�dS(NRI(RURVR R(RRI((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR �scCs�tjtjtj�|_|jjtjtjd�tjtt	t
f}|jj|�|jjd�|j
�|jj�\|_|_dS(Nii(RRRR#R�R�R�RRRRRRR#RMROtconnaddr(RR ((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR�s	
cCsotjd�tjtjtj�|_tjttt	tddf}|jj
|�|jj�|_dS(Ng�������?ii(
RURVRRRRJRRRRRQRztcliaddr(RRP((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR<�s
	cCs<|jjd�}|j|t�|j|j|j�dS(Ni(ROR-R]R.R&R%(RR;((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt
testStream�scCs!|jjt�|jj�dS(N(RJR�R.R(R((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt_testStream�s(RRR RR<R'R((((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyR$�s
	
		cCs�tttttttttg	}|j	t
ttt
ttttttg
�|jt�|jt�|j	ttg�tj�}tj|�tj|�dS(N(RXR,RPR�R�R�R�RKR�textendR[RhR�R�R�R�R�R�R�R�R�RXR�RR$Rtthreading_setuptrun_unittesttthreading_cleanup(tteststthread_info((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt	test_main�s(	



t__main__(GRUttestRR�R�RRQRUR�R*R�R*R�R�RRRbRYR�RRR
RRR.R�R�RR/R&RVRRRRGRKRLRTRXR)R,RKRPRRXR[RhR�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�RRRRRR$R/R(((si/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_socket.pyt<module>s�

	

	
b��
hWhF?:D9U			$