mirror of
git://git.openembedded.org/meta-openembedded
synced 2026-05-21 15:53:11 +00:00
xrdp: add ptest support
It takes under 10 seconds to run the suite. Executed succesfully on x86-64, with musl and glibc. The recipe requires pam DISTRO_FEATURE to be present. Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com> (cherry picked from commit 54ca51b6c6c90ad464a488e1ee271d3fff708955) Adapted to Kirkstone Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
This commit is contained in:
parent
dcc7681d01
commit
d95d7c8e7b
13
meta-oe/recipes-support/xrdp/xrdp/run-ptest
Normal file
13
meta-oe/recipes-support/xrdp/xrdp/run-ptest
Normal file
@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
RESULT=0
|
||||
cd tests
|
||||
for t in $(find . -type f -executable); do
|
||||
./$t > $t.out
|
||||
ret=$?
|
||||
if [ $ret -ne 0 ]; then
|
||||
RESULT=$ret
|
||||
fi
|
||||
sed -e "s/^ok/PASS: /g" -e "s/^not ok/FAIL: /g" ./$t.out
|
||||
done
|
||||
exit $RESULT
|
||||
@ -4,7 +4,7 @@ LICENSE = "Apache-2.0"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=72cfbe4e7bd33a0a1de9630c91195c21 \
|
||||
"
|
||||
|
||||
inherit features_check autotools pkgconfig useradd systemd
|
||||
inherit features_check autotools pkgconfig useradd systemd ptest
|
||||
|
||||
DEPENDS = "openssl virtual/libx11 libxfixes libxrandr libpam nasm-native imlib2 pixman libsm"
|
||||
|
||||
@ -12,6 +12,7 @@ REQUIRED_DISTRO_FEATURES = "x11 pam"
|
||||
|
||||
SRC_URI = "https://github.com/neutrinolabs/${BPN}/releases/download/v${PV}/${BPN}-${PV}.tar.gz \
|
||||
file://xrdp.sysconfig \
|
||||
file://run-ptest \
|
||||
file://0001-Added-req_distinguished_name-in-etc-xrdp-openssl.con.patch \
|
||||
file://0001-Fix-the-compile-error.patch \
|
||||
file://0001-arch-Define-NO_NEED_ALIGN-on-ppc64.patch \
|
||||
@ -31,8 +32,9 @@ SRC_URI[sha256sum] = "f76aa16034689bb8997e56fd554db29ba57caa1bab228a6eda28be4389
|
||||
|
||||
CFLAGS += " -Wno-deprecated-declarations"
|
||||
|
||||
PACKAGECONFIG ??= ""
|
||||
PACKAGECONFIG ??= "${@bb.utils.contains('PTEST_ENABLED', '1', 'test', '', d)}"
|
||||
PACKAGECONFIG[fuse] = " --enable-fuse, --disable-fuse, fuse"
|
||||
PACKAGECONFIG[test] = " --enable-tests, , libcheck cmocka"
|
||||
|
||||
USERADD_PACKAGES = "${PN}"
|
||||
GROUPADD_PARAM:${PN} = "--system xrdp"
|
||||
@ -79,6 +81,35 @@ do_install:append() {
|
||||
chown xrdp:xrdp ${D}${sysconfdir}/xrdp
|
||||
}
|
||||
|
||||
do_compile_ptest() {
|
||||
for testdir in $(find ./tests -type d -mindepth 1); do
|
||||
cd $testdir
|
||||
echo 'buildtest-TESTS: $(check_PROGRAMS)' >> Makefile
|
||||
# change the test-data folder to ./data instead of ${S}
|
||||
sed -i 's|-D TOP_SRCDIR=[^ ]*|-D TOP_SRCDIR=\\"./data\\"|' Makefile
|
||||
# another test data folder redirection
|
||||
sed -i 's|-D IMAGEDIR=[^ ]*|-D IMAGEDIR=\\"./data\\"|' Makefile
|
||||
# and another
|
||||
sed -i 's|-DXRDP_TOP_SRCDIR=[^ ]*|-DXRDP_TOP_SRCDIR=\\"..\\"|' Makefile
|
||||
oe_runmake buildtest-TESTS
|
||||
cd -
|
||||
done
|
||||
}
|
||||
|
||||
do_install_ptest() {
|
||||
install -d ${D}${PTEST_PATH}/tests/data/xrdp
|
||||
for testbin in $(find ./tests -type f -executable -mindepth 3); do
|
||||
install $testbin ${D}${PTEST_PATH}/tests/
|
||||
done
|
||||
install -m 666 ${S}/xrdp/xrdp256.bmp ${D}${PTEST_PATH}/tests/data/xrdp/
|
||||
install -m 666 ${S}/xrdp/ad256.bmp ${D}${PTEST_PATH}/tests/data/xrdp/
|
||||
install -m 666 ${S}/tests/xrdp/*.bmp ${D}${PTEST_PATH}/tests/data/
|
||||
install -m 666 ${S}/tests/xrdp/test1.jpg ${D}${PTEST_PATH}/tests/data/
|
||||
install -m 666 ${S}/tests/xrdp/test_alpha_blend.png ${D}${PTEST_PATH}/tests/data/
|
||||
}
|
||||
|
||||
RDEPENDS:${PN}-ptest += "imlib2-loaders"
|
||||
|
||||
SYSTEMD_SERVICE:${PN} = "xrdp.service xrdp-sesman.service"
|
||||
|
||||
pkg_postinst:${PN}() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user