Re: [Buildroot] [PATCH 3/3] support/testing: mdnsd: new runtime test
Thomas Perale via buildroot <[email protected]> Fri, 24 Jul 2026 16:14:26 +0200
| Newsgroups | net.busybox.buildroot |
|---|---|
| Message-ID | <[email protected]> |
In reply of: > Boot an armv5 image running the mdnsd responder alongside the mquery > client, then check that service discovery works: mquery browses for the > bundled _http._tcp service and mdnsd, on the same host, answers over the > loopback of the eth0 multicast group. > > Signed-off-by: Joachim Wiberg <[email protected]> Applied to 2026.05.x & 2025.02.x. Thanks > --- > DEVELOPERS | 1 + > support/testing/tests/package/test_mdnsd.py | 38 +++++++++++++++++++++ > 2 files changed, 39 insertions(+) > create mode 100644 support/testing/tests/package/test_mdnsd.py > > diff --git a/DEVELOPERS b/DEVELOPERS > index fdfab8b489..82300c4a18 100644 > --- a/DEVELOPERS > +++ b/DEVELOPERS > @@ -1664,6 +1664,7 @@ F: package/ssdp-responder/ > F: package/sysklogd/ > F: package/uredir/ > F: package/watchdogd/ > +F: support/testing/tests/package/test_mdnsd.py > > N: Jochen Baltes <[email protected]> > F: package/altera-stapl > diff --git a/support/testing/tests/package/test_mdnsd.py b/support/testing/tests/package/test_mdnsd.py > new file mode 100644 > index 0000000000..43057d4351 > --- /dev/null > +++ b/support/testing/tests/package/test_mdnsd.py > @@ -0,0 +1,38 @@ > +import os > + > +import infra.basetest > + > + > +class TestMdnsd(infra.basetest.BRTest): > + config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ > + """ > + BR2_PACKAGE_MDNSD=y > + BR2_PACKAGE_MDNSD_MQUERY=y > + BR2_PACKAGE_MDNSD_HTTP_SERVICE=y > + BR2_SYSTEM_DHCP="eth0" > + BR2_TARGET_ROOTFS_CPIO=y > + # BR2_TARGET_ROOTFS_TAR is not set > + """ > + > + def test_run(self): > + img = os.path.join(self.builddir, "images", "rootfs.cpio") > + self.emulator.boot(arch="armv5", > + kernel="builtin", > + options=["-initrd", img, > + "-net", "nic,model=rtl8139", > + "-net", "user"]) > + self.emulator.login() > + > + # The responder is started at boot by /etc/init.d/S50mdnsd and > + # advertises the bundled _http._tcp service from /etc/mdns.d/. > + self.assertRunOk("pidof mdnsd") > + > + # mdnsd only answers on multicast capable interfaces that are > + # up, so wait for eth0 to get its DHCP address before querying. > + cmd = "while ! ifconfig eth0 | grep -q 'inet addr'; do sleep 1; done" > + self.assertRunOk(cmd, timeout=30) > + > + # mquery sends a multicast query for the advertised service; > + # output is one "+ NAME (IP)" line per instance > + cmd = "mquery -T _http._tcp |grep -F buildroot._http._tcp.local" > + self.assertRunOk(cmd, timeout=30) > -- > 2.43.0 > > _______________________________________________ > buildroot mailing list > [email protected] > https://lists.buildroot.org/mailman/listinfo/buildroot _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot