diff options
-rwxr-xr-x | meta-networking/recipes-daemons/lldpd/files/run-ptest | 16 | ||||
-rw-r--r-- | meta-networking/recipes-daemons/lldpd/lldpd_1.0.15.bb | 20 |
2 files changed, 35 insertions, 1 deletions
diff --git a/meta-networking/recipes-daemons/lldpd/files/run-ptest b/meta-networking/recipes-daemons/lldpd/files/run-ptest new file mode 100755 index 000000000..da686eb46 --- /dev/null +++ b/meta-networking/recipes-daemons/lldpd/files/run-ptest | |||
@@ -0,0 +1,16 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | num_fail=0 | ||
4 | |||
5 | for test in tests/check* | ||
6 | do | ||
7 | ./"$test" \ | ||
8 | && echo "PASS: $test" \ | ||
9 | || { | ||
10 | echo "FAIL: $test" | ||
11 | num_fail=$(( ${num_fail} + 1)) | ||
12 | } | ||
13 | |||
14 | done | ||
15 | |||
16 | exit $num_fail | ||
diff --git a/meta-networking/recipes-daemons/lldpd/lldpd_1.0.15.bb b/meta-networking/recipes-daemons/lldpd/lldpd_1.0.15.bb index 6a3687cf7..c7237d74b 100644 --- a/meta-networking/recipes-daemons/lldpd/lldpd_1.0.15.bb +++ b/meta-networking/recipes-daemons/lldpd/lldpd_1.0.15.bb | |||
@@ -9,11 +9,12 @@ SRC_URI = "\ | |||
9 | http://media.luffy.cx/files/${BPN}/${BPN}-${PV}.tar.gz \ | 9 | http://media.luffy.cx/files/${BPN}/${BPN}-${PV}.tar.gz \ |
10 | file://lldpd.init.d \ | 10 | file://lldpd.init.d \ |
11 | file://lldpd.default \ | 11 | file://lldpd.default \ |
12 | file://run-ptest \ | ||
12 | " | 13 | " |
13 | 14 | ||
14 | SRC_URI[sha256sum] = "f7fe3a130be98a19c491479ef60f36b8ee41a9e6bc4d7f2c41033f63956a3126" | 15 | SRC_URI[sha256sum] = "f7fe3a130be98a19c491479ef60f36b8ee41a9e6bc4d7f2c41033f63956a3126" |
15 | 16 | ||
16 | inherit autotools update-rc.d useradd systemd pkgconfig bash-completion github-releases | 17 | inherit autotools update-rc.d useradd systemd pkgconfig bash-completion github-releases ptest |
17 | 18 | ||
18 | USERADD_PACKAGES = "${PN}" | 19 | USERADD_PACKAGES = "${PN}" |
19 | USERADD_PARAM:${PN} = "--system -g lldpd --shell /bin/false lldpd" | 20 | USERADD_PARAM:${PN} = "--system -g lldpd --shell /bin/false lldpd" |
@@ -61,3 +62,20 @@ RDEPENDS:${PN} += "os-release" | |||
61 | FILES:${PN}-zsh-completion += "${datadir}/zsh/" | 62 | FILES:${PN}-zsh-completion += "${datadir}/zsh/" |
62 | # FIXME: zsh is broken in meta-oe so this cannot be enabled for now | 63 | # FIXME: zsh is broken in meta-oe so this cannot be enabled for now |
63 | #RDEPENDS:${PN}-zsh-completion += "zsh" | 64 | #RDEPENDS:${PN}-zsh-completion += "zsh" |
65 | |||
66 | RDEPENDS:${PN}-ptest = "libcheck" | ||
67 | DEPENDS += "${@bb.utils.contains('PTEST_ENABLED', '1', 'libcheck', '', d)}" | ||
68 | |||
69 | TESTDIR = "tests" | ||
70 | do_compile_ptest () { | ||
71 | # hack to remove the call to `make check-TESTS` | ||
72 | sed -i 's/$(MAKE) $(AM_MAKEFLAGS) check-TESTS//g' ${TESTDIR}/Makefile | ||
73 | oe_runmake check | ||
74 | } | ||
75 | |||
76 | do_install_ptest () { | ||
77 | # install the tests | ||
78 | cp -rf ${B}/${TESTDIR} ${D}${PTEST_PATH} | ||
79 | # remove the object files | ||
80 | rm ${D}${PTEST_PATH}/${TESTDIR}/*.o | ||
81 | } | ||