@@ -762,9 +762,18 @@ func TestImagePullCheck(t *testing.T) {
762
762
// Test case1: pull only img3
763
763
func () ([]byte , []byte , error ) { return nil , nil , nil },
764
764
// Test case 2: fail to pull image2 and image3
765
+ // If the pull fails, it will be retried 5 times (see PullImageRetry in constants/constants.go)
765
766
func () ([]byte , []byte , error ) { return nil , nil , nil },
766
767
func () ([]byte , []byte , error ) { return []byte ("error" ), nil , & fakeexec.FakeExitError {Status : 1 } },
767
768
func () ([]byte , []byte , error ) { return []byte ("error" ), nil , & fakeexec.FakeExitError {Status : 1 } },
769
+ func () ([]byte , []byte , error ) { return []byte ("error" ), nil , & fakeexec.FakeExitError {Status : 1 } },
770
+ func () ([]byte , []byte , error ) { return []byte ("error" ), nil , & fakeexec.FakeExitError {Status : 1 } },
771
+ func () ([]byte , []byte , error ) { return []byte ("error" ), nil , & fakeexec.FakeExitError {Status : 1 } },
772
+ func () ([]byte , []byte , error ) { return []byte ("error" ), nil , & fakeexec.FakeExitError {Status : 1 } },
773
+ func () ([]byte , []byte , error ) { return []byte ("error" ), nil , & fakeexec.FakeExitError {Status : 1 } },
774
+ func () ([]byte , []byte , error ) { return []byte ("error" ), nil , & fakeexec.FakeExitError {Status : 1 } },
775
+ func () ([]byte , []byte , error ) { return []byte ("error" ), nil , & fakeexec.FakeExitError {Status : 1 } },
776
+ func () ([]byte , []byte , error ) { return []byte ("error" ), nil , & fakeexec.FakeExitError {Status : 1 } },
768
777
},
769
778
}
770
779
@@ -780,6 +789,14 @@ func TestImagePullCheck(t *testing.T) {
780
789
func (cmd string , args ... string ) exec.Cmd { return fakeexec .InitFakeCmd (& fcmd , cmd , args ... ) },
781
790
func (cmd string , args ... string ) exec.Cmd { return fakeexec .InitFakeCmd (& fcmd , cmd , args ... ) },
782
791
func (cmd string , args ... string ) exec.Cmd { return fakeexec .InitFakeCmd (& fcmd , cmd , args ... ) },
792
+ func (cmd string , args ... string ) exec.Cmd { return fakeexec .InitFakeCmd (& fcmd , cmd , args ... ) },
793
+ func (cmd string , args ... string ) exec.Cmd { return fakeexec .InitFakeCmd (& fcmd , cmd , args ... ) },
794
+ func (cmd string , args ... string ) exec.Cmd { return fakeexec .InitFakeCmd (& fcmd , cmd , args ... ) },
795
+ func (cmd string , args ... string ) exec.Cmd { return fakeexec .InitFakeCmd (& fcmd , cmd , args ... ) },
796
+ func (cmd string , args ... string ) exec.Cmd { return fakeexec .InitFakeCmd (& fcmd , cmd , args ... ) },
797
+ func (cmd string , args ... string ) exec.Cmd { return fakeexec .InitFakeCmd (& fcmd , cmd , args ... ) },
798
+ func (cmd string , args ... string ) exec.Cmd { return fakeexec .InitFakeCmd (& fcmd , cmd , args ... ) },
799
+ func (cmd string , args ... string ) exec.Cmd { return fakeexec .InitFakeCmd (& fcmd , cmd , args ... ) },
783
800
},
784
801
LookPathFunc : func (cmd string ) (string , error ) { return "/usr/bin/docker" , nil },
785
802
}
0 commit comments