diff mbox series

[RFC,v2,3/3] support/testing/package: add new test for sysdig

Message ID 20230811152710.43564-4-flaniel@linux.microsoft.com
State Superseded
Headers show
Series Bump sysdig and falco libs | expand

Commit Message

Francis Laniel Aug. 11, 2023, 3:27 p.m. UTC
Signed-off-by: Francis Laniel <flaniel@linux.microsoft.com>
---
 .../testing/tests/package/test_sysdig.config  |  1 +
 support/testing/tests/package/test_sysdig.py  | 46 +++++++++++++++++++
 2 files changed, 47 insertions(+)
 create mode 100644 support/testing/tests/package/test_sysdig.config
 create mode 100644 support/testing/tests/package/test_sysdig.py
diff mbox series

Patch

diff --git a/support/testing/tests/package/test_sysdig.config b/support/testing/tests/package/test_sysdig.config
new file mode 100644
index 0000000000..6450f34933
--- /dev/null
+++ b/support/testing/tests/package/test_sysdig.config
@@ -0,0 +1 @@ 
+CONFIG_IPV6=y
diff --git a/support/testing/tests/package/test_sysdig.py b/support/testing/tests/package/test_sysdig.py
new file mode 100644
index 0000000000..f27114c539
--- /dev/null
+++ b/support/testing/tests/package/test_sysdig.py
@@ -0,0 +1,46 @@ 
+import os
+
+import infra.basetest
+
+
+class TestSysdig(infra.basetest.BRTest):
+    config = \
+        """
+        BR2_arm=y
+        BR2_LINUX_KERNEL=y
+        BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+        BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.1"
+        BR2_LINUX_KERNEL_DEFCONFIG="vexpress"
+        BR2_LINUX_KERNEL_DTS_SUPPORT=y
+        BR2_LINUX_KERNEL_INTREE_DTS_NAME="vexpress-v2p-ca9"
+        BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="{linux_fragment}"
+        BR2_TOOLCHAIN_EXTERNAL=y
+        BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
+        BR2_TOOLCHAIN_EXTERNAL_GLIBC=y
+        BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
+        BR2_TOOLCHAIN_GCC_AT_LEAST_5=y
+        BR2_TOOLCHAIN_HAS_THREADS=y
+        BR2_TOOLCHAIN_HAS_SYNC_4=y
+        BR2_INSTALL_LIBSTDCPP=y
+        BR2_PACKAGE_LUA=y
+        BR2_PACKAGE_LUA_5_1=y
+        BR2_PACKAGE_SYSDIG=y
+        BR2_TARGET_ROOTFS_CPIO=y
+        # BR2_TARGET_ROOTFS_TAR is not set
+        """.format(linux_fragment=infra.filepath("tests/package/test_sysdig.config"))
+
+    def test_run(self):
+        cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio")
+        kernel_file = os.path.join(self.builddir, "images", "zImage")
+        dtb_file = os.path.join(self.builddir, "images", "vexpress-v2p-ca9.dtb")
+        self.emulator.boot(arch="armv7", kernel=kernel_file,
+                           kernel_cmdline=[
+                                        "console=ttyAMA0,115200"],
+                           options=["-initrd", cpio_file,
+                                    "-dtb", dtb_file,
+                                    "-M", "vexpress-a9", "-m", "1024"])
+        self.emulator.login()
+
+        self.assertRunOk("sysdig --version")
+        # Run sysdig for 3 seconds.
+        self.assertRunOk("sysdig -M 3")