File tree Expand file tree Collapse file tree 2 files changed +29
-6
lines changed Expand file tree Collapse file tree 2 files changed +29
-6
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import (
1616var psCommand = cli.Command {
1717 Name : "ps" ,
1818 Usage : "ps displays the processes running inside a container" ,
19- ArgsUsage : `<container-id> [-- ps options]` ,
19+ ArgsUsage : `<container-id> [ps options]` ,
2020 Flags : []cli.Flag {
2121 cli.StringFlag {
2222 Name : "format, f" ,
@@ -47,11 +47,6 @@ var psCommand = cli.Command{
4747 // psArgs: [ps_arg1 ps_arg2 ...]
4848 //
4949 psArgs := context .Args ()[1 :]
50-
51- if len (psArgs ) > 0 && psArgs [0 ] == "--" {
52- psArgs = psArgs [1 :]
53- }
54-
5550 if len (psArgs ) == 0 {
5651 psArgs = []string {"-ef" }
5752 }
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bats
2+
3+ load helpers
4+
5+ function setup() {
6+ teardown_busybox
7+ setup_busybox
8+ }
9+
10+ function teardown() {
11+ teardown_busybox
12+ }
13+
14+ @test " ps -eaf" {
15+ # start busybox detached
16+ runc run -d --console /dev/pts/ptmx test_busybox
17+ [ " $status " -eq 0 ]
18+
19+ # check state
20+ wait_for_container 15 1 test_busybox
21+
22+ testcontainer test_busybox running
23+
24+ runc ps test_busybox -eaf
25+ [ " $status " -eq 0 ]
26+ [[ ${lines[0]} =~ UID\ +PID\ +PPID\ +C\ +STIME\ +TTY\ +TIME\ +CMD+ ]]
27+ [[ " ${lines[1]} " == * " root" * [0-9]* ]]
28+ }
You can’t perform that action at this time.
0 commit comments