@@ -50,30 +50,31 @@ type NonWinCIE2eSuite struct {
50
50
51
51
func (s * NonWinCIE2eSuite ) TestKillChildOnCancel () {
52
52
It ("should kill docker-classic if parent command is cancelled" , func () {
53
+ imageName := "test-sleep-image"
53
54
out := s .ListProcessesCommand ().ExecOrDie ()
54
- Expect (out ).NotTo (ContainSubstring ("docker-classic" ))
55
+ Expect (out ).NotTo (ContainSubstring (imageName ))
55
56
56
57
dir := s .ConfigDir
57
58
Expect (ioutil .WriteFile (filepath .Join (dir , "Dockerfile" ), []byte (`FROM alpine:3.10
58
59
RUN sleep 100` ), 0644 )).To (Succeed ())
59
60
shutdown := make (chan time.Time )
60
61
errs := make (chan error )
61
- ctx := s .NewDockerCommand ("build" , "--no-cache" , "-t" , "test-sleep-image" , "." ).WithinDirectory (dir ).WithTimeout (shutdown )
62
+ ctx := s .NewDockerCommand ("build" , "--no-cache" , "-t" , imageName , "." ).WithinDirectory (dir ).WithTimeout (shutdown )
62
63
go func () {
63
64
_ , err := ctx .Exec ()
64
65
errs <- err
65
66
}()
66
67
err := WaitFor (time .Second , 10 * time .Second , errs , func () bool {
67
68
out := s .ListProcessesCommand ().ExecOrDie ()
68
- return strings .Contains (out , "docker-classic" )
69
+ return strings .Contains (out , imageName )
69
70
})
70
71
Expect (err ).NotTo (HaveOccurred ())
71
72
log .Println ("Killing docker process" )
72
73
73
74
close (shutdown )
74
75
err = WaitFor (time .Second , 12 * time .Second , nil , func () bool {
75
76
out := s .ListProcessesCommand ().ExecOrDie ()
76
- return ! strings .Contains (out , "docker-classic" )
77
+ return ! strings .Contains (out , imageName )
77
78
})
78
79
Expect (err ).NotTo (HaveOccurred ())
79
80
})
@@ -108,7 +109,7 @@ func (s *NonWinCIE2eSuite) getGrpcServerAndCLientAddress() (string, string) {
108
109
return socketName , socketName
109
110
}
110
111
111
- func TestE2e (t * testing.T ) {
112
+ func TestNonWinCIE2 (t * testing.T ) {
112
113
suite .Run (t , new (NonWinCIE2eSuite ))
113
114
}
114
115
0 commit comments