@@ -85,12 +85,12 @@ func TestOrchestrator(t *testing.T) {
8585 runUntilStopped : true ,
8686 test : func (t * testing.T ) (test , * dockerenginetest.Double ) {
8787 de := & dockerenginetest.Double {
88- IsContainerRunningFn : func (ctx context.Context , name string ) (bool , error ) {
89- if name == "prefix-pause" {
90- return true , nil
91- }
88+ DoesContainerExistFn : func (ctx context.Context , s string ) (bool , error ) {
9289 return false , nil
9390 },
91+ IsContainerRunningFn : func (ctx context.Context , name string ) (bool , error ) {
92+ return true , nil
93+ },
9494 StopFn : func (ctx context.Context , name string ) error {
9595 if name == "prefix-success" {
9696 return nil
@@ -119,12 +119,12 @@ func TestOrchestrator(t *testing.T) {
119119 runUntilStopped : true ,
120120 test : func (t * testing.T ) (test , * dockerenginetest.Double ) {
121121 de := & dockerenginetest.Double {
122- IsContainerRunningFn : func (ctx context.Context , name string ) (bool , error ) {
123- if name == "prefix-pause" {
124- return true , nil
125- }
122+ DoesContainerExistFn : func (ctx context.Context , s string ) (bool , error ) {
126123 return false , errors .New ("some error" )
127124 },
125+ IsContainerRunningFn : func (ctx context.Context , name string ) (bool , error ) {
126+ return true , nil
127+ },
128128 StopFn : func (ctx context.Context , name string ) error {
129129 return nil
130130 },
@@ -148,12 +148,12 @@ func TestOrchestrator(t *testing.T) {
148148 runUntilStopped : true ,
149149 test : func (t * testing.T ) (test , * dockerenginetest.Double ) {
150150 de := & dockerenginetest.Double {
151- IsContainerRunningFn : func (ctx context.Context , name string ) (bool , error ) {
152- if name == "prefix-pause" {
153- return true , nil
154- }
151+ DoesContainerExistFn : func (ctx context.Context , s string ) (bool , error ) {
155152 return false , nil
156153 },
154+ IsContainerRunningFn : func (ctx context.Context , name string ) (bool , error ) {
155+ return true , nil
156+ },
157157 }
158158 return func (t * testing.T , o * Orchestrator ) {
159159 o .RunTask (Task {
@@ -185,12 +185,12 @@ func TestOrchestrator(t *testing.T) {
185185 runUntilStopped : true ,
186186 test : func (t * testing.T ) (test , * dockerenginetest.Double ) {
187187 de := & dockerenginetest.Double {
188- IsContainerRunningFn : func (ctx context.Context , name string ) (bool , error ) {
189- if name == "prefix-pause" {
190- return true , nil
191- }
188+ DoesContainerExistFn : func (ctx context.Context , s string ) (bool , error ) {
192189 return false , nil
193190 },
191+ IsContainerRunningFn : func (ctx context.Context , name string ) (bool , error ) {
192+ return true , nil
193+ },
194194 RunFn : func (ctx context.Context , opts * dockerengine.RunOptions ) error {
195195 // validate pause container has correct ports and secrets
196196 if opts .ContainerName == "prefix-pause" {
@@ -234,12 +234,12 @@ func TestOrchestrator(t *testing.T) {
234234 test : func (t * testing.T ) (test , * dockerenginetest.Double ) {
235235 stopPause := make (chan struct {})
236236 de := & dockerenginetest.Double {
237- IsContainerRunningFn : func (ctx context.Context , name string ) (bool , error ) {
238- if name == "prefix-pause" {
239- return true , nil
240- }
237+ DoesContainerExistFn : func (ctx context.Context , s string ) (bool , error ) {
241238 return false , nil
242239 },
240+ IsContainerRunningFn : func (ctx context.Context , name string ) (bool , error ) {
241+ return true , nil
242+ },
243243 RunFn : func (ctx context.Context , opts * dockerengine.RunOptions ) error {
244244 if opts .ContainerName == "prefix-foo" {
245245 return errors .New ("some error" )
@@ -272,12 +272,12 @@ func TestOrchestrator(t *testing.T) {
272272 test : func (t * testing.T ) (test , * dockerenginetest.Double ) {
273273 stopPause := make (chan struct {})
274274 de := & dockerenginetest.Double {
275- IsContainerRunningFn : func (ctx context.Context , name string ) (bool , error ) {
276- if name == "prefix-pause" {
277- return true , nil
278- }
275+ DoesContainerExistFn : func (ctx context.Context , s string ) (bool , error ) {
279276 return false , nil
280277 },
278+ IsContainerRunningFn : func (ctx context.Context , name string ) (bool , error ) {
279+ return true , nil
280+ },
281281 RunFn : func (ctx context.Context , opts * dockerengine.RunOptions ) error {
282282 if opts .ContainerName == "prefix-foo" {
283283 return nil
@@ -420,12 +420,12 @@ func TestOrchestrator(t *testing.T) {
420420 runUntilStopped : true ,
421421 test : func (t * testing.T ) (test , * dockerenginetest.Double ) {
422422 de := & dockerenginetest.Double {
423- IsContainerRunningFn : func (ctx context.Context , name string ) (bool , error ) {
424- if name == "prefix-pause" {
425- return true , nil
426- }
423+ DoesContainerExistFn : func (ctx context.Context , s string ) (bool , error ) {
427424 return false , nil
428425 },
426+ IsContainerRunningFn : func (ctx context.Context , name string ) (bool , error ) {
427+ return true , nil
428+ },
429429 ExecFn : func (ctx context.Context , ctr string , w io.Writer , cmd string , args ... string ) error {
430430 if cmd == "aws" {
431431 fmt .Fprintf (w , "Port 61972 opened for sessionId mySessionId\n " )
0 commit comments