Skip to content

Commit 2a6d92d

Browse files
committed
fixed tests
1 parent 135f71c commit 2a6d92d

4 files changed

Lines changed: 14 additions & 7 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Run build with tests:
4949
<dependency>
5050
<groupId>com.kpelykh</groupId>
5151
<artifactId>docker-java</artifactId>
52-
<version>0.8.1-SNAPSHOT</version>
52+
<version>0.8.1</version>
5353
</dependency>
5454

5555

src/test/java/com/kpelykh/docker/client/test/DockerClientTest.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,10 @@ public void testLogs() throws DockerException, IOException {
312312
assertThat(fullLog, endsWith(snippet));
313313
}
314314

315+
//This test doesn't work in Ubuntu 12.04 due to
316+
//Error mounting '/dev/mapper/docker-8:5-...
317+
//ref: https://github.com/dotcloud/docker/issues/4036
318+
315319
@Test
316320
public void testDiff() throws DockerException {
317321
ContainerConfig containerConfig = new ContainerConfig();
@@ -329,7 +333,7 @@ public void testDiff() throws DockerException {
329333
List filesystemDiff = dockerClient.containterDiff(container.getId());
330334
LOG.info("Container DIFF: {}", filesystemDiff.toString());
331335

332-
assertThat(filesystemDiff.size(), equalTo(3));
336+
assertThat(filesystemDiff.size(), equalTo(1));
333337
ChangeLog testChangeLog = selectUnique(filesystemDiff, hasField("path", equalTo("/test")));
334338

335339
assertThat(testChangeLog, hasField("path", equalTo("/test")));
@@ -446,7 +450,7 @@ public void removeContainer() throws DockerException {
446450
@Test
447451
public void testPullImage() throws DockerException, IOException {
448452

449-
String testImage = "ubuntu";
453+
String testImage = "centos";
450454

451455
LOG.info("Removing image: {}", testImage);
452456
dockerClient.removeImage(testImage);
@@ -474,20 +478,23 @@ public void testPullImage() throws DockerException, IOException {
474478
}
475479

476480
String fullLog = logwriter.toString();
477-
assertThat(fullLog, containsString("Pulling repository ubuntu"));
481+
assertThat(fullLog, containsString("Download complete"));
478482

479483
tmpImgs.add(testImage);
480484

481485
info = dockerClient.info();
482486
LOG.info("Client info after pull, {}", info.toString());
483487

484-
assertThat(imgCount + 1, equalTo(info.getImages()));
488+
assertThat(imgCount, lessThan(info.getImages()));
485489

486490
ImageInspectResponse imageInspectResponse = dockerClient.inspectImage(testImage);
487491
LOG.info("Image Inspect: {}", imageInspectResponse.toString());
488492
assertThat(imageInspectResponse, notNullValue());
489493
}
490494

495+
//This test doesn't work in Ubuntu 12.04 due to
496+
//Error mounting '/dev/mapper/docker-8:5-...
497+
//ref: https://github.com/dotcloud/docker/issues/4036
491498

492499
@Test
493500
public void commitImage() throws DockerException {

src/test/resources/testAddFile/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM ubuntu
22

33
# Copy testrun.sh files into the container
44

5-
add ./testrun.sh /tmp/
5+
ADD ./testrun.sh /tmp/
66

77
run cp /tmp/testrun.sh /usr/local/bin/ && chmod +x /usr/local/bin/testrun.sh
88

src/test/resources/testAddFolder/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM ubuntu
22

33
# Copy testrun.sh files into the container
44

5-
add . /src/
5+
ADD . /src/
66

77
run ls -la /src
88

0 commit comments

Comments
 (0)