summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xmeta-networking/recipes-daemons/lldpd/files/run-ptest16
-rw-r--r--meta-networking/recipes-daemons/lldpd/lldpd_1.0.15.bb20
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
3num_fail=0
4
5for test in tests/check*
6do
7 ./"$test" \
8 && echo "PASS: $test" \
9 || {
10 echo "FAIL: $test"
11 num_fail=$(( ${num_fail} + 1))
12 }
13
14done
15
16exit $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
14SRC_URI[sha256sum] = "f7fe3a130be98a19c491479ef60f36b8ee41a9e6bc4d7f2c41033f63956a3126" 15SRC_URI[sha256sum] = "f7fe3a130be98a19c491479ef60f36b8ee41a9e6bc4d7f2c41033f63956a3126"
15 16
16inherit autotools update-rc.d useradd systemd pkgconfig bash-completion github-releases 17inherit autotools update-rc.d useradd systemd pkgconfig bash-completion github-releases ptest
17 18
18USERADD_PACKAGES = "${PN}" 19USERADD_PACKAGES = "${PN}"
19USERADD_PARAM:${PN} = "--system -g lldpd --shell /bin/false lldpd" 20USERADD_PARAM:${PN} = "--system -g lldpd --shell /bin/false lldpd"
@@ -61,3 +62,20 @@ RDEPENDS:${PN} += "os-release"
61FILES:${PN}-zsh-completion += "${datadir}/zsh/" 62FILES:${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
66RDEPENDS:${PN}-ptest = "libcheck"
67DEPENDS += "${@bb.utils.contains('PTEST_ENABLED', '1', 'libcheck', '', d)}"
68
69TESTDIR = "tests"
70do_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
76do_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}