diff options
| author | Jackie Huang <jackie.huang@windriver.com> | 2014-09-12 03:41:11 -0400 |
|---|---|---|
| committer | Martin Jansa <Martin.Jansa@gmail.com> | 2014-09-26 05:42:53 +0200 |
| commit | a6e76891679ffe34152a220aa693b5166d14b50b (patch) | |
| tree | abb227a57fdbe578b9ca32c55adf02b851b0e69c | |
| parent | d3f979c07e344828ed7bc9686f61882a22cf78ca (diff) | |
| download | meta-openembedded-a6e76891679ffe34152a220aa693b5166d14b50b.tar.gz | |
rsyslog: add ptest support
Changed:
- add a patch to use serial-tests config needed by ptest
- add a patch to fix rsyslog test cases don't finish issue
- add run-ptest, do_compile_ptest and do_install_ptest
- add dependency for rsyslog-ptest
- add PACKAGECONFIG for valgrind
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
4 files changed, 185 insertions, 1 deletions
diff --git a/meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog-fix-ptest-not-finish.patch b/meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog-fix-ptest-not-finish.patch new file mode 100644 index 0000000000..bdcb6e22a3 --- /dev/null +++ b/meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog-fix-ptest-not-finish.patch | |||
| @@ -0,0 +1,96 @@ | |||
| 1 | $MaxMessageSize doesn't work if before $IncludeConfig diag-common.conf, then | ||
| 2 | test cases fall into infinite loop with error message: | ||
| 3 | |||
| 4 | 8062.511110729:4902c480: error: message received is larger than max msg size, we split it | ||
| 5 | 8062.511152265:4902c480: discarding zero-sized message | ||
| 6 | |||
| 7 | Update configure to fix it. | ||
| 8 | |||
| 9 | Upstream-Status: pending | ||
| 10 | |||
| 11 | Kai Kang <kai.kang@windriver.com> | ||
| 12 | --- | ||
| 13 | diff -Nru rsyslog-7.4.4/tests/testsuites/complex1.conf rsyslog-7.4.4.new/tests/testsuites/complex1.conf | ||
| 14 | --- rsyslog-7.4.4/tests/testsuites/complex1.conf 2013-08-31 00:30:41.000000000 +0800 | ||
| 15 | +++ rsyslog-7.4.4.new/tests/testsuites/complex1.conf 2013-12-18 14:28:10.644004184 +0800 | ||
| 16 | @@ -1,7 +1,7 @@ | ||
| 17 | # complex test case with multiple actions in gzip mode | ||
| 18 | # rgerhards, 2009-05-22 | ||
| 19 | -$MaxMessageSize 10k | ||
| 20 | $IncludeConfig diag-common.conf | ||
| 21 | +$MaxMessageSize 10k | ||
| 22 | |||
| 23 | $MainMsgQueueTimeoutEnqueue 5000 | ||
| 24 | |||
| 25 | diff -Nru rsyslog-7.4.4/tests/testsuites/gzipwr_large.conf rsyslog-7.4.4.new/tests/testsuites/gzipwr_large.conf | ||
| 26 | --- rsyslog-7.4.4/tests/testsuites/gzipwr_large.conf 2012-04-04 14:29:55.000000000 +0800 | ||
| 27 | +++ rsyslog-7.4.4.new/tests/testsuites/gzipwr_large.conf 2013-12-18 14:28:10.645004186 +0800 | ||
| 28 | @@ -1,7 +1,7 @@ | ||
| 29 | # simple async writing test | ||
| 30 | # rgerhards, 2010-03-09 | ||
| 31 | -$MaxMessageSize 10k | ||
| 32 | $IncludeConfig diag-common.conf | ||
| 33 | +$MaxMessageSize 10k | ||
| 34 | |||
| 35 | $ModLoad ../plugins/imtcp/.libs/imtcp | ||
| 36 | $MainMsgQueueTimeoutShutdown 10000 | ||
| 37 | diff -Nru rsyslog-7.4.4/tests/testsuites/gzipwr_large_dynfile.conf rsyslog-7.4.4.new/tests/testsuites/gzipwr_large_dynfile.conf | ||
| 38 | --- rsyslog-7.4.4/tests/testsuites/gzipwr_large_dynfile.conf 2012-04-04 14:29:55.000000000 +0800 | ||
| 39 | +++ rsyslog-7.4.4.new/tests/testsuites/gzipwr_large_dynfile.conf 2013-12-18 14:28:10.645004186 +0800 | ||
| 40 | @@ -1,7 +1,7 @@ | ||
| 41 | # simple async writing test | ||
| 42 | # rgerhards, 2010-03-09 | ||
| 43 | -$MaxMessageSize 10k | ||
| 44 | $IncludeConfig diag-common.conf | ||
| 45 | +$MaxMessageSize 10k | ||
| 46 | |||
| 47 | $ModLoad ../plugins/imtcp/.libs/imtcp | ||
| 48 | $MainMsgQueueTimeoutShutdown 10000 | ||
| 49 | diff -Nru rsyslog-7.4.4/tests/testsuites/imptcp_conndrop.conf rsyslog-7.4.4.new/tests/testsuites/imptcp_conndrop.conf | ||
| 50 | --- rsyslog-7.4.4/tests/testsuites/imptcp_conndrop.conf 2013-08-31 00:30:41.000000000 +0800 | ||
| 51 | +++ rsyslog-7.4.4.new/tests/testsuites/imptcp_conndrop.conf 2013-12-18 14:28:10.646004189 +0800 | ||
| 52 | @@ -1,7 +1,7 @@ | ||
| 53 | # simple async writing test | ||
| 54 | # rgerhards, 2010-03-09 | ||
| 55 | -$MaxMessageSize 10k | ||
| 56 | $IncludeConfig diag-common.conf | ||
| 57 | +$MaxMessageSize 10k | ||
| 58 | |||
| 59 | $ModLoad ../plugins/imptcp/.libs/imptcp | ||
| 60 | $MainMsgQueueTimeoutShutdown 10000 | ||
| 61 | diff -Nru rsyslog-7.4.4/tests/testsuites/imptcp_large.conf rsyslog-7.4.4.new/tests/testsuites/imptcp_large.conf | ||
| 62 | --- rsyslog-7.4.4/tests/testsuites/imptcp_large.conf 2013-08-31 00:30:41.000000000 +0800 | ||
| 63 | +++ rsyslog-7.4.4.new/tests/testsuites/imptcp_large.conf 2013-12-18 14:28:10.646004189 +0800 | ||
| 64 | @@ -1,7 +1,7 @@ | ||
| 65 | # simple async writing test | ||
| 66 | # rgerhards, 2010-03-09 | ||
| 67 | -$MaxMessageSize 10k | ||
| 68 | $IncludeConfig diag-common.conf | ||
| 69 | +$MaxMessageSize 10k | ||
| 70 | |||
| 71 | $ModLoad ../plugins/imptcp/.libs/imptcp | ||
| 72 | $MainMsgQueueTimeoutShutdown 10000 | ||
| 73 | diff -Nru rsyslog-7.4.4/tests/testsuites/imtcp_conndrop.conf rsyslog-7.4.4.new/tests/testsuites/imtcp_conndrop.conf | ||
| 74 | --- rsyslog-7.4.4/tests/testsuites/imtcp_conndrop.conf 2013-07-19 20:59:03.000000000 +0800 | ||
| 75 | +++ rsyslog-7.4.4.new/tests/testsuites/imtcp_conndrop.conf 2013-12-18 14:28:10.646004189 +0800 | ||
| 76 | @@ -1,7 +1,7 @@ | ||
| 77 | # simple async writing test | ||
| 78 | # rgerhards, 2010-03-09 | ||
| 79 | -$MaxMessageSize 10k | ||
| 80 | $IncludeConfig diag-common.conf | ||
| 81 | +$MaxMessageSize 10k | ||
| 82 | |||
| 83 | $ModLoad ../plugins/imtcp/.libs/imtcp | ||
| 84 | $MainMsgQueueTimeoutShutdown 10000 | ||
| 85 | diff -Nru rsyslog-7.4.4/tests/testsuites/wr_large.conf rsyslog-7.4.4.new/tests/testsuites/wr_large.conf | ||
| 86 | --- rsyslog-7.4.4/tests/testsuites/wr_large.conf 2012-04-04 14:29:55.000000000 +0800 | ||
| 87 | +++ rsyslog-7.4.4.new/tests/testsuites/wr_large.conf 2013-12-18 14:28:10.647004190 +0800 | ||
| 88 | @@ -1,7 +1,7 @@ | ||
| 89 | # simple async writing test | ||
| 90 | # rgerhards, 2010-03-09 | ||
| 91 | -$MaxMessageSize 10k | ||
| 92 | $IncludeConfig diag-common.conf | ||
| 93 | +$MaxMessageSize 10k | ||
| 94 | |||
| 95 | $ModLoad ../plugins/imtcp/.libs/imtcp | ||
| 96 | $MainMsgQueueTimeoutShutdown 10000 | ||
diff --git a/meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog-use-serial-tests-config-needed-by-ptest.patch b/meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog-use-serial-tests-config-needed-by-ptest.patch new file mode 100644 index 0000000000..3a16f2649a --- /dev/null +++ b/meta-oe/recipes-extended/rsyslog/rsyslog/rsyslog-use-serial-tests-config-needed-by-ptest.patch | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | Subject: [PATCH] rsyslog: use serial-tests config needed by ptest | ||
| 2 | |||
| 3 | ptest needs buildtest-TESTS and runtest-TESTS targets. | ||
| 4 | serial-tests is required to generate those targets. | ||
| 5 | |||
| 6 | Upstream-Status: Inappropriate [default automake behavior incompatible with ptest] | ||
| 7 | |||
| 8 | Signed-off-by: Jackie Huang <jackie.huang@windriver.com> | ||
| 9 | --- | ||
| 10 | configure.ac | 2 +- | ||
| 11 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 12 | |||
| 13 | diff --git a/configure.ac b/configure.ac | ||
| 14 | index 1b880f8..0e29742 100644 | ||
| 15 | --- a/configure.ac | ||
| 16 | +++ b/configure.ac | ||
| 17 | @@ -3,7 +3,7 @@ | ||
| 18 | |||
| 19 | AC_PREREQ(2.61) | ||
| 20 | AC_INIT([rsyslog],[7.4.4],[rsyslog@lists.adiscon.com]) | ||
| 21 | -AM_INIT_AUTOMAKE | ||
| 22 | +AM_INIT_AUTOMAKE([serial-tests]) | ||
| 23 | |||
| 24 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) | ||
| 25 | |||
| 26 | -- | ||
| 27 | 2.0.0 | ||
| 28 | |||
diff --git a/meta-oe/recipes-extended/rsyslog/rsyslog/run-ptest b/meta-oe/recipes-extended/rsyslog/rsyslog/run-ptest new file mode 100644 index 0000000000..38a1d1b722 --- /dev/null +++ b/meta-oe/recipes-extended/rsyslog/rsyslog/run-ptest | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # | ||
| 3 | make -C tests -k runtest-TESTS | ||
diff --git a/meta-oe/recipes-extended/rsyslog/rsyslog_7.4.4.bb b/meta-oe/recipes-extended/rsyslog/rsyslog_7.4.4.bb index 143e1c64a3..aeca09a278 100644 --- a/meta-oe/recipes-extended/rsyslog/rsyslog_7.4.4.bb +++ b/meta-oe/recipes-extended/rsyslog/rsyslog_7.4.4.bb | |||
| @@ -22,12 +22,15 @@ SRC_URI = "http://www.rsyslog.com/files/download/rsyslog/${BPN}-${PV}.tar.gz \ | |||
| 22 | file://rsyslog.conf \ | 22 | file://rsyslog.conf \ |
| 23 | file://rsyslog.logrotate \ | 23 | file://rsyslog.logrotate \ |
| 24 | file://use-pkgconfig-to-check-libgcrypt.patch \ | 24 | file://use-pkgconfig-to-check-libgcrypt.patch \ |
| 25 | file://run-ptest \ | ||
| 26 | file://rsyslog-fix-ptest-not-finish.patch \ | ||
| 27 | file://rsyslog-use-serial-tests-config-needed-by-ptest.patch \ | ||
| 25 | " | 28 | " |
| 26 | 29 | ||
| 27 | SRC_URI[md5sum] = "ebcc010a6205c28eb505c0fe862f32c6" | 30 | SRC_URI[md5sum] = "ebcc010a6205c28eb505c0fe862f32c6" |
| 28 | SRC_URI[sha256sum] = "276d094d1e4c62c770ec8a72723667f119eee038912b79cf3337d439bc2f9087" | 31 | SRC_URI[sha256sum] = "276d094d1e4c62c770ec8a72723667f119eee038912b79cf3337d439bc2f9087" |
| 29 | 32 | ||
| 30 | inherit autotools pkgconfig systemd update-rc.d update-alternatives | 33 | inherit autotools pkgconfig systemd update-rc.d update-alternatives ptest |
| 31 | 34 | ||
| 32 | EXTRA_OECONF += "--enable-cached-man-pages" | 35 | EXTRA_OECONF += "--enable-cached-man-pages" |
| 33 | 36 | ||
| @@ -37,6 +40,7 @@ PACKAGECONFIG ??= " \ | |||
| 37 | imdiag gnutls \ | 40 | imdiag gnutls \ |
| 38 | ${@base_contains('DISTRO_FEATURES', 'snmp', 'snmp', '', d)} \ | 41 | ${@base_contains('DISTRO_FEATURES', 'snmp', 'snmp', '', d)} \ |
| 39 | ${@base_contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \ | 42 | ${@base_contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \ |
| 43 | ${@base_contains('DISTRO_FEATURES', 'ptest', 'testbench ${VALGRIND}', '', d)} \ | ||
| 40 | " | 44 | " |
| 41 | 45 | ||
| 42 | # default yes in configure | 46 | # default yes in configure |
| @@ -61,6 +65,50 @@ PACKAGECONFIG[postgresql] = "--enable-pgsql,--disable-pgsql,postgresql," | |||
| 61 | PACKAGECONFIG[libdbi] = "--enable-libdbi,--disable-libdbi,libdbi," | 65 | PACKAGECONFIG[libdbi] = "--enable-libdbi,--disable-libdbi,libdbi," |
| 62 | PACKAGECONFIG[mail] = "--enable-mail,--disable-mail,," | 66 | PACKAGECONFIG[mail] = "--enable-mail,--disable-mail,," |
| 63 | PACKAGECONFIG[gui] = "--enable-gui,--disable-gui,," | 67 | PACKAGECONFIG[gui] = "--enable-gui,--disable-gui,," |
| 68 | PACKAGECONFIG[valgrind] = "--enable-valgrind,--disable-valgrind,valgrind," | ||
| 69 | |||
| 70 | TESTDIR = "tests" | ||
| 71 | do_compile_ptest() { | ||
| 72 | sed -i 's/\(^buildtest-TESTS: \)/\1 $(check_PROGRAMS) /' ${TESTDIR}/Makefile | ||
| 73 | oe_runmake -C ${TESTDIR} buildtest-TESTS | ||
| 74 | } | ||
| 75 | |||
| 76 | do_install_ptest() { | ||
| 77 | # install the tests | ||
| 78 | cp -rf ${S}/${TESTDIR} ${D}${PTEST_PATH} | ||
| 79 | cp -rf ${B}/${TESTDIR} ${D}${PTEST_PATH} | ||
| 80 | |||
| 81 | # do NOT need to rebuild Makefile itself | ||
| 82 | sed -i 's/^Makefile:.*$/Makefile:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile | ||
| 83 | |||
| 84 | # fix the srcdir | ||
| 85 | sed -i 's,^\(srcdir = \).*,\1${PTEST_PATH}/tests,' ${D}${PTEST_PATH}/${TESTDIR}/Makefile | ||
| 86 | |||
| 87 | # valgrind is not compatible with arm and mips, | ||
| 88 | # so remove related test cases if there is no valgrind. | ||
| 89 | if [ x${VALGRIND} = x ]; then | ||
| 90 | sed -i '/udp-msgreduc-/d' ${D}${PTEST_PATH}/${TESTDIR}/Makefile | ||
| 91 | fi | ||
| 92 | |||
| 93 | # install necessary links | ||
| 94 | install -d ${D}${PTEST_PATH}/tools | ||
| 95 | ln -sf ${sbindir}/rsyslogd ${D}${PTEST_PATH}/tools/rsyslogd | ||
| 96 | |||
| 97 | install -d ${D}${PTEST_PATH}/runtime | ||
| 98 | install -d ${D}${PTEST_PATH}/runtime/.libs | ||
| 99 | ( | ||
| 100 | cd ${D}/${libdir}/rsyslog | ||
| 101 | allso="*.so" | ||
| 102 | for i in $allso; do | ||
| 103 | ln -sf ${libdir}/rsyslog/$i ${D}${PTEST_PATH}/runtime/.libs/$i | ||
| 104 | done | ||
| 105 | ) | ||
| 106 | |||
| 107 | # fix the module load path with runtime/.libs | ||
| 108 | find ${D}${PTEST_PATH}/${TESTDIR} -name \*.conf -exec \ | ||
| 109 | sed -i -e 's:../plugins/.*/.libs/:../runtime/.libs/:' \ | ||
| 110 | '{}' \; | ||
| 111 | } | ||
| 64 | 112 | ||
| 65 | do_install_append() { | 113 | do_install_append() { |
| 66 | install -d "${D}${sysconfdir}/init.d" | 114 | install -d "${D}${sysconfdir}/init.d" |
| @@ -95,6 +143,15 @@ SYSTEMD_SERVICE_${PN} = "${BPN}.service" | |||
| 95 | 143 | ||
| 96 | RDEPENDS_${PN} += "logrotate" | 144 | RDEPENDS_${PN} += "logrotate" |
| 97 | 145 | ||
| 146 | # for rsyslog-ptest | ||
| 147 | VALGRIND = "valgrind" | ||
| 148 | VALGRIND_mips = "" | ||
| 149 | VALGRIND_mips64 = "" | ||
| 150 | VALGRIND_arm = "" | ||
| 151 | VALGRIND_aarch64 = "" | ||
| 152 | RDEPENDS_${PN}-ptest += "make diffutils gzip" | ||
| 153 | RRECOMMENDS_${PN}-ptest += "${TCLIBC}-dbg ${VALGRIND}" | ||
| 154 | |||
| 98 | # no syslog-init for systemd | 155 | # no syslog-init for systemd |
| 99 | python () { | 156 | python () { |
| 100 | if bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): | 157 | if bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): |
