File tree Expand file tree Collapse file tree 1 file changed +33
-2
lines changed Expand file tree Collapse file tree 1 file changed +33
-2
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ function teardown() {
1111 teardown_busybox
1212}
1313
14- @test " ps -eaf " {
14+ @test " ps" {
1515 # start busybox detached
1616 runc run -d --console /dev/pts/ptmx test_busybox
1717 [ " $status " -eq 0 ]
@@ -21,8 +21,39 @@ function teardown() {
2121
2222 testcontainer test_busybox running
2323
24- runc ps test_busybox -eaf
24+ runc ps test_busybox
2525 [ " $status " -eq 0 ]
2626 [[ ${lines[0]} =~ UID\ +PID\ +PPID\ +C\ +STIME\ +TTY\ +TIME\ +CMD+ ]]
2727 [[ " ${lines[1]} " == * " root" * [0-9]* ]]
2828}
29+
30+ @test " ps -f json" {
31+ # start 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+ runc ps -f json test_busybox
41+ [ " $status " -eq 0 ]
42+ [[ ${lines[0]} =~ [0-9]+ ]]
43+ }
44+
45+ @test " ps -e -x" {
46+ # start busybox detached
47+ runc run -d --console /dev/pts/ptmx test_busybox
48+ [ " $status " -eq 0 ]
49+
50+ # check state
51+ wait_for_container 15 1 test_busybox
52+
53+ testcontainer test_busybox running
54+
55+ runc ps test_busybox -e -x
56+ [ " $status " -eq 0 ]
57+ [[ ${lines[0]} =~ \ +PID\ +TTY\ +STAT\ +TIME\ +COMMAND+ ]]
58+ [[ " ${lines[1]} " =~ [0-9]+ ]]
59+ }
You can’t perform that action at this time.
0 commit comments