systemd: Fix and expand ptests

systemd-ptest only runs a couple of tests currently.
* Install all test binaries and required data files
* Add missing runtime dependencies for -ptest
* Fix paths required for on-target testing in do_configure_prepend()
* cleanup do_install_ptest()

For reference, results on current core-image-sato:
  PASS: 109
  SKIP:   5
  FAIL:   2

test-execute failure:
https://github.com/systemd/systemd/issues/2852

test-acl-util failure:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=9269

Fixes [YOCTO #8767].

(From OE-Core rev: 753daf14da4017cd5d245f1587ca44faa39784f5)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Jussi Kukkonen 2016-03-16 14:13:45 +02:00 committed by Richard Purdie
parent 427e369409
commit 8c0148f7b9
2 changed files with 30 additions and 14 deletions

View File

@ -1,5 +1,6 @@
#!/bin/sh
cd tests
tar -C test -xJf test/sys.tar.xz
make test/rules-test.sh.log
make test/udev-test.pl.log
make check-TESTS
cd ..

View File

@ -197,6 +197,8 @@ do_configure_prepend() {
else
cp -r ${S}/units ${S}/units.pre_sed
fi
sed -i -e 's:-DTEST_DIR=\\\".*\\\":-DTEST_DIR=\\\"${PTEST_PATH}/tests/test\\\":' ${S}/Makefile.am
sed -i -e 's:-DCATALOG_DIR=\\\".*\\\":-DCATALOG_DIR=\\\"${PTEST_PATH}/tests/catalog\\\":' ${S}/Makefile.am
}
do_install() {
@ -264,19 +266,27 @@ do_install() {
}
do_install_ptest () {
install -d ${D}${PTEST_PATH}/test
cp -rfL ${S}/test/* ${D}${PTEST_PATH}/test
install -m 0755 ${B}/test-udev ${D}${PTEST_PATH}/
install -d ${D}${PTEST_PATH}/build-aux
cp ${S}/build-aux/test-driver ${D}${PTEST_PATH}/build-aux/
cp -rf ${B}/rules ${D}${PTEST_PATH}/
# install data files needed for tests
install -d ${D}${PTEST_PATH}/tests/test
cp -rfL ${S}/test/* ${D}${PTEST_PATH}/tests/test
sed -i 's/"tree"/"ls"/' ${D}${PTEST_PATH}/tests/test/udev-test.pl
install -d ${D}${PTEST_PATH}/tests/catalog
install ${S}/catalog/* ${D}${PTEST_PATH}/tests/catalog/
install -D ${S}/build-aux/test-driver ${D}${PTEST_PATH}/tests/build-aux/test-driver
install -d ${D}${PTEST_PATH}/tests/rules
install ${B}/rules/* ${D}${PTEST_PATH}/tests/rules/
# This directory needs to be there for udev-test.pl to work.
install -d ${D}${libdir}/udev/rules.d
cp ${B}/Makefile ${D}${PTEST_PATH}/
cp ${S}/test/sys.tar.xz ${D}${PTEST_PATH}/test
sed -i 's/"tree"/"ls"/' ${D}${PTEST_PATH}/test/udev-test.pl
sed -i 's#${S}#${PTEST_PATH}#g' ${D}${PTEST_PATH}/Makefile
sed -i 's#${B}#${PTEST_PATH}#g' ${D}${PTEST_PATH}/Makefile
# install actual test binaries
install -m 0755 ${B}/test-* ${D}${PTEST_PATH}/tests/
install -m 0755 ${B}/.libs/test-* ${D}${PTEST_PATH}/tests/
install ${B}/Makefile ${D}${PTEST_PATH}/tests/
}
python populate_packages_prepend (){
@ -312,7 +322,12 @@ FILES_${PN}-analyze = "${bindir}/systemd-analyze"
FILES_${PN}-initramfs = "/init"
RDEPENDS_${PN}-initramfs = "${PN}"
RDEPENDS_${PN}-ptest += "perl python bash"
RDEPENDS_${PN}-ptest += "gawk make perl python bash xz \
tzdata tzdata-americas tzdata-asia \
tzdata-europe tzdata-africa tzdata-antarctica \
tzdata-arctic tzdata-atlantic tzdata-australia \
tzdata-pacific tzdata-posix"
FILES_${PN}-ptest += "${libdir}/udev/rules.d"
FILES_${PN}-gui = "${bindir}/systemadm"