All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] avahi: add ptest
@ 2018-11-08  9:36 Stefan Strogin
  2018-11-09 13:29 ` Burton, Ross
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Strogin @ 2018-11-08  9:36 UTC (permalink / raw)
  To: openembedded-core; +Cc: xe-linux-external

Signed-off-by: Stefan Strogin <sstrogin@cisco.com>
---
 meta/recipes-connectivity/avahi/avahi.inc       | 15 ++++++++++++++-
 meta/recipes-connectivity/avahi/avahi_0.7.bb    |  1 +
 meta/recipes-connectivity/avahi/files/run-ptest | 13 +++++++++++++
 3 files changed, 28 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-connectivity/avahi/files/run-ptest

diff --git a/meta/recipes-connectivity/avahi/avahi.inc b/meta/recipes-connectivity/avahi/avahi.inc
index 11846849f0..b354817d4d 100644
--- a/meta/recipes-connectivity/avahi/avahi.inc
+++ b/meta/recipes-connectivity/avahi/avahi.inc
@@ -35,7 +35,7 @@ PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,dbus"
 PACKAGECONFIG[gtk] = "--enable-gtk,--disable-gtk,gtk+"
 PACKAGECONFIG[gtk3] = "--enable-gtk3,--disable-gtk3,gtk+3"
 
-inherit autotools pkgconfig gettext gobject-introspection
+inherit autotools pkgconfig gettext gobject-introspection ptest
 
 EXTRA_OECONF = "--with-avahi-priv-access-group=adm \
              --disable-stack-protector \
@@ -49,11 +49,13 @@ EXTRA_OECONF = "--with-avahi-priv-access-group=adm \
              --enable-manpages \
              ${EXTRA_OECONF_SYSVINIT} \
              ${EXTRA_OECONF_SYSTEMD} \
+             ${EXTRA_OECONF_PTEST} \
            "
 
 # The distro choice determines what init scripts are installed
 EXTRA_OECONF_SYSVINIT = "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','--with-distro=debian','--with-distro=none',d)}"
 EXTRA_OECONF_SYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES','systemd','--with-systemdsystemunitdir=${systemd_unitdir}/system/','--without-systemdsystemunitdir',d)}"
+EXTRA_OECONF_PTEST = "${@bb.utils.contains('PTEST_ENABLED','1','--enable-tests','',d)}"
 
 do_configure_prepend() {
     sed 's:AM_CHECK_PYMOD:echo "no pymod" #AM_CHECK_PYMOD:g' -i ${S}/configure.ac
@@ -66,6 +68,7 @@ do_compile_prepend() {
     export GIR_EXTRA_LIBS_PATH="${B}/avahi-gobject/.libs:${B}/avahi-common/.libs:${B}/avahi-client/.libs:${B}/avahi-glib/.libs"
 }
 
+RDEPENDS_${PN}-ptest = "bash"
 RRECOMMENDS_${PN}_append_libc-glibc = " libnss-mdns"
 
 do_install() {
@@ -75,3 +78,13 @@ do_install() {
 	test -d ${D}${datadir}/dbus-1 && rmdir --ignore-fail-on-non-empty ${D}${datadir}/dbus-1
 	rm -rf ${D}${libdir}/avahi
 }
+
+do_install_ptest () {
+    install -d ${D}${PTEST_PATH}/test/.libs
+    for t in dns-spin-test dns-test hashmap-test
+    do
+        install -m 0755 ${B}/avahi-core/$t ${D}${PTEST_PATH}/test/
+        sed -e 's/^relink_command=\"\(.*\)\"/relink_command=\"\"/' -i ${D}${PTEST_PATH}/test/$t
+        install -m 0755 ${B}/avahi-core/.libs/$t ${D}${PTEST_PATH}/test/.libs/lt-$t
+    done
+}
diff --git a/meta/recipes-connectivity/avahi/avahi_0.7.bb b/meta/recipes-connectivity/avahi/avahi_0.7.bb
index 3d5f334a88..6e7767a27b 100644
--- a/meta/recipes-connectivity/avahi/avahi_0.7.bb
+++ b/meta/recipes-connectivity/avahi/avahi_0.7.bb
@@ -4,6 +4,7 @@ SRC_URI += "file://00avahi-autoipd \
            file://99avahi-autoipd \
            file://initscript.patch \
            file://0001-Fix-opening-etc-resolv.conf-error.patch \
+           file://run-ptest \
            "
 
 inherit update-rc.d systemd useradd
diff --git a/meta/recipes-connectivity/avahi/files/run-ptest b/meta/recipes-connectivity/avahi/files/run-ptest
new file mode 100644
index 0000000000..8b4875d5fd
--- /dev/null
+++ b/meta/recipes-connectivity/avahi/files/run-ptest
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+cd ./test
+for t in *
+do
+	./$t
+	if [ $? -eq 0 ]
+	then
+		echo "PASS: $t"
+	else
+		echo "FAIL: $t"
+	fi
+done
-- 
2.19.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] avahi: add ptest
  2018-11-08  9:36 [PATCH] avahi: add ptest Stefan Strogin
@ 2018-11-09 13:29 ` Burton, Ross
  2018-11-09 18:23   ` Stefan Strogin
  0 siblings, 1 reply; 3+ messages in thread
From: Burton, Ross @ 2018-11-09 13:29 UTC (permalink / raw)
  To: Stefan Strogin; +Cc: XE-Linux, OE-core

On Thu, 8 Nov 2018 at 09:44, Stefan Strogin via Openembedded-core
<openembedded-core@lists.openembedded.org> wrote:
> +do_install_ptest () {
> +    install -d ${D}${PTEST_PATH}/test/.libs
> +    for t in dns-spin-test dns-test hashmap-test
> +    do
> +        install -m 0755 ${B}/avahi-core/$t ${D}${PTEST_PATH}/test/
> +        sed -e 's/^relink_command=\"\(.*\)\"/relink_command=\"\"/' -i ${D}${PTEST_PATH}/test/$t
> +        install -m 0755 ${B}/avahi-core/.libs/$t ${D}${PTEST_PATH}/test/.libs/lt-$t
> +    done
> +}

Whilst I really do want to see more test suites, is this really a
useful test suite?  hashmap-test is a validation that the hash
implementation works, dns-test is low-level parsing, and dns-spin-test
is basically a way to verify an Avahi bug doesn't regress.  This isn't
exactly a full-featured test suite that creates services, ensures
they're browsable, enumerate stuff, etc.

Ross


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] avahi: add ptest
  2018-11-09 13:29 ` Burton, Ross
@ 2018-11-09 18:23   ` Stefan Strogin
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Strogin @ 2018-11-09 18:23 UTC (permalink / raw)
  To: Burton, Ross; +Cc: XE-Linux, OE-core

Hi Ross,

On 09/11/2018 15:29, Burton, Ross wrote:
> On Thu, 8 Nov 2018 at 09:44, Stefan Strogin via Openembedded-core
> <openembedded-core@lists.openembedded.org> wrote:
>> +do_install_ptest () {
>> +    install -d ${D}${PTEST_PATH}/test/.libs
>> +    for t in dns-spin-test dns-test hashmap-test
>> +    do
>> +        install -m 0755 ${B}/avahi-core/$t ${D}${PTEST_PATH}/test/
>> +        sed -e 's/^relink_command=\"\(.*\)\"/relink_command=\"\"/' -i ${D}${PTEST_PATH}/test/$t
>> +        install -m 0755 ${B}/avahi-core/.libs/$t ${D}${PTEST_PATH}/test/.libs/lt-$t
>> +    done
>> +}
> 
> Whilst I really do want to see more test suites, is this really a
> useful test suite?  hashmap-test is a validation that the hash
> implementation works, dns-test is low-level parsing, and dns-spin-test
> is basically a way to verify an Avahi bug doesn't regress.  This isn't
> exactly a full-featured test suite that creates services, ensures
> they're browsable, enumerate stuff, etc.

Thanks for the good comment. In our distro we also want to cover with tests
as many packages as possible. There are more tests in avahi source code like
avahi-test, conformance-test, querier-test, update-test...

Unfortunately the test suite is not documented at all (at least I couldn't
find any documentation on them), and I'm not very familiar with Avahi API
and the source code.
Some of the tests in case of success seem to run in an infinite loop, and exit
only in case of error. So I couldn't include them into the recipe. Maybe the
tests need to be patched [upstream].
I began to investigate it but unfortunately didn't have time, and now I have
some more urgent tasks. So I added only those tests in which I'm sure, perhaps
it's too few.
I hope to add more tests some day, or somebody else will be able to do it.

--
Stefan


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-11-09 18:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-08  9:36 [PATCH] avahi: add ptest Stefan Strogin
2018-11-09 13:29 ` Burton, Ross
2018-11-09 18:23   ` Stefan Strogin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.