File tree Expand file tree Collapse file tree 2 files changed +18
-10
lines changed
Expand file tree Collapse file tree 2 files changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -133,16 +133,23 @@ func TestExecInError(t *testing.T) {
133133 }()
134134 ok (t , err )
135135
136- unexistent := & libcontainer.Process {
137- Args : []string {"unexistent" },
138- Env : standardEnvironment ,
139- }
140- err = container .Start (unexistent )
141- if err == nil {
142- t .Fatal ("Should be an error" )
143- }
144- if ! strings .Contains (err .Error (), "executable file not found" ) {
145- t .Fatalf ("Should be error about not found executable, got %s" , err )
136+ for i := 0 ; i < 42 ; i ++ {
137+ var out bytes.Buffer
138+ unexistent := & libcontainer.Process {
139+ Args : []string {"unexistent" },
140+ Env : standardEnvironment ,
141+ Stdout : & out ,
142+ }
143+ err = container .Start (unexistent )
144+ if err == nil {
145+ t .Fatal ("Should be an error" )
146+ }
147+ if ! strings .Contains (err .Error (), "executable file not found" ) {
148+ t .Fatalf ("Should be error about not found executable, got %s" , err )
149+ }
150+ if ! bytes .Contains (out .Bytes (), []byte ("executable file not found" )) {
151+ t .Fatalf ("executable file not found error not delivered to stdio:\n %s" , out .String ())
152+ }
146153 }
147154}
148155
Original file line number Diff line number Diff line change @@ -84,6 +84,7 @@ func (p *setnsProcess) start() (err error) {
8484 return newSystemError (err )
8585 }
8686 if ierr != nil {
87+ p .wait ()
8788 return newSystemError (ierr )
8889 }
8990
You can’t perform that action at this time.
0 commit comments