class documentation

Builder defining tests relating to IReactorUNIX.

Method test_addresses A client's transport's getHost and getPeer return UNIXAddress instances which have the filesystem path of the host and peer ends of the connection.
Method test_avoidLeakingFileDescriptors If associated with a protocol which does not provide IFileDescriptorReceiver, file descriptors received by the IUNIXTransport implementation are closed and a warning is emitted.
Method test_connectToLinuxAbstractNamespace IReactorUNIX.connectUNIX also accepts a Linux abstract namespace path.
Method test_descriptorDeliveredBeforeBytes IUNIXTransport.sendFileDescriptor sends file descriptors before ITransport.write sends normal bytes.
Method test_fileDescriptorOverrun If IUNIXTransport.sendFileDescriptor is used to queue a greater number of file descriptors than the number of bytes sent using ITransport.write, the connection is closed and the protocol connected to the transport has its ...
Method test_listenFailure IReactorUNIX.listenUNIX raises CannotListenError if the underlying port's createInternetSocket raises a socket error.
Method test_listenOnLinuxAbstractNamespace On Linux, a UNIX socket path may begin with '' to indicate a socket in the abstract namespace. IReactorUNIX.listenUNIX accepts such a path.
Method test_mode The UNIX socket created by IReactorUNIX.listenUNIX is created with the mode specified.
Method test_multiFileDescriptorReceivedPerRecvmsgBadCMSG _SendmsgMixin handles multiple file descriptors per recvmsg, calling IFileDescriptorReceiver.fileDescriptorReceived once per received file descriptor. Scenario: unsupported CMSGs.
Method test_multiFileDescriptorReceivedPerRecvmsgOneCMSG _SendmsgMixin handles multiple file descriptors per recvmsg, calling IFileDescriptorReceiver.fileDescriptorReceived once per received file descriptor. Scenario: single CMSG with two FDs.
Method test_multiFileDescriptorReceivedPerRecvmsgTwoCMSGs _SendmsgMixin handles multiple file descriptors per recvmsg, calling IFileDescriptorReceiver.fileDescriptorReceived once per received file descriptor. Scenario: two CMSGs with one FD each.
Method test_sendFileDescriptor IUNIXTransport.sendFileDescriptor accepts an integer file descriptor and sends a copy of it to the process reading from the connection.
Method test_sendFileDescriptorTriggersPauseProducing If a IUNIXTransport.sendFileDescriptor call fills up the send buffer, any registered producer is paused.
Class Variable endpoints Undocumented
Class Variable requiredInterfaces Undocumented
Method _sendmsgMixinFileDescriptorReceivedDriver Drive _SendmsgMixin via sendmsg socket calls to check that IFileDescriptorReceiver.fileDescriptorReceived is called once for each file descriptor received in the ancillary messages.

Inherited from UNIXFamilyMixin:

Method _modeTest Assert that the mode of the created unix socket is set to the mode specified to the reactor method.

Inherited from ReactorBuilder (via UNIXFamilyMixin):

Class Method makeTestCaseClasses Create a SynchronousTestCase subclass which mixes in cls for each known reactor and return a dict mapping their names to them.
Method buildReactor Create and return a reactor using self.reactorFactory.
Method getTimeout Determine how long to run the test before considering it failed.
Method runReactor Run the reactor for at most the given amount of time.
Method setUp Clear the SIGCHLD handler, if there is one, to ensure an environment like the one which exists prior to a call to reactor.run.
Method tearDown Restore the original SIGCHLD handler and reap processes as long as there seem to be any remaining.
Method unbuildReactor Clean up any resources which may have been allocated for the given reactor by its creation or by a test which used it.
Class Variable skippedReactors A dict mapping FQPN strings of reactors for which the tests defined by this class will be skipped to strings giving the skip message.
Instance Variable originalHandler The SIGCHLD handler which was installed when setUp ran and which will be re-installed when tearDown runs.
Instance Variable reactorFactory A no-argument callable which returns the reactor to use for testing.
Instance Variable _reactors A list of FQPN strings giving the reactors for which SynchronousTestCases will be created.

Inherited from ConnectionTestsMixin (via UNIXFamilyMixin, ReactorBuilder):

Method test_logPrefix Client and server transports implement ILoggingContext.logPrefix to return a message reflecting the protocol they are running.
Method test_protocolGarbageAfterLostConnection After the connection a protocol is being used for is closed, the reactor discards all of its references to the protocol.
Method test_writeAfterDisconnect After a connection is disconnected, ITransport.write and ITransport.writeSequence are no-ops.
def test_addresses(self): (source)

A client's transport's getHost and getPeer return UNIXAddress instances which have the filesystem path of the host and peer ends of the connection.

@skipIf(not sendmsg, sendmsgSkipReason)
def test_avoidLeakingFileDescriptors(self): (source)

If associated with a protocol which does not provide IFileDescriptorReceiver, file descriptors received by the IUNIXTransport implementation are closed and a warning is emitted.

@skipIf(not platform.isLinux(), 'Abstract namespace UNIX sockets only supported on Linux.')
def test_connectToLinuxAbstractNamespace(self): (source)

IReactorUNIX.connectUNIX also accepts a Linux abstract namespace path.

@skipIf(not sendmsg, sendmsgSkipReason)
def test_descriptorDeliveredBeforeBytes(self): (source)

IUNIXTransport.sendFileDescriptor sends file descriptors before ITransport.write sends normal bytes.

@skipIf(not sendmsg, sendmsgSkipReason)
def test_fileDescriptorOverrun(self): (source)

If IUNIXTransport.sendFileDescriptor is used to queue a greater number of file descriptors than the number of bytes sent using ITransport.write, the connection is closed and the protocol connected to the transport has its connectionLost method called with a failure wrapping FileDescriptorOverrun.

def test_listenFailure(self): (source)

IReactorUNIX.listenUNIX raises CannotListenError if the underlying port's createInternetSocket raises a socket error.

@skipIf(not platform.isLinux(), 'Abstract namespace UNIX sockets only supported on Linux.')
def test_listenOnLinuxAbstractNamespace(self): (source)

On Linux, a UNIX socket path may begin with '' to indicate a socket in the abstract namespace. IReactorUNIX.listenUNIX accepts such a path.

def test_mode(self): (source)

The UNIX socket created by IReactorUNIX.listenUNIX is created with the mode specified.

@skipIf(not sendmsg, sendmsgSkipReason)
def test_multiFileDescriptorReceivedPerRecvmsgBadCMSG(self): (source)

_SendmsgMixin handles multiple file descriptors per recvmsg, calling IFileDescriptorReceiver.fileDescriptorReceived once per received file descriptor. Scenario: unsupported CMSGs.

@skipIf(not sendmsg, sendmsgSkipReason)
def test_multiFileDescriptorReceivedPerRecvmsgOneCMSG(self): (source)

_SendmsgMixin handles multiple file descriptors per recvmsg, calling IFileDescriptorReceiver.fileDescriptorReceived once per received file descriptor. Scenario: single CMSG with two FDs.

@skipIf(platform.isMacOSX(), 'Multi control message ancillary sendmsg not supported on Mac.')
@skipIf(not sendmsg, sendmsgSkipReason)
def test_multiFileDescriptorReceivedPerRecvmsgTwoCMSGs(self): (source)

_SendmsgMixin handles multiple file descriptors per recvmsg, calling IFileDescriptorReceiver.fileDescriptorReceived once per received file descriptor. Scenario: two CMSGs with one FD each.

@skipIf(not sendmsg, sendmsgSkipReason)
def test_sendFileDescriptor(self): (source)

IUNIXTransport.sendFileDescriptor accepts an integer file descriptor and sends a copy of it to the process reading from the connection.

@skipIf(not sendmsg, sendmsgSkipReason)
def test_sendFileDescriptorTriggersPauseProducing(self): (source)

If a IUNIXTransport.sendFileDescriptor call fills up the send buffer, any registered producer is paused.

def _sendmsgMixinFileDescriptorReceivedDriver(self, ancillaryPacker): (source)

Drive _SendmsgMixin via sendmsg socket calls to check that IFileDescriptorReceiver.fileDescriptorReceived is called once for each file descriptor received in the ancillary messages.

Parameters
ancillaryPackerA callable that will be given a list of two file descriptors and should return a two-tuple where: The first item is an iterable of zero or more (cmsg_level, cmsg_type, cmsg_data) tuples in the same order as the given list for actual sending via sendmsg; the second item is an integer indicating the expected number of FDs to be received.