]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
openssh: capture logs in run-ptest
authorMikko Rapeli <mikko.rapeli@linaro.org>
Thu, 14 Sep 2023 10:36:43 +0000 (13:36 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 14 Sep 2023 20:56:52 +0000 (21:56 +0100)
Drop patch to improve logging since upstream rejected it
but capture failure logs in run-ptests with similar code
as what upstream uses when running the tests via
https://github.com/openssh/openssh-portable/blob/master/.github/run_test.sh#L23

Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-connectivity/openssh/openssh/0001-openssh-regress-Makefile-print-logs-if-test-fails.patch [deleted file]
meta/recipes-connectivity/openssh/openssh/run-ptest
meta/recipes-connectivity/openssh/openssh_9.4p1.bb

diff --git a/meta/recipes-connectivity/openssh/openssh/0001-openssh-regress-Makefile-print-logs-if-test-fails.patch b/meta/recipes-connectivity/openssh/openssh/0001-openssh-regress-Makefile-print-logs-if-test-fails.patch
deleted file mode 100644 (file)
index 3355ac4..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-From 554f7baed050f89ffc2a7192d3071e8c5420f6d3 Mon Sep 17 00:00:00 2001
-From: Mikko Rapeli <mikko.rapeli@linaro.org>
-Date: Fri, 25 Aug 2023 10:35:28 +0000
-Subject: [PATCH] openssh regress/Makefile: print logs if test fails
-
-Some tests are failing in CI runs and reproduction has failed. Print
-the captured sshd and ssh client logs if test fails. This should
-help to fix the root causes.
-
-Reference: https://bugzilla.yoctoproject.org/show_bug.cgi?id=15178
-
-Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
----
- regress/Makefile | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-Upstream-Status: Denied [https://github.com/openssh/openssh-portable/pull/437]
-
-diff --git a/regress/Makefile b/regress/Makefile
-index d80bf59..a972dff 100644
---- a/regress/Makefile
-+++ b/regress/Makefile
-@@ -229,7 +229,7 @@ t-exec:    ${LTESTS:=.sh}
-               done; \
-               if [ "x$${skip}" = "xno" ]; then \
-                       echo "run test $${TEST}" ... 1>&2; \
--                      (env SUDO="${SUDO}" TEST_ENV=${TEST_ENV} ${TEST_SHELL} ${.CURDIR}/test-exec.sh ${.OBJDIR} ${.CURDIR}/$${TEST}) || exit $$?; \
-+                      (env SUDO="${SUDO}" TEST_ENV=${TEST_ENV} ${TEST_SHELL} ${.CURDIR}/test-exec.sh ${.OBJDIR} ${.CURDIR}/$${TEST}) || (echo return value: $$?; echo capturing logs; cat *.log; exit 1); \
-               else \
-                       echo skip test $${TEST} 1>&2; \
-               fi; \
--- 
-2.34.1
-
index 8a9b770d59cf65885d58d55a9b3ccff720df0819..1e6eec57995beeb78b3a8b5a76129c368ab04410 100755 (executable)
@@ -4,6 +4,20 @@ export TEST_SHELL=sh
 export SKIP_UNIT=1
 
 cd regress
+
+# copied from openssh-portable/.github/run_test.sh
+output_failed_logs() {
+    for i in failed*.log; do
+        if [ -f "$i" ]; then
+            echo -------------------------------------------------------------------------
+            echo LOGFILE $i
+            cat $i
+            echo -------------------------------------------------------------------------
+        fi
+    done
+}
+trap output_failed_logs 0
+
 sed -i "/\t\tagent-ptrace /d" Makefile
 make -k BUILDDIR=`pwd`/.. .OBJDIR=`pwd` .CURDIR=`pwd` SUDO="sudo" tests \
         | sed -u -e 's/^skipped/SKIP: /g' -e 's/^ok /PASS: /g' -e 's/^failed/FAIL: /g'
index 1cf69370380e120d49ef929a59c39ca860e1bf02..a38d9c2b810d3504c6928d72d6138d862747aa14 100644 (file)
@@ -24,7 +24,6 @@ SRC_URI = "http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar
            file://fix-potential-signed-overflow-in-pointer-arithmatic.patch \
            file://sshd_check_keys \
            file://add-test-support-for-busybox.patch \
-           file://0001-openssh-regress-Makefile-print-logs-if-test-fails.patch \
            file://0001-regress-banner.sh-log-input-and-output-files-on-erro.patch \
            "
 SRC_URI[sha256sum] = "3608fd9088db2163ceb3e600c85ab79d0de3d221e59192ea1923e23263866a85"