diff options
author | Frank WOLFF <frank.wolff@smile.fr> | 2023-04-05 16:36:04 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-04-13 11:56:07 +0100 |
commit | d5592877fedcba2aad95bdc2d917254d7e17f1de (patch) | |
tree | 7588bb2634c83c92ce26f7a5300f21e5b4d47d10 | |
parent | 56b8b8a8672012da586f0d265bff25c576c44b97 (diff) | |
download | poky-d5592877fedcba2aad95bdc2d917254d7e17f1de.tar.gz |
logrotate: add ptest support
Below is an extract of the test log:
root@qemux86-64:~# ptest-runner
START: ptest-runner
2023-04-05T12:20
BEGIN: /usr/lib/logrotate/ptest
make check-TESTS
make[1]: Entering directory '/usr/lib/logrotate/ptest'
make[2]: Entering directory '/usr/lib/logrotate/ptest'
PASS: test-0001.sh
PASS: test-0002.sh
...
...
PASS: test-0107.sh
PASS: test-0108.sh
============================================================================
Testsuite summary for logrotate 3.21.0
============================================================================
# TOTAL: 102
# PASS: 97
# SKIP: 5
# XFAIL: 0
# FAIL: 0
# XPASS: 0
# ERROR: 0
============================================================================
make[2]: Leaving directory '/usr/lib/logrotate/ptest'
make[1]: Leaving directory '/usr/lib/logrotate/ptest'
DURATION: 353
END: /usr/lib/logrotate/ptest
2023-04-05T12:26
STOP: ptest-runner
TOTAL: 1 FAIL: 0
Reviewed-by: Yoann CONGAL <yoann.congal@smile.fr>
(From OE-Core rev: 0bdfe34c016c8db1f18d76b59a38af280b4c70aa)
Signed-off-by: Frank WOLFF <frank.wolff@smile.fr>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/conf/distro/include/ptest-packagelists.inc | 1 | ||||
-rwxr-xr-x | meta/recipes-extended/logrotate/logrotate/run-ptest | 5 | ||||
-rw-r--r-- | meta/recipes-extended/logrotate/logrotate_3.21.0.bb | 30 |
3 files changed, 34 insertions, 2 deletions
diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc index d60ebb38fc..78750a0d98 100644 --- a/meta/conf/distro/include/ptest-packagelists.inc +++ b/meta/conf/distro/include/ptest-packagelists.inc | |||
@@ -46,6 +46,7 @@ PTESTS_FAST = "\ | |||
46 | libxml-sax-base-perl \ | 46 | libxml-sax-base-perl \ |
47 | libxml-simple-perl \ | 47 | libxml-simple-perl \ |
48 | libxml2 \ | 48 | libxml2 \ |
49 | logrotate \ | ||
49 | lua \ | 50 | lua \ |
50 | lzo \ | 51 | lzo \ |
51 | m4 \ | 52 | m4 \ |
diff --git a/meta/recipes-extended/logrotate/logrotate/run-ptest b/meta/recipes-extended/logrotate/logrotate/run-ptest new file mode 100755 index 0000000000..b272def65f --- /dev/null +++ b/meta/recipes-extended/logrotate/logrotate/run-ptest | |||
@@ -0,0 +1,5 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | set -u | ||
4 | |||
5 | make -k check | ||
diff --git a/meta/recipes-extended/logrotate/logrotate_3.21.0.bb b/meta/recipes-extended/logrotate/logrotate_3.21.0.bb index 4e4ea10628..87c0d9ae60 100644 --- a/meta/recipes-extended/logrotate/logrotate_3.21.0.bb +++ b/meta/recipes-extended/logrotate/logrotate_3.21.0.bb | |||
@@ -10,7 +10,9 @@ DEPENDS="coreutils popt" | |||
10 | 10 | ||
11 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" | 11 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" |
12 | 12 | ||
13 | SRC_URI = "${GITHUB_BASE_URI}/download/${PV}/${BP}.tar.xz" | 13 | SRC_URI = "${GITHUB_BASE_URI}/download/${PV}/${BP}.tar.xz \ |
14 | file://run-ptest \ | ||
15 | " | ||
14 | 16 | ||
15 | SRC_URI[sha256sum] = "8fa12015e3b8415c121fc9c0ca53aa872f7b0702f543afda7e32b6c4900f6516" | 17 | SRC_URI[sha256sum] = "8fa12015e3b8415c121fc9c0ca53aa872f7b0702f543afda7e32b6c4900f6516" |
16 | 18 | ||
@@ -44,7 +46,7 @@ EXTRA_OEMAKE = "\ | |||
44 | # INSTALL=install and BASEDIR=/usr. | 46 | # INSTALL=install and BASEDIR=/usr. |
45 | OS_NAME = "Linux" | 47 | OS_NAME = "Linux" |
46 | 48 | ||
47 | inherit autotools systemd github-releases | 49 | inherit autotools systemd github-releases ptest |
48 | 50 | ||
49 | SYSTEMD_SERVICE:${PN} = "\ | 51 | SYSTEMD_SERVICE:${PN} = "\ |
50 | ${BPN}.service \ | 52 | ${BPN}.service \ |
@@ -86,3 +88,27 @@ do_install(){ | |||
86 | install -p -m 0755 ${S}/examples/logrotate.cron ${D}${sysconfdir}/cron.daily/logrotate | 88 | install -p -m 0755 ${S}/examples/logrotate.cron ${D}${sysconfdir}/cron.daily/logrotate |
87 | fi | 89 | fi |
88 | } | 90 | } |
91 | |||
92 | do_install_ptest() { | ||
93 | cp -r ${S}/test/* ${D}${PTEST_PATH} | ||
94 | cp ${S}/test-driver ${D}${PTEST_PATH} | ||
95 | cp ${B}/test/Makefile ${D}${PTEST_PATH} | ||
96 | |||
97 | # Do not rebuild Makefile | ||
98 | sed -i 's/^Makefile:/_Makefile:/' ${D}${PTEST_PATH}/Makefile | ||
99 | |||
100 | # Fix top_builddir and top_srcdir | ||
101 | sed -e 's/^top_builddir = \(.*\)/top_builddir = ./' \ | ||
102 | -e 's/^top_srcdir = \(.*\)/top_srcdir = ./' \ | ||
103 | -i ${D}${PTEST_PATH}/Makefile | ||
104 | |||
105 | # Replace bash with sh | ||
106 | sed -i 's,/bin/bash,/bin/sh,' ${D}${PTEST_PATH}/Makefile | ||
107 | |||
108 | # Replace gawk with awk | ||
109 | sed -i 's/gawk/awk/' ${D}${PTEST_PATH}/Makefile | ||
110 | ln -s ${sbindir}/logrotate ${D}${PTEST_PATH} | ||
111 | } | ||
112 | |||
113 | # coreutils is needed to have "readlink" | ||
114 | RDEPENDS:${PN}-ptest += "make coreutils" | ||