Fix tests on newer versions
Fix DefaultDockerClientTest.testStorageOpt() on 17.09
Fix DefaultDockerClientTest.testRenameContainer() on 17.09 and .10
@@ -4220,10 +4220,14 @@ public class DefaultDockerClientTest {
assertThat(e.getContainerId(), equalTo(id2));
assertThat(e.getNewName(), equalToIgnoreLeadingSlash(newName));
} catch (DockerRequestException ignored) {
- // This is a docker bug. It responds with HTTP 500 when it should be HTTP 409.
+ // This is a docker bug. Docker responds with HTTP 500 when it should be HTTP 409.
// See https://github.com/docker/docker/issues/21016.
- // Fixed in version 1.11.0, so we should see a lower version.
- assertThat(compareVersion(sut.version().version(), "1.11.0"), lessThan(0));
+ // Fixed in version 1.11.0 API version 1.23. So we should see a lower API version here.
+ // Seems to be a regression in API version 1.3[23] https://github.com/moby/moby/issues/35472
+ assertThat(dockerApiVersionLessThan("1.23")
+ || dockerApiVersionEquals("1.32")
+ || dockerApiVersionEquals("1.33"),
+ is(true));
}
// Rename a non-existent id. Should get ContainerNotFoundException.
@@ -4662,6 +4666,9 @@ public class DefaultDockerClientTest {
public void testStorageOpt() throws Exception {
requireDockerApiVersionAtLeast("1.24", "StorageOpt");
requireStorageDriverNotAufs();
+ // Doesn't work on Travis with Docker API v1.32 because storage driver doesn't have pquota
+ // mount option enabled.
+ assumeFalse(dockerApiVersionEquals("1.32") && TRAVIS);
// Pull image
sut.pull(BUSYBOX_LATEST);
