@BeforeClass public static void checkVersion() { Assume.assumeTrue(TestEnvironment.dockerApiAtLeast("1.22")); }
/** * The getTestHostIpAddress() method is only implemented for OS X running docker-machine. Skip JUnit execution elsewhere. */ @BeforeClass public static void checkOS() { Assume.assumeTrue("These tests are currently only applicable to OS X", IS_OS_MAC_OSX); Assume.assumeTrue("These tests are only applicable to docker machine", TestEnvironment.dockerIsDockerMachine()); }
@Test public void testExecInContainer() throws Exception { // The older "lxc" execution driver doesn't support "exec". At the time of writing (2016/03/29), // that's the case for CircleCI. // Once they resolve the issue, this clause can be removed. Assume.assumeTrue(TestEnvironment.dockerExecutionDriverSupportsExec()); final GenericContainer.ExecResult result = redis.execInContainer("redis-cli", "role"); assertTrue("Output for \"redis-cli role\" command should start with \"master\"", result.getStdout().startsWith("master")); assertEquals("Stderr for \"redis-cli role\" command should be empty", "", result.getStderr()); // We expect to reach this point for modern Docker versions. }
if (!TestEnvironment.dockerExecutionDriverSupportsExec()) {
if (!TestEnvironment.dockerExecutionDriverSupportsExec()) {
@BeforeClass public static void checkVersion() { Assume.assumeTrue(TestEnvironment.dockerApiAtLeast("1.22")); }
@BeforeClass public static void checkVersion() { Assume.assumeTrue(TestEnvironment.dockerApiAtLeast("1.22")); }
@BeforeClass public static void checkVersion() { Assume.assumeTrue(TestEnvironment.dockerApiAtLeast("1.22")); }