All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] support/testing: add mosquitto runtime test
@ 2024-06-01 23:03 Julien Olivain
  2024-07-12 14:38 ` Thomas Petazzoni via buildroot
  2024-08-01 11:03 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: Julien Olivain @ 2024-06-01 23:03 UTC (permalink / raw)
  To: buildroot; +Cc: Julien Olivain

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

diff --git a/DEVELOPERS b/DEVELOPERS
index b9568ed7c58..5ca0662ab65 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1861,6 +1861,7 @@ F:	support/testing/tests/package/test_mdadm.py
 F:	support/testing/tests/package/test_mdadm/
 F:	support/testing/tests/package/test_micropython.py
 F:	support/testing/tests/package/test_micropython/
+F:	support/testing/tests/package/test_mosquitto.py
 F:	support/testing/tests/package/test_mtools.py
 F:	support/testing/tests/package/test_mtr.py
 F:	support/testing/tests/package/test_ncdu.py
diff --git a/support/testing/tests/package/test_mosquitto.py b/support/testing/tests/package/test_mosquitto.py
new file mode 100644
index 00000000000..ba10b30b00b
--- /dev/null
+++ b/support/testing/tests/package/test_mosquitto.py
@@ -0,0 +1,38 @@
+import os
+import time
+
+import infra.basetest
+
+
+class TestMosquitto(infra.basetest.BRTest):
+    config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
+        """
+        BR2_PACKAGE_MOSQUITTO=y
+        BR2_PACKAGE_MOSQUITTO_BROKER=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="armv5",
+                           kernel="builtin",
+                           options=["-initrd", cpio_file])
+        self.emulator.login()
+
+        topic = "br-test-topic"
+        log = "mqtt.log"
+        msg = "Hello Buildroot!"
+
+        # We subscribe to a topic and write one message to a log file.
+        self.assertRunOk(f"mosquitto_sub -t {topic} -C 1 > {log} &")
+
+        time.sleep(1)
+
+        # We publish a message.
+        self.assertRunOk(f"mosquitto_pub -t {topic} -m '{msg}'")
+
+        # We check the log file contains our message.
+        out, ret = self.emulator.run(f"cat {log}")
+        self.assertEqual(ret, 0)
+        self.assertEqual(out[0], msg)
-- 
2.45.1

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

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

* Re: [Buildroot] [PATCH 1/1] support/testing: add mosquitto runtime test
  2024-06-01 23:03 [Buildroot] [PATCH 1/1] support/testing: add mosquitto runtime test Julien Olivain
@ 2024-07-12 14:38 ` Thomas Petazzoni via buildroot
  2024-08-01 11:03 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-07-12 14:38 UTC (permalink / raw)
  To: Julien Olivain; +Cc: buildroot

On Sun,  2 Jun 2024 01:03:40 +0200
Julien Olivain <ju.o@free.fr> wrote:

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

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/1] support/testing: add mosquitto runtime test
  2024-06-01 23:03 [Buildroot] [PATCH 1/1] support/testing: add mosquitto runtime test Julien Olivain
  2024-07-12 14:38 ` Thomas Petazzoni via buildroot
@ 2024-08-01 11:03 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2024-08-01 11:03 UTC (permalink / raw)
  To: Julien Olivain; +Cc: buildroot

>>>>> "Julien" == Julien Olivain <ju.o@free.fr> writes:

 > Signed-off-by: Julien Olivain <ju.o@free.fr>

Committed to 2024.02.x and 2024.05.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2024-08-01 11:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-01 23:03 [Buildroot] [PATCH 1/1] support/testing: add mosquitto runtime test Julien Olivain
2024-07-12 14:38 ` Thomas Petazzoni via buildroot
2024-08-01 11:03 ` Peter Korsgaard

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.