@@ -13,6 +13,7 @@ import (
13
13
"time"
14
14
15
15
"github.com/containers/common/pkg/cgroups"
16
+ "github.com/containers/podman/v4/libpod/define"
16
17
"github.com/containers/podman/v4/pkg/rootless"
17
18
. "github.com/containers/podman/v4/test/utils"
18
19
"github.com/containers/storage/pkg/stringid"
@@ -286,19 +287,20 @@ var _ = Describe("Podman run", func() {
286
287
result .WaitWithDefaultTimeout ()
287
288
Expect (result ).Should (Exit (0 ))
288
289
conData := result .InspectContainerToJSON ()
289
- Expect (conData [0 ]).To (HaveField ("Path" , "/dev/init" ))
290
+ Expect (conData [0 ]).To (HaveField ("Path" , define . ContainerInitPath ))
290
291
Expect (conData [0 ].Config .Annotations ).To (HaveKeyWithValue ("io.podman.annotations.init" , "TRUE" ))
291
292
})
292
293
293
294
It ("podman run a container with --init and --init-path" , func () {
294
- session := podmanTest .Podman ([]string {"run" , "--name" , "test" , "--init" , "--init-path" , "/usr/libexec/podman/catatonit" , ALPINE , "ls" })
295
+ // Also bind-mount /dev (#14251).
296
+ session := podmanTest .Podman ([]string {"run" , "-v" , "/dev:/dev" , "--name" , "test" , "--init" , "--init-path" , "/usr/libexec/podman/catatonit" , ALPINE , "ls" })
295
297
session .WaitWithDefaultTimeout ()
296
298
Expect (session ).Should (Exit (0 ))
297
299
result := podmanTest .Podman ([]string {"inspect" , "test" })
298
300
result .WaitWithDefaultTimeout ()
299
301
Expect (result ).Should (Exit (0 ))
300
302
conData := result .InspectContainerToJSON ()
301
- Expect (conData [0 ]).To (HaveField ("Path" , "/dev/init" ))
303
+ Expect (conData [0 ]).To (HaveField ("Path" , define . ContainerInitPath ))
302
304
Expect (conData [0 ].Config .Annotations ).To (HaveKeyWithValue ("io.podman.annotations.init" , "TRUE" ))
303
305
})
304
306
0 commit comments