public inbox for buildroot@busybox.net
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] support/testing: test_connman: new runtime test
@ 2026-02-23 21:43 Julien Olivain via buildroot
  2026-03-12 18:37 ` Julien Olivain via buildroot
  2026-03-20 15:55 ` Thomas Perale via buildroot
  0 siblings, 2 replies; 3+ messages in thread
From: Julien Olivain via buildroot @ 2026-02-23 21:43 UTC (permalink / raw)
  To: buildroot; +Cc: Julien Olivain

Signed-off-by: Julien Olivain <ju.o@free.fr>
---
 DEVELOPERS                                    |  1 +
 support/testing/tests/package/test_connman.py | 57 +++++++++++++++++++
 2 files changed, 58 insertions(+)
 create mode 100644 support/testing/tests/package/test_connman.py

diff --git a/DEVELOPERS b/DEVELOPERS
index 9e983ae113..63d1517652 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1874,6 +1874,7 @@ F:	support/testing/tests/package/test_btrfs_progs.py
 F:	support/testing/tests/package/test_btrfs_progs/
 F:	support/testing/tests/package/test_bzip2.py
 F:	support/testing/tests/package/test_compressor_base.py
+F:	support/testing/tests/package/test_connman.py
 F:	support/testing/tests/package/test_coremark.py
 F:	support/testing/tests/package/test_cryptsetup.py
 F:	support/testing/tests/package/test_cryptsetup/
diff --git a/support/testing/tests/package/test_connman.py b/support/testing/tests/package/test_connman.py
new file mode 100644
index 0000000000..6fef95104c
--- /dev/null
+++ b/support/testing/tests/package/test_connman.py
@@ -0,0 +1,57 @@
+import os
+
+import infra.basetest
+
+
+class TestConnMan(infra.basetest.BRTest):
+    config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
+        """
+        BR2_PACKAGE_CONNMAN=y
+        BR2_PACKAGE_CONNMAN_CLIENT=y
+        BR2_TARGET_ROOTFS_CPIO=y
+        # BR2_TARGET_ROOTFS_TAR is not set
+        """
+
+    def test_run(self):
+        cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio")
+        self.emulator.boot(arch="armv7",
+                           kernel="builtin",
+                           options=["-initrd", cpio_file])
+        self.emulator.login()
+
+        # We check the program can execute.
+        self.assertRunOk("connmand --version")
+
+        # We query the connman state and expect it to be ready.
+        out, ret = self.emulator.run("connmanctl state")
+        out_str = "\n".join(out)
+        self.assertEqual(ret, 0)
+        self.assertIn("State = ready", out_str)
+
+        # We list the technologies and expect to see at least Ethernet
+        # because the emulator has one interface.
+        out, ret = self.emulator.run("connmanctl technologies")
+        out_str = "\n".join(out)
+        self.assertEqual(ret, 0)
+        self.assertIn("Type = ethernet", out_str)
+
+        # We ping the qemu user networking gateway. The startup
+        # scripts should have brought up the interface, so the ping
+        # is expected to succeed.
+        ping_cmd = "ping -c 3 -i 0.2 -W 2 10.0.2.2"
+        self.assertRunOk(ping_cmd)
+
+        # Now, we ask connman to disable Ethernet. It should stop the
+        # interface.
+        self.assertRunOk("connmanctl disable ethernet")
+
+        # If we try to ping again the qemu gateway,
+        # it should now fail.
+        _, ret = self.emulator.run(ping_cmd)
+        self.assertNotEqual(ret, 0)
+
+        # We ask connman to re-enable Ethernet.
+        self.assertRunOk("connmanctl enable ethernet")
+
+        # We should be able to ping the qemu gateway again.
+        self.assertRunOk(ping_cmd)
-- 
2.53.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2026-03-20 15:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-23 21:43 [Buildroot] [PATCH 1/1] support/testing: test_connman: new runtime test Julien Olivain via buildroot
2026-03-12 18:37 ` Julien Olivain via buildroot
2026-03-20 15:55 ` Thomas Perale via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox