5
5
"io/ioutil"
6
6
"os"
7
7
"path/filepath"
8
+ "time"
8
9
9
10
"github.com/containers/conmon/runner/conmon"
10
11
"github.com/containers/storage/pkg/stringid"
@@ -41,7 +42,9 @@ var _ = Describe("runc", func() {
41
42
42
43
tmpPidFile = filepath .Join (tmpDir , "pidfile" )
43
44
44
- Expect (os .Link (busyboxDest , filepath .Join (tmpRootfs , "busybox" ))).To (BeNil ())
45
+ busyboxPath := filepath .Join (tmpRootfs , "busybox" )
46
+ Expect (os .Link (busyboxDest , busyboxPath )).To (BeNil ())
47
+ Expect (os .Chmod (busyboxPath , 0777 )).To (BeNil ())
45
48
46
49
// finally, create config.json
47
50
_ , err = generateRuntimeConfig (tmpDir , tmpRootfs )
@@ -70,6 +73,8 @@ var _ = Describe("runc", func() {
70
73
Expect (stderr ).To (BeEmpty ())
71
74
72
75
Expect (runRuntimeCommand ("start" , ctrID )).To (BeNil ())
76
+ // Make sure we write the file before checking if it was written
77
+ time .Sleep (100 * time .Millisecond )
73
78
74
79
Expect (getFileContents (tmpLogPath )).To (ContainSubstring ("busybox" ))
75
80
Expect (getFileContents (tmpPidFile )).To (Not (BeEmpty ()))
@@ -89,7 +94,7 @@ func generateRuntimeConfig(bundlePath, rootfs string) (string, error) {
89
94
return "" , err
90
95
}
91
96
g .SetProcessCwd ("/" )
92
- g .SetProcessArgs ([]string {"/busybox" , "ls " })
97
+ g .SetProcessArgs ([]string {"/busybox" , "echo" , "busybox " })
93
98
g .SetRootPath (rootfs )
94
99
95
100
if err := g .SaveToFile (configPath , generate.ExportOptions {}); err != nil {
0 commit comments