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
committerHironori Shiina <shiina.hironori@jp.fujitsu.com>2021-10-27 10:28:16 -0400
commite68fbf03aa4e117e769b479d5a83a4bbc0628a33 (patch)
tree6df22b4d2c11ad99907ef65cd9860bdca90a64a0 /test/system/130-kill.bats
parented3aa2acaf6a69937444286369c98b59c77803d5 (diff)
downloadpodman-e68fbf03aa4e117e769b479d5a83a4bbc0628a33.tar.gz
podman-e68fbf03aa4e117e769b479d5a83a4bbc0628a33.tar.bz2
podman-e68fbf03aa4e117e769b479d5a83a4bbc0628a33.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>
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;