summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGyorgy Sarvari <skandigraun@gmail.com>2025-12-06 18:59:10 +0100
committerGyorgy Sarvari <skandigraun@gmail.com>2025-12-06 19:34:17 +0100
commitd95d7c8e7b476d9f9d45735ddff91e210871aed7 (patch)
tree63a83c40453be1d728bba87115f2117912ee273b
parentdcc7681d01bb56b9ca88e7c074baf6c5d56a1d70 (diff)
downloadmeta-openembedded-d95d7c8e7b476d9f9d45735ddff91e210871aed7.tar.gz
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>
-rw-r--r--meta-oe/recipes-support/xrdp/xrdp/run-ptest13
-rw-r--r--meta-oe/recipes-support/xrdp/xrdp_0.9.18.1.bb35
2 files changed, 46 insertions, 2 deletions
diff --git a/meta-oe/recipes-support/xrdp/xrdp/run-ptest b/meta-oe/recipes-support/xrdp/xrdp/run-ptest
new file mode 100644
index 0000000000..4db66da65e
--- /dev/null
+++ b/meta-oe/recipes-support/xrdp/xrdp/run-ptest
@@ -0,0 +1,13 @@
1#!/bin/sh
2
3RESULT=0
4cd tests
5for t in $(find . -type f -executable); do
6 ./$t > $t.out
7 ret=$?
8 if [ $ret -ne 0 ]; then
9 RESULT=$ret
10 fi
11 sed -e "s/^ok/PASS: /g" -e "s/^not ok/FAIL: /g" ./$t.out
12done
13exit $RESULT
diff --git a/meta-oe/recipes-support/xrdp/xrdp_0.9.18.1.bb b/meta-oe/recipes-support/xrdp/xrdp_0.9.18.1.bb
index 5526027712..48d451ea8c 100644
--- a/meta-oe/recipes-support/xrdp/xrdp_0.9.18.1.bb
+++ b/meta-oe/recipes-support/xrdp/xrdp_0.9.18.1.bb
@@ -4,7 +4,7 @@ LICENSE = "Apache-2.0"
4LIC_FILES_CHKSUM = "file://COPYING;md5=72cfbe4e7bd33a0a1de9630c91195c21 \ 4LIC_FILES_CHKSUM = "file://COPYING;md5=72cfbe4e7bd33a0a1de9630c91195c21 \
5" 5"
6 6
7inherit features_check autotools pkgconfig useradd systemd 7inherit features_check autotools pkgconfig useradd systemd ptest
8 8
9DEPENDS = "openssl virtual/libx11 libxfixes libxrandr libpam nasm-native imlib2 pixman libsm" 9DEPENDS = "openssl virtual/libx11 libxfixes libxrandr libpam nasm-native imlib2 pixman libsm"
10 10
@@ -12,6 +12,7 @@ REQUIRED_DISTRO_FEATURES = "x11 pam"
12 12
13SRC_URI = "https://github.com/neutrinolabs/${BPN}/releases/download/v${PV}/${BPN}-${PV}.tar.gz \ 13SRC_URI = "https://github.com/neutrinolabs/${BPN}/releases/download/v${PV}/${BPN}-${PV}.tar.gz \
14 file://xrdp.sysconfig \ 14 file://xrdp.sysconfig \
15 file://run-ptest \
15 file://0001-Added-req_distinguished_name-in-etc-xrdp-openssl.con.patch \ 16 file://0001-Added-req_distinguished_name-in-etc-xrdp-openssl.con.patch \
16 file://0001-Fix-the-compile-error.patch \ 17 file://0001-Fix-the-compile-error.patch \
17 file://0001-arch-Define-NO_NEED_ALIGN-on-ppc64.patch \ 18 file://0001-arch-Define-NO_NEED_ALIGN-on-ppc64.patch \
@@ -31,8 +32,9 @@ SRC_URI[sha256sum] = "f76aa16034689bb8997e56fd554db29ba57caa1bab228a6eda28be4389
31 32
32CFLAGS += " -Wno-deprecated-declarations" 33CFLAGS += " -Wno-deprecated-declarations"
33 34
34PACKAGECONFIG ??= "" 35PACKAGECONFIG ??= "${@bb.utils.contains('PTEST_ENABLED', '1', 'test', '', d)}"
35PACKAGECONFIG[fuse] = " --enable-fuse, --disable-fuse, fuse" 36PACKAGECONFIG[fuse] = " --enable-fuse, --disable-fuse, fuse"
37PACKAGECONFIG[test] = " --enable-tests, , libcheck cmocka"
36 38
37USERADD_PACKAGES = "${PN}" 39USERADD_PACKAGES = "${PN}"
38GROUPADD_PARAM:${PN} = "--system xrdp" 40GROUPADD_PARAM:${PN} = "--system xrdp"
@@ -79,6 +81,35 @@ do_install:append() {
79 chown xrdp:xrdp ${D}${sysconfdir}/xrdp 81 chown xrdp:xrdp ${D}${sysconfdir}/xrdp
80} 82}
81 83
84do_compile_ptest() {
85 for testdir in $(find ./tests -type d -mindepth 1); do
86 cd $testdir
87 echo 'buildtest-TESTS: $(check_PROGRAMS)' >> Makefile
88 # change the test-data folder to ./data instead of ${S}
89 sed -i 's|-D TOP_SRCDIR=[^ ]*|-D TOP_SRCDIR=\\"./data\\"|' Makefile
90 # another test data folder redirection
91 sed -i 's|-D IMAGEDIR=[^ ]*|-D IMAGEDIR=\\"./data\\"|' Makefile
92 # and another
93 sed -i 's|-DXRDP_TOP_SRCDIR=[^ ]*|-DXRDP_TOP_SRCDIR=\\"..\\"|' Makefile
94 oe_runmake buildtest-TESTS
95 cd -
96 done
97}
98
99do_install_ptest() {
100 install -d ${D}${PTEST_PATH}/tests/data/xrdp
101 for testbin in $(find ./tests -type f -executable -mindepth 3); do
102 install $testbin ${D}${PTEST_PATH}/tests/
103 done
104 install -m 666 ${S}/xrdp/xrdp256.bmp ${D}${PTEST_PATH}/tests/data/xrdp/
105 install -m 666 ${S}/xrdp/ad256.bmp ${D}${PTEST_PATH}/tests/data/xrdp/
106 install -m 666 ${S}/tests/xrdp/*.bmp ${D}${PTEST_PATH}/tests/data/
107 install -m 666 ${S}/tests/xrdp/test1.jpg ${D}${PTEST_PATH}/tests/data/
108 install -m 666 ${S}/tests/xrdp/test_alpha_blend.png ${D}${PTEST_PATH}/tests/data/
109}
110
111RDEPENDS:${PN}-ptest += "imlib2-loaders"
112
82SYSTEMD_SERVICE:${PN} = "xrdp.service xrdp-sesman.service" 113SYSTEMD_SERVICE:${PN} = "xrdp.service xrdp-sesman.service"
83 114
84pkg_postinst:${PN}() { 115pkg_postinst:${PN}() {