From 87501b9630e935599f3a325fdf823807ef0ff0f1 Mon Sep 17 00:00:00 2001 From: Jindrich Novy Date: Thu, 11 Nov 2021 18:15:12 +0100 Subject: [PATCH] podman-3.4.2-0.7.el9 - backport https://github.com/containers/podman/pull/12118 to 3.4 in attempt to fix gating tests - Related: #2000051 Signed-off-by: Jindrich Novy --- 12118.patch | 129 ++++++++++++++++++++++++++++++++++++++++++++++++++++ podman.spec | 8 +++- 2 files changed, 136 insertions(+), 1 deletion(-) create mode 100644 12118.patch diff --git a/12118.patch b/12118.patch new file mode 100644 index 0000000..ec5940d --- /dev/null +++ b/12118.patch @@ -0,0 +1,129 @@ +From e68fbf03aa4e117e769b479d5a83a4bbc0628a33 Mon Sep 17 00:00:00 2001 +From: Hironori Shiina +Date: Wed, 27 Oct 2021 09:26:58 -0400 +Subject: [PATCH] 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 +--- + test/system/035-logs.bats | 28 +++++++++++++++++++++++----- + test/system/130-kill.bats | 15 ++++++++++++++- + 2 files changed, 37 insertions(+), 6 deletions(-) + +diff -up containers-podman-8de9950/test/system/035-logs.bats.orig containers-podman-8de9950/test/system/035-logs.bats +--- containers-podman-8de9950/test/system/035-logs.bats.orig 2021-11-08 15:24:57.000000000 +0100 ++++ containers-podman-8de9950/test/system/035-logs.bats 2021-11-09 10:09:23.610813091 +0100 +@@ -30,6 +30,17 @@ load helpers + run_podman rm $cid + } + ++function _additional_events_backend() { ++ local driver=$1 ++ # Since PR#10431, 'logs -f' with journald driver is only supported with journald events backend. ++ if [[ $driver = "journald" ]]; then ++ run_podman info --format '{{.Host.EventLogger}}' >/dev/null ++ if [[ $output != "journald" ]]; then ++ echo "--events-backend journald" ++ fi ++ fi ++} ++ + function _log_test_multi() { + local driver=$1 + +@@ -42,10 +53,12 @@ function _log_test_multi() { + etc='.*' + fi + ++ local events_backend=$(_additional_events_backend $driver) ++ + # Simple helper to make the container starts, below, easier to read + local -a cid + doit() { +- run_podman run --log-driver=$driver --rm -d --name "$1" $IMAGE sh -c "$2"; ++ run_podman ${events_backend} run --log-driver=$driver --rm -d --name "$1" $IMAGE sh -c "$2"; + cid+=($(echo "${output:0:12}")) + } + +@@ -57,7 +70,7 @@ function _log_test_multi() { + doit c1 "echo a;sleep 10;echo d;sleep 3" + doit c2 "sleep 1;echo b;sleep 2;echo c;sleep 3" + +- run_podman logs -f c1 c2 ++ run_podman ${events_backend} logs -f c1 c2 + is "$output" \ + "${cid[0]} a$etc + ${cid[1]} b$etc +@@ -114,7 +127,7 @@ $s_after" + + run_podman logs --since $after test + is "$output" "$s_after" +- run_podman rm -f test ++ run_podman rm -t 1 -f test + } + + @test "podman logs - since k8s-file" { +@@ -167,7 +180,7 @@ $s_after" + + run_podman logs --until $after test + is "$output" "$s_both" "podman logs --until after" +- run_podman rm -f test ++ run_podman rm -t 0 -f test + } + + @test "podman logs - until k8s-file" { +@@ -187,15 +200,20 @@ function _log_test_follow() { + contentA=$(random_string) + contentB=$(random_string) + contentC=$(random_string) ++ local events_backend=$(_additional_events_backend $driver) ++ ++ if [[ -n "${events_backend}" ]]; then ++ skip_if_remote "remote does not support --events-backend" ++ fi + + # Note: it seems we need at least three log lines to hit #11461. +- run_podman run --log-driver=$driver --name $cname $IMAGE sh -c "echo $contentA; echo $contentB; echo $contentC" +- run_podman logs -f $cname ++ run_podman ${events_backend} run --log-driver=$driver --name $cname $IMAGE sh -c "echo $contentA; echo $contentB; echo $contentC" ++ run_podman ${events_backend} logs -f $cname + is "$output" "$contentA + $contentB + $contentC" "logs -f on exitted container works" + +- run_podman rm -f $cname ++ run_podman ${events_backend} rm -t 0 -f $cname + } + + @test "podman logs - --follow k8s-file" { +diff -up containers-podman-8de9950/test/system/130-kill.bats.orig containers-podman-8de9950/test/system/130-kill.bats +--- containers-podman-8de9950/test/system/130-kill.bats.orig 2021-11-08 15:24:57.000000000 +0100 ++++ containers-podman-8de9950/test/system/130-kill.bats 2021-11-09 10:09:23.611813102 +0100 +@@ -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; diff --git a/podman.spec b/podman.spec index 0c7d1aa..92f6fd9 100644 --- a/podman.spec +++ b/podman.spec @@ -29,7 +29,7 @@ go build -buildmode pie -compiler gc -tags="rpm_crashtraceback libtrust_openssl Epoch: 1 Name: podman Version: 3.4.2 -Release: 0.6%{?dist} +Release: 0.7%{?dist} Summary: Manage Pods, Containers and Container Images License: ASL 2.0 and GPLv3+ URL: https://%{name}.io/ @@ -42,6 +42,7 @@ Source1: https://github.com/openSUSE/catatonit/archive/v%{cataver}.tar.gz Source2: https://github.com/containers/dnsname/archive/v%{dnsnamever}.tar.gz Source3: https://github.com/containers/%{name}-machine-cni/archive/%{commit_mcni}/%{name}-machine-cni-%{shortcommit_mcni}.tar.gz Source4: https://github.com/containers/%{gvproxyrepo}/archive/v%{gvproxyver}.tar.gz +Patch0: https://patch-diff.githubusercontent.com/raw/containers/podman/pull/12118.patch # https://fedoraproject.org/wiki/PackagingDrafts/Go#Go_Language_Architectures ExclusiveArch: %{go_arches} Provides: %{name}-manpages = %{epoch}:%{version}-%{release} @@ -401,6 +402,11 @@ exit 0 %{_libexecdir}/%{name}/gvproxy %changelog +* Thu Nov 11 2021 Jindrich Novy - 1:3.4.2-0.7 +- backport https://github.com/containers/podman/pull/12118 to 3.4 + in attempt to fix gating tests +- Related: #2000051 + * Thu Nov 11 2021 Jindrich Novy - 1:3.4.2-0.6 - add Requires: gnupg (https://github.com/containers/podman/pull/12270)