diff mbox series

[1/1] support/testing: add mtr runtime test

Message ID 20240110210638.213739-1-ju.o@free.fr
State Accepted
Headers show
Series [1/1] support/testing: add mtr runtime test | expand

Commit Message

Julien Olivain Jan. 10, 2024, 9:06 p.m. UTC
Signed-off-by: Julien Olivain <ju.o@free.fr>
---
 DEVELOPERS                                |  1 +
 support/testing/tests/package/test_mtr.py | 22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+)
 create mode 100644 support/testing/tests/package/test_mtr.py

Comments

Yann E. MORIN Jan. 21, 2024, 10:19 a.m. UTC | #1
Julien, All,

On 2024-01-10 22:06 +0100, Julien Olivain spake thusly:
> Signed-off-by: Julien Olivain <ju.o@free.fr>

Applied to master, thanks.

Regards,
Yann E. MORIN.

> ---
>  DEVELOPERS                                |  1 +
>  support/testing/tests/package/test_mtr.py | 22 ++++++++++++++++++++++
>  2 files changed, 23 insertions(+)
>  create mode 100644 support/testing/tests/package/test_mtr.py
> 
> diff --git a/DEVELOPERS b/DEVELOPERS
> index d7543247f2..79152b28ae 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -1789,6 +1789,7 @@ F:	support/testing/tests/package/test_lsof.py
>  F:	support/testing/tests/package/test_lz4.py
>  F:	support/testing/tests/package/test_lzop.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
>  F:	support/testing/tests/package/test_nftables.py
>  F:	support/testing/tests/package/test_nftables/
> diff --git a/support/testing/tests/package/test_mtr.py b/support/testing/tests/package/test_mtr.py
> new file mode 100644
> index 0000000000..d78b33a31a
> --- /dev/null
> +++ b/support/testing/tests/package/test_mtr.py
> @@ -0,0 +1,22 @@
> +import os
> +
> +import infra.basetest
> +
> +
> +class TestMtr(infra.basetest.BRTest):
> +    config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
> +        """
> +        BR2_PACKAGE_MTR=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()
> +
> +        self.assertRunOk("mtr --version")
> +        self.assertRunOk("mtr -r -c 5 127.0.0.1", timeout=30)
> -- 
> 2.43.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
diff mbox series

Patch

diff --git a/DEVELOPERS b/DEVELOPERS
index d7543247f2..79152b28ae 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1789,6 +1789,7 @@  F:	support/testing/tests/package/test_lsof.py
 F:	support/testing/tests/package/test_lz4.py
 F:	support/testing/tests/package/test_lzop.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
 F:	support/testing/tests/package/test_nftables.py
 F:	support/testing/tests/package/test_nftables/
diff --git a/support/testing/tests/package/test_mtr.py b/support/testing/tests/package/test_mtr.py
new file mode 100644
index 0000000000..d78b33a31a
--- /dev/null
+++ b/support/testing/tests/package/test_mtr.py
@@ -0,0 +1,22 @@ 
+import os
+
+import infra.basetest
+
+
+class TestMtr(infra.basetest.BRTest):
+    config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
+        """
+        BR2_PACKAGE_MTR=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()
+
+        self.assertRunOk("mtr --version")
+        self.assertRunOk("mtr -r -c 5 127.0.0.1", timeout=30)