summaryrefslogtreecommitdiff
path: root/test/system/130-kill.bats
diff options
context:
space:
mode:
authorHironori Shiina <shiina.hironori@jp.fujitsu.com>2021-10-27 09:26:58 -0400
committerMatthew Heon <mheon@redhat.com>2021-12-06 14:53:27 -0500
commit6d9c1d8fdc0c4ec81d978c6f358d4b304a5a9aef (patch)
tree7a7d48e53d5df316a003e317d656c8e9c18079eb /test/system/130-kill.bats
parentdb6b9131ef1a14cd19cdd52425fb60d90862f05e (diff)
downloadpodman-6d9c1d8fdc0c4ec81d978c6f358d4b304a5a9aef.tar.gz
podman-6d9c1d8fdc0c4ec81d978c6f358d4b304a5a9aef.tar.bz2
podman-6d9c1d8fdc0c4ec81d978c6f358d4b304a5a9aef.zip
Set flags to test 'logs -f' with journald driver
`logs -f` with `journald` is supported only when `journald` events backend is used. To pass system tests using `logs -f` in an environment where `events_logger` is not set to `journald` in `containers.conf`, this fix sets `--events-backend` or `--log-driver` temporally. Signed-off-by: Hironori Shiina <shiina.hironori@jp.fujitsu.com> <MH: Fixed cherry-pick conflicts> Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'test/system/130-kill.bats')
-rw-r--r--test/system/130-kill.bats15
1 files changed, 14 insertions, 1 deletions
diff --git a/test/system/130-kill.bats b/test/system/130-kill.bats
index d85f0a6a9..1ff3a7b61 100644
--- a/test/system/130-kill.bats
+++ b/test/system/130-kill.bats
@@ -6,9 +6,22 @@
load helpers
@test "podman kill - test signal handling in containers" {
+
+ # Prepare for 'logs -f'
+ run_podman info --format '{{.Host.LogDriver}}'
+ log_driver=$output
+ run_podman info --format '{{.Host.EventLogger}}'
+ event_logger=$output
+ opt_log_driver=
+ if [ $log_driver = "journald" ] && [ $event_logger != "journald" ]; then
+ # Since PR#10431, 'logs -f' with journald driver is only supported with journald events backend.
+ # Set '--log driver' temporally because remote doesn't support '--events-backend'.
+ opt_log_driver="--log-driver k8s-file"
+ fi
+
# Start a container that will handle all signals by emitting 'got: N'
local -a signals=(1 2 3 4 5 6 8 10 12 13 14 15 16 20 21 22 23 24 25 26 64)
- run_podman run -d $IMAGE sh -c \
+ run_podman run -d ${opt_log_driver} $IMAGE sh -c \
"for i in ${signals[*]}; do trap \"echo got: \$i\" \$i; done;
echo READY;
while ! test -e /stop; do sleep 0.05; done;