File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
src/test/java/com/github/dockerjava Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,23 @@ public void inspectContainer() throws DockerException {
6363
6464 }
6565
66+ @ Test ()
67+ public void inspectContainerWithSize () throws DockerException {
68+
69+ String containerName = "generated_" + new SecureRandom ().nextInt ();
70+
71+ CreateContainerResponse container = dockerClient .createContainerCmd ("busybox" ).withCmd ("top" )
72+ .withName (containerName ).exec ();
73+ LOG .info ("Created container {}" , container .toString ());
74+ assertThat (container .getId (), not (isEmptyString ()));
75+
76+ InspectContainerResponse containerInfo = dockerClient .inspectContainerCmd (container .getId ())
77+ .withSize (true )
78+ .exec ();
79+ assertNotNull (containerInfo .getSizeRootFs ());
80+ assertEquals (containerInfo .getId (), container .getId ());
81+ }
82+
6683 @ Test (expectedExceptions = NotFoundException .class )
6784 public void inspectNonExistingContainer () throws DockerException {
6885 dockerClient .inspectContainerCmd ("non-existing" ).exec ();
Original file line number Diff line number Diff line change @@ -63,6 +63,21 @@ public void inspectContainer() throws DockerException {
6363
6464 }
6565
66+ @ Test ()
67+ public void inspectContainerWithSize () throws DockerException {
68+
69+ String containerName = "generated_" + new SecureRandom ().nextInt ();
70+
71+ CreateContainerResponse container = dockerClient .createContainerCmd ("busybox" ).withCmd ("top" )
72+ .withName (containerName ).exec ();
73+ LOG .info ("Created container {}" , container .toString ());
74+ assertThat (container .getId (), not (isEmptyString ()));
75+
76+ InspectContainerResponse containerInfo = dockerClient .inspectContainerCmd (container .getId ()).exec ();
77+ assertEquals (containerInfo .getId (), container .getId ());
78+ assertNotNull (containerInfo .getSizeRootFs ());
79+ }
80+
6681 @ Test (expectedExceptions = NotFoundException .class )
6782 public void inspectNonExistingContainer () throws DockerException {
6883 dockerClient .inspectContainerCmd ("non-existing" ).exec ();
You can’t perform that action at this time.
0 commit comments