@@ -208,6 +208,7 @@ func TestEnter(t *testing.T) {
208208 var stdout , stdout2 bytes.Buffer
209209
210210 pconfig := libcontainer.Process {
211+ Cwd : "/" ,
211212 Args : []string {"sh" , "-c" , "cat && readlink /proc/self/ns/pid" },
212213 Env : standardEnvironment ,
213214 Stdin : stdinR ,
@@ -224,6 +225,7 @@ func TestEnter(t *testing.T) {
224225 stdinR2 , stdinW2 , err := os .Pipe ()
225226 ok (t , err )
226227 pconfig2 := libcontainer.Process {
228+ Cwd : "/" ,
227229 Env : standardEnvironment ,
228230 }
229231 pconfig2 .Args = []string {"sh" , "-c" , "cat && readlink /proc/self/ns/pid" }
@@ -290,6 +292,7 @@ func TestProcessEnv(t *testing.T) {
290292
291293 var stdout bytes.Buffer
292294 pconfig := libcontainer.Process {
295+ Cwd : "/" ,
293296 Args : []string {"sh" , "-c" , "env" },
294297 Env : []string {
295298 "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ,
@@ -341,6 +344,7 @@ func TestProcessCaps(t *testing.T) {
341344
342345 var stdout bytes.Buffer
343346 pconfig := libcontainer.Process {
347+ Cwd : "/" ,
344348 Args : []string {"sh" , "-c" , "cat /proc/self/status" },
345349 Env : standardEnvironment ,
346350 Capabilities : processCaps ,
@@ -411,6 +415,7 @@ func TestAdditionalGroups(t *testing.T) {
411415
412416 var stdout bytes.Buffer
413417 pconfig := libcontainer.Process {
418+ Cwd : "/" ,
414419 Args : []string {"sh" , "-c" , "id" , "-Gn" },
415420 Env : standardEnvironment ,
416421 Stdin : nil ,
@@ -471,6 +476,7 @@ func testFreeze(t *testing.T, systemd bool) {
471476 ok (t , err )
472477
473478 pconfig := & libcontainer.Process {
479+ Cwd : "/" ,
474480 Args : []string {"cat" },
475481 Env : standardEnvironment ,
476482 Stdin : stdinR ,
@@ -667,6 +673,7 @@ func TestContainerState(t *testing.T) {
667673 t .Fatal (err )
668674 }
669675 p := & libcontainer.Process {
676+ Cwd : "/" ,
670677 Args : []string {"cat" },
671678 Env : standardEnvironment ,
672679 Stdin : stdinR ,
@@ -717,6 +724,7 @@ func TestPassExtraFiles(t *testing.T) {
717724 pipeout1 , pipein1 , err := os .Pipe ()
718725 pipeout2 , pipein2 , err := os .Pipe ()
719726 process := libcontainer.Process {
727+ Cwd : "/" ,
720728 Args : []string {"sh" , "-c" , "cd /proc/$$/fd; echo -n *; echo -n 1 >3; echo -n 2 >4" },
721729 Env : []string {"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" },
722730 ExtraFiles : []* os.File {pipein1 , pipein2 },
@@ -800,6 +808,7 @@ func TestMountCmds(t *testing.T) {
800808 defer container .Destroy ()
801809
802810 pconfig := libcontainer.Process {
811+ Cwd : "/" ,
803812 Args : []string {"sh" , "-c" , "env" },
804813 Env : standardEnvironment ,
805814 }
@@ -846,6 +855,7 @@ func TestSysctl(t *testing.T) {
846855
847856 var stdout bytes.Buffer
848857 pconfig := libcontainer.Process {
858+ Cwd : "/" ,
849859 Args : []string {"sh" , "-c" , "cat /proc/sys/kernel/shmmni" },
850860 Env : standardEnvironment ,
851861 Stdin : nil ,
@@ -985,6 +995,7 @@ func TestOomScoreAdj(t *testing.T) {
985995
986996 var stdout bytes.Buffer
987997 pconfig := libcontainer.Process {
998+ Cwd : "/" ,
988999 Args : []string {"sh" , "-c" , "cat /proc/self/oom_score_adj" },
9891000 Env : standardEnvironment ,
9901001 Stdin : nil ,
@@ -1037,6 +1048,7 @@ func TestHook(t *testing.T) {
10371048
10381049 var stdout bytes.Buffer
10391050 pconfig := libcontainer.Process {
1051+ Cwd : "/" ,
10401052 Args : []string {"sh" , "-c" , "ls /test" },
10411053 Env : standardEnvironment ,
10421054 Stdin : nil ,
@@ -1143,6 +1155,7 @@ func TestRootfsPropagationSlaveMount(t *testing.T) {
11431155 ok (t , err )
11441156
11451157 pconfig := & libcontainer.Process {
1158+ Cwd : "/" ,
11461159 Args : []string {"cat" },
11471160 Env : standardEnvironment ,
11481161 Stdin : stdinR ,
@@ -1170,6 +1183,7 @@ func TestRootfsPropagationSlaveMount(t *testing.T) {
11701183 ok (t , err )
11711184
11721185 pconfig2 := & libcontainer.Process {
1186+ Cwd : "/" ,
11731187 Args : []string {"cat" , "/proc/self/mountinfo" },
11741188 Env : standardEnvironment ,
11751189 Stdin : stdinR2 ,
@@ -1259,6 +1273,7 @@ func TestRootfsPropagationSharedMount(t *testing.T) {
12591273 ok (t , err )
12601274
12611275 pconfig := & libcontainer.Process {
1276+ Cwd : "/" ,
12621277 Args : []string {"cat" },
12631278 Env : standardEnvironment ,
12641279 Stdin : stdinR ,
@@ -1288,6 +1303,7 @@ func TestRootfsPropagationSharedMount(t *testing.T) {
12881303 processCaps := append (config .Capabilities , "CAP_SYS_ADMIN" )
12891304
12901305 pconfig2 := & libcontainer.Process {
1306+ Cwd : "/" ,
12911307 Args : []string {"mount" , "--bind" , dir2cont , dir2cont },
12921308 Env : standardEnvironment ,
12931309 Stdin : stdinR2 ,
0 commit comments