All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bastien Curutchet via buildroot <buildroot@buildroot.org>
To: buildroot@buildroot.org
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	 Fiona Klute <fiona.klute@gmx.de>,
	 Bastien Curutchet <bastien.curutchet@bootlin.com>
Subject: [Buildroot] [PATCH v3 2/2] support/testing: add rasdaemon tests
Date: Mon, 01 Dec 2025 15:08:54 +0100	[thread overview]
Message-ID: <20251201-rasdaemon-v3-2-8ad394bdc372@bootlin.com> (raw)
In-Reply-To: <20251201-rasdaemon-v3-0-8ad394bdc372@bootlin.com>

Rasdaemon was added in previous patch.

Add a test_rasdaemon that allows to test it.
Test is done on x86. It first checks the daemon's version, then mounts
debugfs and finally ensures that the init script allows to
start/restart/stop the daemon.

Signed-off-by: Bastien Curutchet <bastien.curutchet@bootlin.com>
---
 DEVELOPERS                                         |  1 +
 support/testing/tests/package/test_rasdaemon.py    | 46 ++++++++++++++++++++++
 .../package/test_rasdaemon/linux-debugfs.fragment  |  8 ++++
 3 files changed, 55 insertions(+)

diff --git a/DEVELOPERS b/DEVELOPERS
index b1ead6d26c4e8ff160bcc7ed85b0945ac5e551dc..c9aaa8c9c8aa3d54c930476d9d450e7f990d9aac 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -343,6 +343,7 @@ F:	package/uhubctl/
 
 N:	Bastien Curutchet <bastien.curutchet@bootlin.com>
 F:	package/rasdaemon/
+F:	support/testing/tests/package/test_rasdaemon.py
 
 N:	Baxiche Su <baxiche@gmail.com>
 F:	package/qt6/qt6multimedia/
diff --git a/support/testing/tests/package/test_rasdaemon.py b/support/testing/tests/package/test_rasdaemon.py
new file mode 100644
index 0000000000000000000000000000000000000000..bc800b6ccbea1c18f4c970d87bea0395c64ad952
--- /dev/null
+++ b/support/testing/tests/package/test_rasdaemon.py
@@ -0,0 +1,46 @@
+import os
+
+import infra.basetest
+
+
+class TestRasdaemon(infra.basetest.BRTest):
+    config = f"""
+        BR2_x86_64=y
+        BR2_x86_corei7=y
+        BR2_INIT_SYSV=y
+        BR2_LINUX_KERNEL=y
+        BR2_TOOLCHAIN_EXTERNAL=y
+        BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+        BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.59"
+        BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
+        BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/x86/linux.config"
+        BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="{infra.filepath("tests/package/test_rasdaemon/linux-debugfs.fragment")}"
+        BR2_PACKAGE_RASDAEMON=y
+        BR2_PACKAGE_RASDAEMON_AER=y
+        BR2_PACKAGE_LIBTRACEEVENT=y
+        BR2_PACKAGE_SQLITE=y
+        BR2_PACKAGE_PCIUTILS=y
+        BR2_TARGET_ROOTFS_CPIO=y
+        # BR2_TARGET_ROOTFS_TAR is not set
+        """
+
+    def test_run(self):
+        kernel = os.path.join(self.builddir, "images", "bzImage")
+        cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio")
+        self.emulator.boot(
+                arch="x86_64",
+                kernel=kernel,
+                kernel_cmdline=["console=ttyS0"],
+                options=["-cpu", "Nehalem",  "-initrd", cpio_file],
+        )
+        self.emulator.login()
+
+        self.assertRunOk("/usr/sbin/rasdaemon --version")
+        self.assertRunOk("mount -t debugfs nodev /sys/kernel/debug")
+        self.assertRunOk("/etc/init.d/S95rasdaemon start")
+        self.assertRunOk("pidof /usr/sbin/rasdaemon")
+        self.assertRunOk("/etc/init.d/S95rasdaemon restart")
+        self.assertRunOk("pidof /usr/sbin/rasdaemon")
+        self.assertRunOk("/etc/init.d/S95rasdaemon stop")
+        _, ret = self.emulator.run("pidof /usr/sbin/rasdaemon")
+        self.assertNotEqual(ret, 0)
diff --git a/support/testing/tests/package/test_rasdaemon/linux-debugfs.fragment b/support/testing/tests/package/test_rasdaemon/linux-debugfs.fragment
new file mode 100644
index 0000000000000000000000000000000000000000..a334bc373179623f3c5b2c3727ee7738a0c2542e
--- /dev/null
+++ b/support/testing/tests/package/test_rasdaemon/linux-debugfs.fragment
@@ -0,0 +1,8 @@
+CONFIG_DEBUG_FS=y
+CONFIG_FTRACE=y
+CONFIG_USER_EVENTS=y
+CONFIG_TRACE_EVENT_INJECT=y
+CONFIG_PCI=y
+CONFIG_PCIEPORTBUS=y
+CONFIG_PCIEAER=y
+CONFIG_MEMORY_FAILURE=y

-- 
2.51.1

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

      parent reply	other threads:[~2025-12-01 14:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-01 14:08 [Buildroot] [PATCH v3 0/2] package: add rasdaemon support Bastien Curutchet via buildroot
2025-12-01 14:08 ` [Buildroot] [PATCH v3 1/2] package/rasdaemon: Add rasdaemon package Bastien Curutchet via buildroot
2025-12-01 16:26   ` Fiona Klute via buildroot
2025-12-13 22:11   ` Julien Olivain via buildroot
2025-12-17 15:30     ` Bastien Curutchet via buildroot
2025-12-17 16:28       ` Thomas Petazzoni via buildroot
2025-12-01 14:08 ` Bastien Curutchet via buildroot [this message]

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=20251201-rasdaemon-v3-2-8ad394bdc372@bootlin.com \
    --to=buildroot@buildroot.org \
    --cc=bastien.curutchet@bootlin.com \
    --cc=fiona.klute@gmx.de \
    --cc=thomas.petazzoni@bootlin.com \
    /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.