@@ -66,8 +66,7 @@ func (s *DockerSuite) TestExecInteractive(c *check.C) {
6666}
6767
6868func (s * DockerSuite ) TestExecAfterContainerRestart (c * check.C ) {
69- testRequires (c , DaemonIsLinux )
70- out , _ := dockerCmd (c , "run" , "-d" , "busybox" , "top" )
69+ out , _ := runSleepingContainer (c , "-d" )
7170 cleanedContainerID := strings .TrimSpace (out )
7271 c .Assert (waitRun (cleanedContainerID ), check .IsNil )
7372 dockerCmd (c , "restart" , cleanedContainerID )
@@ -79,6 +78,7 @@ func (s *DockerSuite) TestExecAfterContainerRestart(c *check.C) {
7978}
8079
8180func (s * DockerDaemonSuite ) TestExecAfterDaemonRestart (c * check.C ) {
81+ // TODO Windows CI: Requires a little work to get this ported.
8282 testRequires (c , DaemonIsLinux )
8383 testRequires (c , SameHostDaemon )
8484
@@ -103,9 +103,12 @@ func (s *DockerDaemonSuite) TestExecAfterDaemonRestart(c *check.C) {
103103
104104// Regression test for #9155, #9044
105105func (s * DockerSuite ) TestExecEnv (c * check.C ) {
106+ // TODO Windows CI: This one is interesting and may just end up being a feature
107+ // difference between Windows and Linux. On Windows, the environment is passed
108+ // into the process that is launched, not into the machine environment. Hence
109+ // a subsequent exec will not have LALA set/
106110 testRequires (c , DaemonIsLinux )
107- dockerCmd (c , "run" , "-e" , "LALA=value1" , "-e" , "LALA=value2" ,
108- "-d" , "--name" , "testing" , "busybox" , "top" )
111+ runSleepingContainer (c , "-e" , "LALA=value1" , "-e" , "LALA=value2" , "-d" , "--name" , "testing" )
109112 c .Assert (waitRun ("testing" ), check .IsNil )
110113
111114 out , _ := dockerCmd (c , "exec" , "testing" , "env" )
@@ -115,8 +118,7 @@ func (s *DockerSuite) TestExecEnv(c *check.C) {
115118}
116119
117120func (s * DockerSuite ) TestExecExitStatus (c * check.C ) {
118- testRequires (c , DaemonIsLinux )
119- dockerCmd (c , "run" , "-d" , "--name" , "top" , "busybox" , "top" )
121+ runSleepingContainer (c , "-d" , "--name" , "top" )
120122
121123 // Test normal (non-detached) case first
122124 cmd := exec .Command (dockerBinary , "exec" , "top" , "sh" , "-c" , "exit 23" )
@@ -125,6 +127,7 @@ func (s *DockerSuite) TestExecExitStatus(c *check.C) {
125127}
126128
127129func (s * DockerSuite ) TestExecPausedContainer (c * check.C ) {
130+ // Windows does not support pause
128131 testRequires (c , DaemonIsLinux )
129132 defer unpauseAllContainers ()
130133
@@ -141,6 +144,7 @@ func (s *DockerSuite) TestExecPausedContainer(c *check.C) {
141144
142145// regression test for #9476
143146func (s * DockerSuite ) TestExecTTYCloseStdin (c * check.C ) {
147+ // TODO Windows CI: This requires some work to port to Windows.
144148 testRequires (c , DaemonIsLinux )
145149 dockerCmd (c , "run" , "-d" , "-it" , "--name" , "exec_tty_stdin" , "busybox" )
146150
@@ -161,6 +165,7 @@ func (s *DockerSuite) TestExecTTYCloseStdin(c *check.C) {
161165}
162166
163167func (s * DockerSuite ) TestExecTTYWithoutStdin (c * check.C ) {
168+ // TODO Windows CI: This requires some work to port to Windows.
164169 testRequires (c , DaemonIsLinux )
165170 out , _ := dockerCmd (c , "run" , "-d" , "-ti" , "busybox" )
166171 id := strings .TrimSpace (out )
@@ -195,6 +200,8 @@ func (s *DockerSuite) TestExecTTYWithoutStdin(c *check.C) {
195200}
196201
197202func (s * DockerSuite ) TestExecParseError (c * check.C ) {
203+ // TODO Windows CI: Requires some extra work. Consider copying the
204+ // runSleepingContainer helper to have an exec version.
198205 testRequires (c , DaemonIsLinux )
199206 dockerCmd (c , "run" , "-d" , "--name" , "top" , "busybox" , "top" )
200207
@@ -206,6 +213,8 @@ func (s *DockerSuite) TestExecParseError(c *check.C) {
206213}
207214
208215func (s * DockerSuite ) TestExecStopNotHanging (c * check.C ) {
216+ // TODO Windows CI: Requires some extra work. Consider copying the
217+ // runSleepingContainer helper to have an exec version.
209218 testRequires (c , DaemonIsLinux )
210219 dockerCmd (c , "run" , "-d" , "--name" , "testing" , "busybox" , "top" )
211220
@@ -232,6 +241,7 @@ func (s *DockerSuite) TestExecStopNotHanging(c *check.C) {
232241}
233242
234243func (s * DockerSuite ) TestExecCgroup (c * check.C ) {
244+ // Not applicable on Windows - using Linux specific functionality
235245 testRequires (c , NotUserNamespace )
236246 testRequires (c , DaemonIsLinux )
237247 dockerCmd (c , "run" , "-d" , "--name" , "testing" , "busybox" , "top" )
@@ -283,9 +293,8 @@ func (s *DockerSuite) TestExecCgroup(c *check.C) {
283293 }
284294}
285295
286- func (s * DockerSuite ) TestInspectExecID (c * check.C ) {
287- testRequires (c , DaemonIsLinux )
288- out , _ := dockerCmd (c , "run" , "-d" , "busybox" , "top" )
296+ func (s * DockerSuite ) TestExecInspectID (c * check.C ) {
297+ out , _ := runSleepingContainer (c , "-d" )
289298 id := strings .TrimSuffix (out , "\n " )
290299
291300 out , err := inspectField (id , "ExecIDs" )
@@ -294,7 +303,7 @@ func (s *DockerSuite) TestInspectExecID(c *check.C) {
294303
295304 // Start an exec, have it block waiting so we can do some checking
296305 cmd := exec .Command (dockerBinary , "exec" , id , "sh" , "-c" ,
297- "while ! test -e /tmp/ execid1; do sleep 1; done" )
306+ "while ! test -e /execid1; do sleep 1; done" )
298307
299308 err = cmd .Start ()
300309 c .Assert (err , checker .IsNil , check .Commentf ("failed to start the exec cmd" ))
@@ -320,7 +329,7 @@ func (s *DockerSuite) TestInspectExecID(c *check.C) {
320329
321330 // End the exec by creating the missing file
322331 err = exec .Command (dockerBinary , "exec" , id ,
323- "sh" , "-c" , "touch /tmp/ execid1" ).Run ()
332+ "sh" , "-c" , "touch /execid1" ).Run ()
324333
325334 c .Assert (err , checker .IsNil , check .Commentf ("failed to run the 2nd exec cmd" ))
326335
@@ -347,6 +356,7 @@ func (s *DockerSuite) TestInspectExecID(c *check.C) {
347356}
348357
349358func (s * DockerSuite ) TestLinksPingLinkedContainersOnRename (c * check.C ) {
359+ // Problematic on Windows as Windows does not support links
350360 testRequires (c , DaemonIsLinux )
351361 var out string
352362 out , _ = dockerCmd (c , "run" , "-d" , "--name" , "container1" , "busybox" , "top" )
@@ -361,12 +371,17 @@ func (s *DockerSuite) TestLinksPingLinkedContainersOnRename(c *check.C) {
361371 dockerCmd (c , "exec" , "container2" , "ping" , "-c" , "1" , "alias1" , "-W" , "1" )
362372}
363373
364- func (s * DockerSuite ) TestRunExecDir (c * check.C ) {
374+ func (s * DockerSuite ) TestExecDir (c * check.C ) {
375+ // TODO Windows CI. This requires some work to port as it uses execDriverPath
376+ // which is currently (and incorrectly) hard coded as a string assuming
377+ // the daemon is running Linux :(
365378 testRequires (c , SameHostDaemon , DaemonIsLinux )
366379
367- out , _ := dockerCmd (c , "run" , "-d" , "busybox" , "top " )
380+ out , _ := runSleepingContainer (c , "-d " )
368381 id := strings .TrimSpace (out )
382+
369383 execDir := filepath .Join (execDriverPath , id )
384+ fmt .Println (execDriverPath )
370385 stateFile := filepath .Join (execDir , "state.json" )
371386
372387 {
@@ -409,6 +424,7 @@ func (s *DockerSuite) TestRunExecDir(c *check.C) {
409424}
410425
411426func (s * DockerSuite ) TestRunMutableNetworkFiles (c * check.C ) {
427+ // Not applicable on Windows to Windows CI.
412428 testRequires (c , SameHostDaemon , DaemonIsLinux )
413429 for _ , fn := range []string {"resolv.conf" , "hosts" } {
414430 deleteAllContainers ()
@@ -447,6 +463,8 @@ func (s *DockerSuite) TestRunMutableNetworkFiles(c *check.C) {
447463}
448464
449465func (s * DockerSuite ) TestExecWithUser (c * check.C ) {
466+ // TODO Windows CI: This may be fixable in the future once Windows
467+ // supports users
450468 testRequires (c , DaemonIsLinux )
451469 dockerCmd (c , "run" , "-d" , "--name" , "parent" , "busybox" , "top" )
452470
@@ -458,6 +476,7 @@ func (s *DockerSuite) TestExecWithUser(c *check.C) {
458476}
459477
460478func (s * DockerSuite ) TestExecWithPrivileged (c * check.C ) {
479+ // Not applicable on Windows
461480 testRequires (c , DaemonIsLinux , NotUserNamespace )
462481 // Start main loop which attempts mknod repeatedly
463482 dockerCmd (c , "run" , "-d" , "--name" , "parent" , "--cap-drop=ALL" , "busybox" , "sh" , "-c" , `while (true); do if [ -e /exec_priv ]; then cat /exec_priv && mknod /tmp/sda b 8 0 && echo "Success"; else echo "Privileged exec has not run yet"; fi; usleep 10000; done` )
@@ -491,6 +510,7 @@ func (s *DockerSuite) TestExecWithPrivileged(c *check.C) {
491510}
492511
493512func (s * DockerSuite ) TestExecWithImageUser (c * check.C ) {
513+ // Not applicable on Windows
494514 testRequires (c , DaemonIsLinux )
495515 name := "testbuilduser"
496516 _ , err := buildImage (name ,
@@ -507,6 +527,7 @@ func (s *DockerSuite) TestExecWithImageUser(c *check.C) {
507527}
508528
509529func (s * DockerSuite ) TestExecOnReadonlyContainer (c * check.C ) {
530+ // Windows does not support read-only
510531 // --read-only + userns has remount issues
511532 testRequires (c , DaemonIsLinux , NotUserNamespace )
512533 dockerCmd (c , "run" , "-d" , "--read-only" , "--name" , "parent" , "busybox" , "top" )
@@ -515,9 +536,11 @@ func (s *DockerSuite) TestExecOnReadonlyContainer(c *check.C) {
515536
516537// #15750
517538func (s * DockerSuite ) TestExecStartFails (c * check.C ) {
539+ // TODO Windows CI. This test should be portable. Figure out why it fails
540+ // currently.
518541 testRequires (c , DaemonIsLinux )
519542 name := "exec-15750"
520- dockerCmd (c , "run" , " -d" , "--name" , name , "busybox" , "top" )
543+ runSleepingContainer (c , "-d" , "--name" , name )
521544 c .Assert (waitRun (name ), checker .IsNil )
522545
523546 out , _ , err := dockerCmdWithError ("exec" , name , "no-such-cmd" )
0 commit comments