@@ -19,7 +19,8 @@ func checkValidGraphDriver(c *check.C, name string) {
1919}
2020
2121func (s * DockerSuite ) TestInspectImage (c * check.C ) {
22- printTestCaseName (); defer printTestDuration (time .Now ())
22+ printTestCaseName ()
23+ defer printTestDuration (time .Now ())
2324 testRequires (c , DaemonIsLinux )
2425 imageTest := "busybox"
2526 ensureImageExist (c , imageTest )
@@ -29,14 +30,15 @@ func (s *DockerSuite) TestInspectImage(c *check.C) {
2930 // fails, fix the difference in the image serialization instead of
3031 // updating this hash.
3132 // Warning: before test , make sure imageTest and imageTestId are match
32- imageTestID := "sha256:47bcc53f74dc94b1920f0b34f6036096526296767650f223433fe65c35f149eb "
33+ imageTestID := "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749 "
3334 id := inspectField (c , imageTest , "Id" )
3435
3536 c .Assert (id , checker .Equals , imageTestID )
3637}
3738
3839func (s * DockerSuite ) TestInspectInt64 (c * check.C ) {
39- printTestCaseName (); defer printTestDuration (time .Now ())
40+ printTestCaseName ()
41+ defer printTestDuration (time .Now ())
4042 testRequires (c , DaemonIsLinux )
4143
4244 dockerCmd (c , "run" , "-d" , "--name" , "inspect-test" , "busybox" , "true" )
@@ -45,7 +47,8 @@ func (s *DockerSuite) TestInspectInt64(c *check.C) {
4547}
4648
4749func (s * DockerSuite ) TestInspectDefault (c * check.C ) {
48- printTestCaseName (); defer printTestDuration (time .Now ())
50+ printTestCaseName ()
51+ defer printTestDuration (time .Now ())
4952 testRequires (c , DaemonIsLinux )
5053 //Both the container and image are named busybox. docker inspect will fetch the container JSON.
5154 //If the container JSON is not available, it will go for the image JSON.
@@ -58,8 +61,9 @@ func (s *DockerSuite) TestInspectDefault(c *check.C) {
5861}
5962
6063func (s * DockerSuite ) TestInspectStatus (c * check.C ) {
61- printTestCaseName (); defer printTestDuration (time .Now ())
62- // defer unpauseAllContainers()
64+ printTestCaseName ()
65+ defer printTestDuration (time .Now ())
66+ // defer unpauseAllContainers()
6367 testRequires (c , DaemonIsLinux )
6468 out , _ := dockerCmd (c , "run" , "-d" , "busybox" , "top" )
6569 out = getIDfromOutput (c , out )
@@ -74,7 +78,8 @@ func (s *DockerSuite) TestInspectStatus(c *check.C) {
7478}
7579
7680func (s * DockerSuite ) TestInspectTypeFlagContainer (c * check.C ) {
77- printTestCaseName (); defer printTestDuration (time .Now ())
81+ printTestCaseName ()
82+ defer printTestDuration (time .Now ())
7883 testRequires (c , DaemonIsLinux )
7984 //Both the container and image are named busybox. docker inspect will fetch container
8085 //JSON State.Running field. If the field is true, it's a container.
@@ -87,7 +92,8 @@ func (s *DockerSuite) TestInspectTypeFlagContainer(c *check.C) {
8792}
8893
8994func (s * DockerSuite ) TestInspectTypeFlagWithNoContainer (c * check.C ) {
90- printTestCaseName (); defer printTestDuration (time .Now ())
95+ printTestCaseName ()
96+ defer printTestDuration (time .Now ())
9197 testRequires (c , DaemonIsLinux )
9298 //Run this test on an image named busybox. docker inspect will try to fetch container
9399 //JSON. Since there is no container named busybox and --type=container, docker inspect will
@@ -101,7 +107,8 @@ func (s *DockerSuite) TestInspectTypeFlagWithNoContainer(c *check.C) {
101107}
102108
103109func (s * DockerSuite ) TestInspectTypeFlagWithImage (c * check.C ) {
104- printTestCaseName (); defer printTestDuration (time .Now ())
110+ printTestCaseName ()
111+ defer printTestDuration (time .Now ())
105112 testRequires (c , DaemonIsLinux )
106113 //Both the container and image are named busybox. docker inspect will fetch image
107114 //JSON as --type=image. if there is no image with name busybox, docker inspect
@@ -114,7 +121,8 @@ func (s *DockerSuite) TestInspectTypeFlagWithImage(c *check.C) {
114121}
115122
116123func (s * DockerSuite ) TestInspectTypeFlagWithInvalidValue (c * check.C ) {
117- printTestCaseName (); defer printTestDuration (time .Now ())
124+ printTestCaseName ()
125+ defer printTestDuration (time .Now ())
118126 testRequires (c , DaemonIsLinux )
119127 //Both the container and image are named busybox. docker inspect will fail
120128 //as --type=foobar is not a valid value for the flag.
@@ -128,7 +136,8 @@ func (s *DockerSuite) TestInspectTypeFlagWithInvalidValue(c *check.C) {
128136}
129137
130138func (s * DockerSuite ) TestInspectImageFilterInt (c * check.C ) {
131- printTestCaseName (); defer printTestDuration (time .Now ())
139+ printTestCaseName ()
140+ defer printTestDuration (time .Now ())
132141 testRequires (c , DaemonIsLinux )
133142 imageTest := "busybox"
134143 ensureImageExist (c , imageTest )
@@ -146,7 +155,8 @@ func (s *DockerSuite) TestInspectImageFilterInt(c *check.C) {
146155}
147156
148157func (s * DockerSuite ) TestInspectContainerFilterInt (c * check.C ) {
149- printTestCaseName (); defer printTestDuration (time .Now ())
158+ printTestCaseName ()
159+ defer printTestDuration (time .Now ())
150160 testRequires (c , DaemonIsLinux )
151161 out , _ := dockerCmd (c , "run" , "-d" , "busybox" , "top" )
152162 id := getIDfromOutput (c , out )
@@ -165,7 +175,8 @@ func (s *DockerSuite) TestInspectContainerFilterInt(c *check.C) {
165175}
166176
167177func (s * DockerSuite ) TestInspectImageGraphDriver (c * check.C ) {
168- printTestCaseName (); defer printTestDuration (time .Now ())
178+ printTestCaseName ()
179+ defer printTestDuration (time .Now ())
169180 testRequires (c , DaemonIsLinux )
170181 imageTest := "busybox"
171182 ensureImageExist (c , imageTest )
@@ -190,7 +201,8 @@ func (s *DockerSuite) TestInspectImageGraphDriver(c *check.C) {
190201
191202// #14947
192203func (s * DockerSuite ) TestInspectTimesAsRFC3339Nano (c * check.C ) {
193- printTestCaseName (); defer printTestDuration (time .Now ())
204+ printTestCaseName ()
205+ defer printTestDuration (time .Now ())
194206 testRequires (c , DaemonIsLinux )
195207 out , _ := dockerCmd (c , "run" , "-d" , "busybox" , "true" )
196208 id := getIDfromOutput (c , out )
@@ -214,7 +226,8 @@ func (s *DockerSuite) TestInspectTimesAsRFC3339Nano(c *check.C) {
214226
215227// #15633
216228func (s * DockerSuite ) TestInspectLogConfigNoType (c * check.C ) {
217- printTestCaseName (); defer printTestDuration (time .Now ())
229+ printTestCaseName ()
230+ defer printTestDuration (time .Now ())
218231 testRequires (c , DaemonIsLinux )
219232 dockerCmd (c , "create" , "--name=test" , "busybox" )
220233 var logConfig container.LogConfig
@@ -229,7 +242,8 @@ func (s *DockerSuite) TestInspectLogConfigNoType(c *check.C) {
229242}
230243
231244func (s * DockerSuite ) TestInspectNoSizeFlagContainer (c * check.C ) {
232- printTestCaseName (); defer printTestDuration (time .Now ())
245+ printTestCaseName ()
246+ defer printTestDuration (time .Now ())
233247
234248 //Both the container and image are named busybox. docker inspect will fetch container
235249 //JSON SizeRw and SizeRootFs field. If there is no flag --size/-s, there are no size fields.
@@ -242,7 +256,8 @@ func (s *DockerSuite) TestInspectNoSizeFlagContainer(c *check.C) {
242256}
243257
244258func (s * DockerSuite ) TestInspectSizeFlagContainer (c * check.C ) {
245- printTestCaseName (); defer printTestDuration (time .Now ())
259+ printTestCaseName ()
260+ defer printTestDuration (time .Now ())
246261 dockerCmd (c , "run" , "--name=busybox" , "-d" , "busybox" , "top" )
247262
248263 formatStr := "--format='{{.SizeRw}},{{.SizeRootFs}}'"
@@ -254,7 +269,8 @@ func (s *DockerSuite) TestInspectSizeFlagContainer(c *check.C) {
254269}
255270
256271func (s * DockerSuite ) TestInspectSizeFlagImage (c * check.C ) {
257- printTestCaseName (); defer printTestDuration (time .Now ())
272+ printTestCaseName ()
273+ defer printTestDuration (time .Now ())
258274 dockerCmd (c , "run" , "--name=busybox" , "-d" , "busybox" , "top" )
259275
260276 formatStr := "--format='{{.SizeRw}},{{.SizeRootFs}}'"
@@ -267,7 +283,8 @@ func (s *DockerSuite) TestInspectSizeFlagImage(c *check.C) {
267283}
268284
269285func (s * DockerSuite ) TestInspectTempateError (c * check.C ) {
270- printTestCaseName (); defer printTestDuration (time .Now ())
286+ printTestCaseName ()
287+ defer printTestDuration (time .Now ())
271288 // Template parsing error for both the container and image.
272289
273290 dockerCmd (c , "run" , "--name=container1" , "-d" , "busybox" , "top" )
@@ -282,7 +299,8 @@ func (s *DockerSuite) TestInspectTempateError(c *check.C) {
282299}
283300
284301func (s * DockerSuite ) TestInspectJSONFields (c * check.C ) {
285- printTestCaseName (); defer printTestDuration (time .Now ())
302+ printTestCaseName ()
303+ defer printTestDuration (time .Now ())
286304 dockerCmd (c , "run" , "--name=busybox" , "-d" , "busybox" , "top" )
287305 out , _ , err := dockerCmdWithError ("inspect" , "--type=container" , "--format='{{.HostConfig.Dns}}'" , "busybox" )
288306
@@ -291,7 +309,8 @@ func (s *DockerSuite) TestInspectJSONFields(c *check.C) {
291309}
292310
293311func (s * DockerSuite ) TestInspectByPrefix (c * check.C ) {
294- printTestCaseName (); defer printTestDuration (time .Now ())
312+ printTestCaseName ()
313+ defer printTestDuration (time .Now ())
295314 imageTest := "busybox"
296315 ensureImageExist (c , imageTest )
297316 id := inspectField (c , imageTest , "Id" )
@@ -305,7 +324,8 @@ func (s *DockerSuite) TestInspectByPrefix(c *check.C) {
305324}
306325
307326func (s * DockerSuite ) TestInspectStopWhenNotFound (c * check.C ) {
308- printTestCaseName (); defer printTestDuration (time .Now ())
327+ printTestCaseName ()
328+ defer printTestDuration (time .Now ())
309329 dockerCmd (c , "run" , "--name=busybox" , "-d" , "busybox" , "top" )
310330 dockerCmd (c , "run" , "--name=not-shown" , "-d" , "busybox" , "top" )
311331 out , _ , err := dockerCmdWithError ("inspect" , "--type=container" , "--format='{{.Name}}'" , "busybox" , "missing" , "not-shown" )
0 commit comments