rsyslog: fix some of the ptests
PATCH 1/1 rsyslog: fix some of the ptests
Run test as non-root 'tester'.
Add more rdepends for ptest.
Introduce a patch to skip checking for a libc header:
sys/inotify
Python scripts no longer called with ./script.
Remove the need for to patch shebang.
Ptest results:
8.2102.0 =============== TOTAL: 424 PASS: 417 SKIP: 5 XFAIL: 0 FAIL: 2 XPASS: 0 ERROR: 0
Remaining failure related to relp:
* imrelp-tls-cfgcmd
* sndrcv_relp_tls-cfgcmd
Signed-off-by Yi Fan Yu <[email protected]>
--- ...-tests-disable-the-check-for-inotify.patch | 46 +++++++++++++++++++ .../rsyslog/rsyslog/run-ptest | 6 ++- .../rsyslog/rsyslog_8.2102.0.bb | 15 +++--- 3 files changed, 60 insertions(+), 7 deletions(-) create mode 100644 meta-oe/recipes-extended/rsyslog/rsyslog/0001-tests-disable-the-check-for-inotify.patch
meta-oe/recipes-extended/rsyslog/rsyslog/0001-tests-disable-the-check-for-inotify.patch new file +46 -0
@@ -0,0 +1,46 @@ +From 2d45f4b90bdc42f515764ae28bf62ab8fa23531d Mon Sep 17 00:00:00 2001 +From: Yi Fan Yu <[email protected]> +Date: Wed, 10 Mar 2021 14:47:21 -0500 +Subject: [PATCH] tests: disable the check for inotify + +We don't need to check inotify.h. +Assume it is present since it is part of the linux kernel +since 2.6.13 [1]. + +[1](https://kernelnewbies.org/Linux_2_6_13) + +(it would require installing the libc headers otherwise, + for the test to detect /usr/include/sys/inotify.h.) + +Upstream-Status: Not Applicable [OE-specific] + +Signed-off-by: Yi Fan Yu <[email protected]> +--- + tests/diag.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests/diag.sh b/tests/diag.sh +index 0739bdb74..7a0176bd6 100755 +--- a/tests/diag.sh ++++ b/tests/diag.sh +@@ -2679,7 +2679,7 @@ case $1 in + fi + ;; + 'check-inotify') # Check for inotify/fen support +- if [ -n "$(find /usr/include -name 'inotify.h' -print -quit)" ]; then ++ if true; then + echo [inotify mode] + elif [ -n "$(find /usr/include/sys/ -name 'port.h' -print -quit)" ]; then + grep -qF "PORT_SOURCE_FILE" < /usr/include/sys/port.h +@@ -2694,7 +2694,7 @@ case $1 in + fi + ;; + 'check-inotify-only') # Check for ONLY inotify support +- if [ -n "$(find /usr/include -name 'inotify.h' -print -quit)" ]; then ++ if true; then + echo [inotify mode] + else + echo [inotify not supported, skipping...] +-- +2.29.2 +
meta-oe/recipes-extended/rsyslog/rsyslog/run-ptest +5 -1
@@ -5,4 +5,8 @@ set -o pipefail SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" cd ${SCRIPTPATH} -make -C tests -k check-TESTS +useradd tester || echo "user already exists" +ln -sf /usr/sbin/logrotate /usr/bin/logrotate +su tester -c "make -C tests -k check-TESTS" +userdel tester +rm -f /usr/bin/logrotate
meta-oe/recipes-extended/rsyslog/rsyslog_8.2102.0.bb +9 -6
@@ -24,6 +24,7 @@ SRC_URI = "http://www.rsyslog.com/download/files/download/rsyslog/${BPN}-${PV}.t file://rsyslog.service \ file://use-pkgconfig-to-check-libgcrypt.patch \ file://run-ptest \ + file://0001-tests-disable-the-check-for-inotify.patch \ " SRC_URI_append_libc-musl = " \
@@ -80,11 +81,6 @@ PACKAGECONFIG[mail] = "--enable-mail,--disable-mail,," PACKAGECONFIG[valgrind] = ",--without-valgrind-testbench,valgrind," PACKAGECONFIG[imhttp] = "--enable-imhttp,--disable-imhttp,civetweb," -do_configure_prepend() { - sed -i -e 's|python |python3 |g' ${S}/tests/*.sh - sed -i -e 's|/usr/bin/env python|/usr/bin/env python3|g' ${S}/tests/*.py - sed -i -e 's|/usr/bin/env python|/usr/bin/env python3|g' ${S}/tests/testsuites/*.py -} TESTDIR = "tests" do_compile_ptest() {
@@ -97,6 +93,10 @@ do_install_ptest() { cp -rf ${S}/${TESTDIR} ${D}${PTEST_PATH} cp -rf ${B}/${TESTDIR} ${D}${PTEST_PATH} + # give permissions to all users + # some tests need to write to this directory as user 'daemon' + chmod 777 -R ${D}${PTEST_PATH}/tests + # do NOT need to rebuild Makefile itself sed -i 's/^Makefile:.*$/Makefile:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile # do NOT need to rebuild $(check_PROGRAMS)
@@ -195,8 +195,11 @@ VALGRIND_libc-musl_powerpc64le = '' VALGRIND_riscv64 = "" VALGRIND_riscv32 = "" +# util-linux: logger needs the -d option RDEPENDS_${PN}-ptest += "\ make diffutils gzip bash gawk coreutils procps \ - libgcc python3-core python3-io \ + libgcc python3-core python3-io python3-json \ + curl util-linux shadow \ " + RRECOMMENDS_${PN}-ptest += "${TCLIBC}-dbg ${VALGRIND}"
Signature · 1 line
2.29.2
fails to patch
https://errors.yoctoproject.org/Errors/Details/574583/
Quoted 153 lines · Yi Fan Yu
Run test as non-root 'tester'.
Add more rdepends for ptest.Introduce a patch to skip checking for a libc header:
sys/inotifyPython scripts no longer called with ./script.
Remove the need for to patch shebang.
Ptest results:8.2102.0 =============== TOTAL: 424 PASS: 417 SKIP: 5 XFAIL: 0 FAIL: 2 XPASS: 0 ERROR: 0Remaining failure related to relp:
* imrelp-tls-cfgcmd
* sndrcv_relp_tls-cfgcmdSigned-off-by Yi Fan Yu <[email protected]>--- ...-tests-disable-the-check-for-inotify.patch | 46 +++++++++++++++++++ .../rsyslog/rsyslog/run-ptest | 6 ++- .../rsyslog/rsyslog_8.2102.0.bb | 15 +++--- 3 files changed, 60 insertions(+), 7 deletions(-) create mode 100644 meta-oe/recipes-extended/rsyslog/rsyslog/0001-tests-disable-the-check-for-inotify.patchmeta-oe/recipes-extended/rsyslog/rsyslog/0001-tests-disable-the-check-for-inotify.patch new file +46
-0@@ -0,0 +1,46 @@ +From 2d45f4b90bdc42f515764ae28bf62ab8fa23531d Mon Sep 17 00:00:00 2001 +From: Yi Fan Yu <[email protected]> +Date: Wed, 10 Mar 2021 14:47:21 -0500 +Subject: [PATCH] tests: disable the check for inotify + +We don't need to check inotify.h. +Assume it is present since it is part of the linux kernel +since 2.6.13 [1]. + +[1](https://kernelnewbies.org/Linux_2_6_13) + +(it would require installing the libc headers otherwise, + for the test to detect /usr/include/sys/inotify.h.) + +Upstream-Status: Not Applicable [OE-specific] + +Signed-off-by: Yi Fan Yu <[email protected]> +--- + tests/diag.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests/diag.sh b/tests/diag.sh +index 0739bdb74..7a0176bd6 100755 +--- a/tests/diag.sh ++++ b/tests/diag.sh +@@ -2679,7 +2679,7 @@ case $1 in + fi + ;; + 'check-inotify') # Check for inotify/fen support +- if [ -n "$(find /usr/include -name 'inotify.h' -print -quit)" ]; then ++ if true; then + echo [inotify mode] + elif [ -n "$(find /usr/include/sys/ -name 'port.h' -print -quit)" ]; then + grep -qF "PORT_SOURCE_FILE" < /usr/include/sys/port.h +@@ -2694,7 +2694,7 @@ case $1 in + fi + ;; + 'check-inotify-only') # Check for ONLY inotify support +- if [ -n "$(find /usr/include -name 'inotify.h' -print -quit)" ]; then ++ if true; then + echo [inotify mode] + else + echo [inotify not supported, skipping...] +-- +2.29.2 +meta-oe/recipes-extended/rsyslog/rsyslog/run-ptest +5
-1@@ -5,4 +5,8 @@ set -o pipefail SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" cd ${SCRIPTPATH} -make -C tests -k check-TESTS +useradd tester || echo "user already exists" +ln -sf /usr/sbin/logrotate /usr/bin/logrotate +su tester -c "make -C tests -k check-TESTS" +userdel tester +rm -f /usr/bin/logrotatemeta-oe/recipes-extended/rsyslog/rsyslog_8.2102.0.bb +9
-7@@ -24,6 +24,7 @@ SRC_URI = "http://www.rsyslog.com/download/files/download/rsyslog/${BPN}-${PV}.t file://rsyslog.service \ file://use-pkgconfig-to-check-libgcrypt.patch \ file://run-ptest \ + file://0001-tests-disable-the-check-for-inotify.patch \ " SRC_URI_append_libc-musl = " \@@ -80,11 +81,6 @@ PACKAGECONFIG[mail] = "--enable-mail,--disable-mail,," PACKAGECONFIG[valgrind] = ",--without-valgrind-testbench,valgrind," PACKAGECONFIG[imhttp] = "--enable-imhttp,--disable-imhttp,civetweb," -do_configure_prepend() { - sed -i -e 's|python |python3 |g' ${S}/tests/*.sh - sed -i -e 's|/usr/bin/env python|/usr/bin/env python3|g' ${S}/tests/*.py - sed -i -e 's|/usr/bin/env python|/usr/bin/env python3|g' ${S}/tests/testsuites/*.py -} TESTDIR = "tests" do_compile_ptest() {@@ -97,6 +93,10 @@ do_install_ptest() { cp -rf ${S}/${TESTDIR} ${D}${PTEST_PATH} cp -rf ${B}/${TESTDIR} ${D}${PTEST_PATH} + # give permissions to all users + # some tests need to write to this directory as user 'daemon' + chmod 777 -R ${D}${PTEST_PATH}/tests + # do NOT need to rebuild Makefile itself sed -i 's/^Makefile:.*$/Makefile:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile # do NOT need to rebuild $(check_PROGRAMS)@@ -195,8 +195,11 @@ VALGRIND_libc-musl_powerpc64le = '' VALGRIND_riscv64 = "" VALGRIND_riscv32 = "" +# util-linux: logger needs the -d option RDEPENDS_${PN}-ptest += "\ make diffutils gzip bash gawk coreutils procps \ - libgcc python3-core python3-io \ + libgcc python3-core python3-io python3-json \ + curl util-linux shadow \ " + RRECOMMENDS_${PN}-ptest += "${TCLIBC}-dbg ${VALGRIND}" --2.29.2