summaryrefslogtreecommitdiff
path: root/test/system/200-pod-top.bats
diff options
context:
space:
mode:
authorEd Santiago <santiago@redhat.com>2019-03-05 09:58:30 -0700
committerEd Santiago <santiago@redhat.com>2019-03-07 14:09:00 -0700
commit589248d2f359dea73fc763ac587e2927f005b300 (patch)
tree089364b57364c0d77d1afac4d0193915a221371a /test/system/200-pod-top.bats
parent681eae9bcc856f8dad107765a97c29d0fe093d4a (diff)
downloadpodman-589248d2f359dea73fc763ac587e2927f005b300.tar.gz
podman-589248d2f359dea73fc763ac587e2927f005b300.tar.bz2
podman-589248d2f359dea73fc763ac587e2927f005b300.zip
Implement review feedback
- document a recommended convention for fail-fast tests - document the requirement for jq. (And, add a fail-fast test for its presence; remove the duplicated checks in subtests) - add further sanity checks to 'help' test. Add missing documentation. Remove a no-longer-needed workaround for usage-message bug fixed in #2486 - add a documented TEMPLATE - and, since we're at 1.1, enable 'Remote API' check in version test - better diagnostics in setup/teardown; add vim filetype hint; better formatting of actual-vs-expect errors - new pod-top, logs, build tests - improve error messages - add $IMAGE alias for ridiculous $PODMAN_TEST_IMAGE_FQN - final cleanup, in prep for merge Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'test/system/200-pod-top.bats')
-rw-r--r--test/system/200-pod-top.bats37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/system/200-pod-top.bats b/test/system/200-pod-top.bats
new file mode 100644
index 000000000..81c4be3ff
--- /dev/null
+++ b/test/system/200-pod-top.bats
@@ -0,0 +1,37 @@
+#!/usr/bin/env bats
+
+load helpers
+
+@test "podman pod top - containers in different PID namespaces" {
+ skip_if_rootless
+
+ run_podman pod create
+ podid="$output"
+
+ # Start two containers...
+ run_podman run -d --pod $podid $IMAGE top -d 2
+ cid1="$output"
+ run_podman run -d --pod $podid $IMAGE top -d 2
+ cid2="$output"
+
+ # ...and wait for them to actually start.
+ wait_for_output "PID \+PPID \+USER " $cid1
+ wait_for_output "PID \+PPID \+USER " $cid2
+
+ # Both containers have emitted at least one top-like line.
+ # Now run 'pod top', and expect two 'top -d 2' processes running.
+ run_podman pod top $podid
+ is "$output" ".*root.*top -d 2.*root.*top -d 2" "two 'top' containers"
+
+ # There should be a /pause container
+ # FIXME: sometimes there is, sometimes there isn't. If anyone ever
+ # actually figures this out, please either reenable this line or
+ # remove it entirely.
+ #is "$output" ".*0 \+1 \+0 \+[0-9. ?s]\+/pause" "there is a /pause container"
+
+ # Clean up
+ run_podman pod rm -f $podid
+}
+
+
+# vim: filetype=sh