[Buildroot] [git commit branch/2025.02.x] support/testing: mdnsd: new runtime test

Thomas Perale via buildroot <[email protected]>
Newsgroups net.busybox.buildroot
Message-ID <[email protected]>
commit: https://gitlab.com/buildroot.org/buildroot/-/commit/fbebe4a705d110482738b0e18ed28ca8849f39b4
branch: https://gitlab.com/buildroot.org/buildroot/-/tree/2025.02.x

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]>
[Julien: add "mdnsd -v" invocation to show version]
Signed-off-by: Julien Olivain <[email protected]>
(cherry picked from commit 4cd5559163131e105b837d80389292e1bb6d0fc7)
[Thomas: remove last test that requires v1.1]
Signed-off-by: Thomas Perale <[email protected]>
---
 DEVELOPERS                                  |  1 +
 support/testing/tests/package/test_mdnsd.py | 31 +++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/DEVELOPERS b/DEVELOPERS
index 110338753e..3a3b42a00f 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1605,6 +1605,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..ecc93ab6f8
--- /dev/null
+++ b/support/testing/tests/package/test_mdnsd.py
@@ -0,0 +1,31 @@
+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()
+
+        # We check the program can execute.
+        self.assertRunOk("mdnsd -v")
+
+        # 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")
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.