@@ -474,7 +474,11 @@ public void removeContainer() throws DockerException {
474
474
@ Test
475
475
public void testPullImage () throws DockerException , IOException {
476
476
477
- String testImage = "kpelykh/vimbase" ;
477
+ // This should be an image that is not used by other repositories already
478
+ // pulled down, preferably small in size. If tag is not used pull will
479
+ // download all images in that repository but tmpImgs will only
480
+ // deleted 'latest' image but not images with other tags
481
+ String testImage = "hackmann/empty" ;
478
482
479
483
LOG .info ("Removing image: {}" , testImage );
480
484
dockerClient .removeImage (testImage );
@@ -486,6 +490,7 @@ public void testPullImage() throws DockerException, IOException {
486
490
487
491
LOG .info ("Pulling image: {}" , testImage );
488
492
493
+ tmpImgs .add (testImage );
489
494
ClientResponse response = dockerClient .pull (testImage );
490
495
491
496
StringWriter logwriter = new StringWriter ();
@@ -503,15 +508,12 @@ public void testPullImage() throws DockerException, IOException {
503
508
}
504
509
505
510
String fullLog = logwriter .toString ();
506
- assertThat (fullLog ,
507
- containsString ("Pulling repository kpelykh/vimbase" ));
508
-
509
- tmpImgs .add (testImage );
511
+ assertThat (fullLog , containsString ("Download complete" ));
510
512
511
513
info = dockerClient .info ();
512
514
LOG .info ("Client info after pull, {}" , info .toString ());
513
515
514
- assertThat (imgCount + 1 , equalTo (info .getImages ()));
516
+ assertThat (imgCount , lessThan (info .getImages ()));
515
517
516
518
ImageInspectResponse imageInspectResponse = dockerClient
517
519
.inspectImage (testImage );
0 commit comments