All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Devoogdt <thomas@devoogdt.com>
To: thomas@devoogdt.com
Cc: buildroot@buildroot.org
Subject: [Buildroot] [PATCH v2 3/3] support/testing/tests/package/test_fluent_bit.py: new runtime test
Date: Sun,  8 Mar 2026 09:12:12 +0100	[thread overview]
Message-ID: <20260308081212.777547-3-thomas@devoogdt.com> (raw)
In-Reply-To: <20260308081212.777547-1-thomas@devoogdt.com>

Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com>
---
v2: no change
---
 DEVELOPERS                                    |  1 +
 .../testing/tests/package/test_fluent_bit.py  | 46 +++++++++++++++++++
 2 files changed, 47 insertions(+)
 create mode 100644 support/testing/tests/package/test_fluent_bit.py

diff --git a/DEVELOPERS b/DEVELOPERS
index f7c5b077067..dcd25eba388 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -3197,6 +3197,7 @@ F:	package/fluent-bit/
 F:	package/librdkafka/
 F:	package/libsoup3/
 F:	package/yq/
+F:	support/testing/tests/package/test_fluent_bit.py
 
 N:	Thomas Huth <th.huth+br@posteo.eu>
 F:	package/ascii-invaders/
diff --git a/support/testing/tests/package/test_fluent_bit.py b/support/testing/tests/package/test_fluent_bit.py
new file mode 100644
index 00000000000..825e4ec6d2d
--- /dev/null
+++ b/support/testing/tests/package/test_fluent_bit.py
@@ -0,0 +1,46 @@
+import os
+import json
+import time
+
+import infra.basetest
+
+
+class TestFluentBit(infra.basetest.BRTest):
+    config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
+        """
+        BR2_TARGET_ROOTFS_CPIO=y
+        # BR2_TARGET_ROOTFS_TAR is not set
+        BR2_PACKAGE_FLUENT_BIT=y
+        """
+
+    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()
+
+        # Enable the http server
+        cmd = ("sed -i 's/http_server  Off/http_server  On/g' "
+               "/etc/fluent-bit/fluent-bit.conf && "
+               "/etc/init.d/S99fluent-bit restart")
+        _, exit_code = self.emulator.run(cmd)
+        self.assertEqual(exit_code, 0)
+
+        # Give some runtime
+        time.sleep(5)
+
+        # Check the uptime
+        cmd = "wget -qO- http://127.0.0.1:2020/api/v1/uptime"
+        output, exit_code = self.emulator.run(cmd)
+        self.assertEqual(exit_code, 0)
+        uptime = json.loads(output[0])
+        self.assertGreater(uptime["uptime_sec"], 3)
+
+        # Check the metrics
+        cmd = "wget -qO- http://127.0.0.1:2020/api/v1/metrics"
+        output, exit_code = self.emulator.run(cmd)
+        self.assertEqual(exit_code, 0)
+        metrics = json.loads(output[0])
+        self.assertGreater(metrics["input"]["cpu.0"]["records"], 0)
+        self.assertGreater(metrics["output"]["stdout.0"]["proc_records"], 0)
-- 
2.43.0

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

  parent reply	other threads:[~2026-03-08  8:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-19 22:12 [Buildroot] [PATCH v1 1/3] package/librdkafka: add new package Thomas Devoogdt
2026-02-19 22:12 ` [Buildroot] [PATCH v1 2/3] package/fluent-bit: link against the new librdkafka package Thomas Devoogdt
2026-02-19 22:12 ` [Buildroot] [PATCH v1 3/3] support/testing/tests/package/test_fluent_bit.py: new runtime test Thomas Devoogdt
2026-03-08  8:12 ` [Buildroot] [PATCH v2 1/3] package/librdkafka: add new package Thomas Devoogdt
2026-03-08  8:12   ` [Buildroot] [PATCH v2 2/3] package/fluent-bit: link against the new librdkafka package Thomas Devoogdt
2026-03-08  8:12   ` Thomas Devoogdt [this message]
2026-10-22 22:34   ` [Buildroot] [PATCH v2 1/3] package/librdkafka: add new package Thomas Petazzoni via buildroot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260308081212.777547-3-thomas@devoogdt.com \
    --to=thomas@devoogdt.com \
    --cc=buildroot@buildroot.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.