File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,22 @@ function teardown() {
2222 testcontainer test_busybox running
2323}
2424
25+ @test " runc run detached ({u,g}id != 0)" {
26+ # replace "uid": 0 with "uid": 1000
27+ # and do a similar thing for gid.
28+ sed -i ' s;"uid": 0;"uid": 1000;g' config.json
29+ sed -i ' s;"gid": 0;"gid": 100;g' config.json
30+
31+ # run busybox detached
32+ runc run -d --console /dev/pts/ptmx test_busybox
33+ [ " $status " -eq 0 ]
34+
35+ # check state
36+ wait_for_container 15 1 test_busybox
37+
38+ testcontainer test_busybox running
39+ }
40+
2541@test " runc run detached --pid-file" {
2642 # run busybox detached
2743 runc run --pid-file pid.txt -d --console /dev/pts/ptmx test_busybox
Original file line number Diff line number Diff line change @@ -20,6 +20,20 @@ function teardown() {
2020 [[ " ${output} " == * " Hello" * ]]
2121}
2222
23+ @test " runc run ({u,g}id != 0)" {
24+ # replace "uid": 0 with "uid": 1000
25+ # and do a similar thing for gid.
26+ sed -i ' s;"uid": 0;"uid": 1000;g' config.json
27+ sed -i ' s;"gid": 0;"gid": 100;g' config.json
28+
29+ # run hello-world
30+ runc run test_hello
31+ [ " $status " -eq 0 ]
32+
33+ # check expected output
34+ [[ " ${output} " == * " Hello" * ]]
35+ }
36+
2337@test " runc run with rootfs set to ." {
2438 cp config.json rootfs/.
2539 rm config.json
You can’t perform that action at this time.
0 commit comments