Add CgroupParent option for create cmd by KostyaSha · Pull Request #510 · docker-java/docker-java

Expand Up @@ -67,7 +67,7 @@ public void afterMethod(ITestResult result) { super.afterMethod(result); }
@Test @Test(expectedExceptions = ConflictException.class) public void createContainerWithExistingName() throws DockerException {
String containerName = "generated_" + new SecureRandom().nextInt(); Expand All @@ -79,11 +79,7 @@ public void createContainerWithExistingName() throws DockerException {
assertThat(container.getId(), not(isEmptyString()));
try { dockerClient.createContainerCmd("busybox").withCmd("env").withName(containerName).exec(); fail("expected ConflictException"); } catch (ConflictException e) { } dockerClient.createContainerCmd("busybox").withCmd("env").withName(containerName).exec(); }
@Test Expand Down Expand Up @@ -554,4 +550,18 @@ public void createContainerWithLogConfig() throws DockerException { // null becomes empty string assertEquals(inspectContainerResponse.getHostConfig().getLogConfig().type, logConfig.type); }
@Test(groups = "ignoreInCircleCi") public void createContainerWithCgroupParent() throws DockerException { CreateContainerResponse container = dockerClient.createContainerCmd("busybox") .withCgroupParent("/parent").exec();
LOG.info("Created container {}", container.toString());
assertThat(container.getId(), not(isEmptyString()));
InspectContainerResponse inspectContainer = dockerClient.inspectContainerCmd(container.getId()).exec();
assertThat(inspectContainer.getHostConfig().getCgroupParent(), is("/parent")); } }