toil.test.lib.dockerTest

Module Contents

Classes

DockerTest

Tests dockerCall and ensures no containers are left around.

Attributes

logger

toil.test.lib.dockerTest.logger
class toil.test.lib.dockerTest.DockerTest(methodName='runTest')[source]

Bases: toil.test.ToilTest

Tests dockerCall and ensures no containers are left around. When running tests you may optionally set the TOIL_TEST_TEMP environment variable to the path of a directory where you want temporary test files be placed. The directory will be created if it doesn’t exist. The path may be relative in which case it will be assumed to be relative to the project root. If TOIL_TEST_TEMP is not defined, temporary files and directories will be created in the system’s default location for such files and any temporary files or directories left over from tests will be removed automatically removed during tear down. Otherwise, left-over files will not be removed.

setUp()[source]

Hook method for setting up the test fixture before exercising it.

testDockerClean(caching=False, detached=True, rm=True, deferParam=None)[source]

Run the test container that creates a file in the work dir, and sleeps for 5 minutes. Ensure that the calling job gets SIGKILLed after a minute, leaving behind the spooky/ghost/zombie container. Ensure that the container is killed on batch system shutdown (through the deferParam mechanism).

testDockerClean_CRx_FORGO()[source]
testDockerClean_CRx_STOP()[source]
testDockerClean_CRx_RM()[source]
testDockerClean_CRx_None()[source]
testDockerClean_CxD_FORGO()[source]
testDockerClean_CxD_STOP()[source]
testDockerClean_CxD_RM()[source]
testDockerClean_CxD_None()[source]
testDockerClean_Cxx_FORGO()[source]
testDockerClean_Cxx_STOP()[source]
testDockerClean_Cxx_RM()[source]
testDockerClean_Cxx_None()[source]
testDockerClean_xRx_FORGO()[source]
testDockerClean_xRx_STOP()[source]
testDockerClean_xRx_RM()[source]
testDockerClean_xRx_None()[source]
testDockerClean_xxD_FORGO()[source]
testDockerClean_xxD_STOP()[source]
testDockerClean_xxD_RM()[source]
testDockerClean_xxD_None()[source]
testDockerClean_xxx_FORGO()[source]
testDockerClean_xxx_STOP()[source]
testDockerClean_xxx_RM()[source]
testDockerClean_xxx_None()[source]
testDockerPipeChain(caching=False)[source]

Test for piping API for dockerCall(). Using this API (activated when list of argument lists is given as parameters), commands a piped together into a chain. ex: parameters=[ ['printf', 'x\n y\n'], ['wc', '-l'] ] should execute: printf 'x\n y\n' | wc -l

testDockerPipeChainErrorDetection(caching=False)[source]

By default, executing cmd1 | cmd2 | … | cmdN, will only return an error if cmdN fails. This can lead to all manor of errors being silently missed. This tests to make sure that the piping API for dockerCall() throws an exception if non-last commands in the chain fail.

testNonCachingDockerChain()[source]
testNonCachingDockerChainErrorDetection()[source]
testDockerLogs(stream=False, demux=False)[source]

Test for the different log outputs when deatch=False.

testDockerLogs_Stream()[source]
testDockerLogs_Demux()[source]
testDockerLogs_Demux_Stream()[source]