diff mbox series

[v2] oeqa: add runtime 'maturin develop' test case

Message ID 20231217225848.24271-1-tim.orling@konsulko.com
State Accepted, archived
Commit ca7e78c8be6aaa2780702eab54715a74fc0dac5e
Headers show
Series [v2] oeqa: add runtime 'maturin develop' test case | expand

Commit Message

Tim Orling Dec. 17, 2023, 10:58 p.m. UTC
Similar to the sdk test case, build the "guessing-game" example from
https://maturin.rs/tutorial

This test case:
* creates a python3 venv
* echoes "nameserver 8.8.8.8" to /etc/resolv.conf as we need to have
  functional DNS to fetch the crates on target
* fetches crates, builds guessing-game crate and wheel

Put the following in your local.conf:

EXTRA_IMAGE_FEATURES += "tools-sdk"
SDK_INCLUDE_TOOLCHAIN = '1'
SDK_TOOLCHAIN_LANGS += 'rust'

IMAGE_INSTALL:append = " python3-maturin"

IMAGE_CLASSES += "testimage"
TEST_QEMUPARAMS ?= "-m 8192 -smp 4"
IMAGE_ROOTFS_EXTRA_SPACE = "10000000"
NOHDD="1"
NOISO="1"

TEST_SUITES = "ping ssh python maturin"

Test with:

bitbake core-image-full-cmdline
bitbake -c testimage core-image-full-cmdline

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
Changes in v2:
  Clarify that tools-sdk is required in the image, plus
  we need the 'rust' toolchain lang

Tested on qemuarm64 core-image-full-cmdline

 meta/lib/oeqa/runtime/cases/maturin.py | 35 ++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
diff mbox series

Patch

diff --git a/meta/lib/oeqa/runtime/cases/maturin.py b/meta/lib/oeqa/runtime/cases/maturin.py
index b9a3b4acbcd..4e6384fe5e6 100644
--- a/meta/lib/oeqa/runtime/cases/maturin.py
+++ b/meta/lib/oeqa/runtime/cases/maturin.py
@@ -10,6 +10,7 @@  from oeqa.runtime.case import OERuntimeTestCase
 from oeqa.core.decorator.depends import OETestDepends
 from oeqa.runtime.decorator.package import OEHasPackage
 
+
 class MaturinTest(OERuntimeTestCase):
     @OETestDepends(['ssh.SSHTest.test_ssh', 'python.PythonTest.test_python3'])
     @OEHasPackage(['python3-maturin'])
@@ -21,3 +22,37 @@  class MaturinTest(OERuntimeTestCase):
         python_version = "%s.%s" % (py_major, py_minor)
         self.assertEqual(output, "