mirror of
https://github.com/containers/podman.git
synced 2025-05-17 06:59:07 +08:00

Allow users to specify podman-remote top $cid -eo "pid comm" or podman-remote top $cid -eo pid,comm Fixes: https://github.com/containers/podman/issues/19176 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> didid# new file: test/system/085-top.bats Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
26 lines
806 B
Bash
26 lines
806 B
Bash
#!/usr/bin/env bats
|
|
|
|
load helpers
|
|
|
|
@test "podman top - basic tests" {
|
|
run_podman run -d $IMAGE top
|
|
cid=$output
|
|
is "$cid" "[0-9a-f]\{64\}$"
|
|
|
|
run_podman top $cid
|
|
is "${lines[0]}" "USER[ \t]*PID[ \t]*PPID[ \t]*%CPU[ \t]*ELAPSED[ \t]*TTY[ \t]*TIME[ \t]*COMMAND" "podman top"
|
|
is "${lines[1]}" "root[ \t]*1[ \t]*0[ \t]*0.000[ \t]*" "podman top"
|
|
|
|
run_podman top $cid -eo pid,comm
|
|
is "${lines[0]}" "[ \t]*PID[ \t]*COMMAND" "podman top -eo pid,comm Heading"
|
|
is "${lines[1]}" "[ \t]*1[ \t]*top" "podman top -eo pid,comm processes"
|
|
|
|
run_podman top $cid -eo "pid comm"
|
|
is "${lines[0]}" "[ \t]*PID[ \t]*COMMAND" "podman top -eo "pid comm" Heading"
|
|
is "${lines[1]}" "[ \t]*1[ \t]*top" "podman top -eo "pid comm" processes"
|
|
|
|
run_podman rm -f $cid
|
|
}
|
|
|
|
# vim: filetype=sh
|