diff options
| -rw-r--r-- | meta-oe/conf/include/ptest-packagelists-meta-oe.inc | 1 | ||||
| -rw-r--r-- | meta-oe/recipes-support/xrdp/xrdp/run-ptest | 13 | ||||
| -rw-r--r-- | meta-oe/recipes-support/xrdp/xrdp_0.10.4.1.bb | 37 |
3 files changed, 49 insertions, 2 deletions
diff --git a/meta-oe/conf/include/ptest-packagelists-meta-oe.inc b/meta-oe/conf/include/ptest-packagelists-meta-oe.inc index 74caac6ac0..d092c3c327 100644 --- a/meta-oe/conf/include/ptest-packagelists-meta-oe.inc +++ b/meta-oe/conf/include/ptest-packagelists-meta-oe.inc | |||
| @@ -54,6 +54,7 @@ PTESTS_FAST_META_OE = "\ | |||
| 54 | utf8proc \ | 54 | utf8proc \ |
| 55 | uthash \ | 55 | uthash \ |
| 56 | xmlsec1 \ | 56 | xmlsec1 \ |
| 57 | ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'xrdp', '', d)} \ | ||
| 57 | zeromq \ | 58 | zeromq \ |
| 58 | cjson \ | 59 | cjson \ |
| 59 | libplist \ | 60 | libplist \ |
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 | |||
| 3 | RESULT=0 | ||
| 4 | cd tests | ||
| 5 | for 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 | ||
| 12 | done | ||
| 13 | exit $RESULT | ||
diff --git a/meta-oe/recipes-support/xrdp/xrdp_0.10.4.1.bb b/meta-oe/recipes-support/xrdp/xrdp_0.10.4.1.bb index cd45d27fe4..8203ada8e5 100644 --- a/meta-oe/recipes-support/xrdp/xrdp_0.10.4.1.bb +++ b/meta-oe/recipes-support/xrdp/xrdp_0.10.4.1.bb | |||
| @@ -4,7 +4,7 @@ LICENSE = "Apache-2.0" | |||
| 4 | LIC_FILES_CHKSUM = "file://COPYING;md5=72cfbe4e7bd33a0a1de9630c91195c21 \ | 4 | LIC_FILES_CHKSUM = "file://COPYING;md5=72cfbe4e7bd33a0a1de9630c91195c21 \ |
| 5 | " | 5 | " |
| 6 | 6 | ||
| 7 | inherit features_check autotools pkgconfig useradd systemd | 7 | inherit features_check autotools pkgconfig useradd systemd ptest |
| 8 | 8 | ||
| 9 | DEPENDS = "openssl virtual/libx11 libxfixes libxrandr libpam nasm-native imlib2 pixman libsm" | 9 | DEPENDS = "openssl virtual/libx11 libxfixes libxrandr libpam nasm-native imlib2 pixman libsm" |
| 10 | 10 | ||
| @@ -12,6 +12,7 @@ REQUIRED_DISTRO_FEATURES = "x11 pam" | |||
| 12 | 12 | ||
| 13 | SRC_URI = "https://github.com/neutrinolabs/${BPN}/releases/download/v${PV}/${BPN}-${PV}.tar.gz \ | 13 | SRC_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-arch-Define-NO_NEED_ALIGN-on-ppc64.patch \ | 17 | file://0001-arch-Define-NO_NEED_ALIGN-on-ppc64.patch \ |
| 17 | file://0001-mark-count-with-unused-attribute.patch \ | 18 | file://0001-mark-count-with-unused-attribute.patch \ |
| @@ -25,8 +26,9 @@ UPSTREAM_CHECK_REGEX = "releases/tag/v(?P<pver>\d+(\.\d+)+)" | |||
| 25 | 26 | ||
| 26 | CFLAGS += " -Wno-deprecated-declarations" | 27 | CFLAGS += " -Wno-deprecated-declarations" |
| 27 | 28 | ||
| 28 | PACKAGECONFIG ??= "fuse" | 29 | PACKAGECONFIG ??= "fuse ${@bb.utils.contains('PTEST_ENABLED', '1', 'test', '', d)}" |
| 29 | PACKAGECONFIG[fuse] = " --enable-fuse, --disable-fuse, fuse3" | 30 | PACKAGECONFIG[fuse] = " --enable-fuse, --disable-fuse, fuse3" |
| 31 | PACKAGECONFIG[test] = " --enable-tests, , libcheck cmocka" | ||
| 30 | 32 | ||
| 31 | USERADD_PACKAGES = "${PN}" | 33 | USERADD_PACKAGES = "${PN}" |
| 32 | GROUPADD_PARAM:${PN} = "--system xrdp" | 34 | GROUPADD_PARAM:${PN} = "--system xrdp" |
| @@ -77,6 +79,37 @@ do_install:append() { | |||
| 77 | chown xrdp:xrdp ${D}${sysconfdir}/xrdp | 79 | chown xrdp:xrdp ${D}${sysconfdir}/xrdp |
| 78 | } | 80 | } |
| 79 | 81 | ||
| 82 | do_compile_ptest() { | ||
| 83 | for testdir in $(find ./tests -type d -mindepth 1); do | ||
| 84 | cd $testdir | ||
| 85 | echo 'buildtest-TESTS: $(check_PROGRAMS)' >> Makefile | ||
| 86 | # change the test-data folder to ./data instead of ${S} | ||
| 87 | sed -i 's|-D TOP_SRCDIR=[^ ]*|-D TOP_SRCDIR=\\"./data\\"|' Makefile | ||
| 88 | # another test data folder redirection | ||
| 89 | sed -i 's|-D IMAGEDIR=[^ ]*|-D IMAGEDIR=\\"./data\\"|' Makefile | ||
| 90 | # and another | ||
| 91 | sed -i 's|-DXRDP_TOP_SRCDIR=[^ ]*|-DXRDP_TOP_SRCDIR=\\"..\\"|' Makefile | ||
| 92 | oe_runmake buildtest-TESTS | ||
| 93 | cd - | ||
| 94 | done | ||
| 95 | } | ||
| 96 | |||
| 97 | do_install_ptest() { | ||
| 98 | install -d ${D}${PTEST_PATH}/tests/xrdp/gfx | ||
| 99 | install -d ${D}${PTEST_PATH}/tests/data/xrdp | ||
| 100 | for testbin in $(find ./tests -type f -executable -mindepth 3); do | ||
| 101 | install $testbin ${D}${PTEST_PATH}/tests/ | ||
| 102 | done | ||
| 103 | install -m 666 ${S}/xrdp/xrdp256.bmp ${D}${PTEST_PATH}/tests/data/xrdp/ | ||
| 104 | install -m 666 ${S}/xrdp/ad256.bmp ${D}${PTEST_PATH}/tests/data/xrdp/ | ||
| 105 | install -m 666 ${S}/tests/xrdp/*.bmp ${D}${PTEST_PATH}/tests/data/ | ||
| 106 | install -m 666 ${S}/tests/xrdp/test1.jpg ${D}${PTEST_PATH}/tests/data/ | ||
| 107 | install -m 666 ${S}/tests/xrdp/test_alpha_blend.png ${D}${PTEST_PATH}/tests/data/ | ||
| 108 | install -m 666 ${S}/tests/xrdp/gfx/* ${D}${PTEST_PATH}/tests/xrdp/gfx/ | ||
| 109 | } | ||
| 110 | |||
| 111 | RDEPENDS:${PN}-ptest += "imlib2-loaders" | ||
| 112 | |||
| 80 | SYSTEMD_SERVICE:${PN} = "xrdp.service xrdp-sesman.service" | 113 | SYSTEMD_SERVICE:${PN} = "xrdp.service xrdp-sesman.service" |
| 81 | 114 | ||
| 82 | pkg_postinst:${PN}() { | 115 | pkg_postinst:${PN}() { |
