Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: "Raphaël Mélotte" <raphael.melotte@mind.be>
Cc: Ricardo Martincoski <ricardo.martincoski@gmail.com>,
	buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 1/2] support/testing: use aarch64 for TestPythonPy3Botocore
Date: Wed, 20 Jul 2022 23:50:57 +0200	[thread overview]
Message-ID: <20220720235057.2aba2ffc@windsurf> (raw)
In-Reply-To: <20220615171218.1032413-1-raphael.melotte@mind.be>

Hello Raphaël,

On Wed, 15 Jun 2022 19:12:15 +0200
Raphaël Mélotte <raphael.melotte@mind.be> wrote:

> With new python-botocore versions, the size of the package will
> increase and the 256MiB memory limit from the default versatilepb
> machine will no longer be sufficient to do runtime tests.
> 
> Switch to using an aarch64 machine, and use 512MiB memory.
> 
> The configuration and login method are taken from TestOpenJdk.
> 
> While at it, add the python-botocore test files to the DEVELOPERS
> file.
> 
> Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>

Thanks a lot for the proposal. I understand the need for more memory,
but I'm wondering if building a full aarch64 kernel just for this is
really the right solution.

What about instead trying to pass a custom option to Qemu?

support/testing/infra/emulator.py goes like this:

    def boot(self, arch, kernel=None, kernel_cmdline=None, options=None):
        if arch in ["armv7", "armv5"]:
            qemu_arch = "arm"
        else:
            qemu_arch = arch

        qemu_cmd = ["qemu-system-{}".format(qemu_arch),
                    "-serial", "stdio",
                    "-display", "none",
                    "-m", "256"]

        if options:
            qemu_cmd += options

So if we passe options=["-m", "512"], this should override the default
-m 256.

Then the question is how can the Python test infrastructure pass this
down to self.emulator.boot().

Something like this perhaps:

diff --git a/support/testing/tests/package/test_python.py b/support/testing/tests/package/test_python.py
index f29aff6624..bd0b21f193 100644
--- a/support/testing/tests/package/test_python.py
+++ b/support/testing/tests/package/test_python.py
@@ -11,11 +11,14 @@ class TestPythonBase(infra.basetest.BRTest):
         """
     interpreter = "python"
 
-    def login(self):
+    def login(self, qemu_extra_opts=None):
         cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio")
+        qemu_opts = ["-initrd", cpio_file]
+        if qemu_extra_opts:
+            qemu_opts += qemu_extra_opts
         self.emulator.boot(arch="armv5",
                            kernel="builtin",
-                           options=["-initrd", cpio_file])
+                           options=qemu_opts)
         self.emulator.login()
 
     def version_test(self, version, timeout=-1):
@@ -80,6 +83,7 @@ class TestPythonPackageBase(TestPythonBase):
                    "{sample_scripts}")
     sample_scripts = None
     timeout = -1
+    qemu_extra_opts = None
 
     def __init__(self, names):
         """Add the scripts to the target in build time."""
@@ -102,6 +106,6 @@ class TestPythonPackageBase(TestPythonBase):
             self.assertRunOk(cmd, timeout=self.timeout)
 
     def test_run(self):
-        self.login()
+        self.login(qemu_extra_opts=self.qemu_extra_opts)
         self.check_sample_scripts_exist()
         self.run_sample_scripts()
diff --git a/support/testing/tests/package/test_python_botocore.py b/support/testing/tests/package/test_python_botocore.py
index 6336c5658f..a7c35a6ed6 100644
--- a/support/testing/tests/package/test_python_botocore.py
+++ b/support/testing/tests/package/test_python_botocore.py
@@ -10,3 +10,4 @@ class TestPythonPy3Botocore(TestPythonPackageBase):
         """
     sample_scripts = ["tests/package/sample_python_botocore.py"]
     timeout = 10
+    qemu_extra_opts = ["-m", "512"]

(Completely untested, and also I'm not sure if it's the most Pythonic
way to do that, I'm not a Python developer).

What do you think?

Best regards,

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2022-07-20 21:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-15 17:12 [Buildroot] [PATCH 1/2] support/testing: use aarch64 for TestPythonPy3Botocore Raphaël Mélotte
2022-06-15 17:12 ` [Buildroot] [PATCH 2/2] package/python-botocore: bump to version 1.27.8 Raphaël Mélotte
2022-07-23 16:56   ` Arnout Vandecappelle
2022-07-20 21:50 ` Thomas Petazzoni via buildroot [this message]
2022-08-05  7:15   ` [Buildroot] [PATCH 1/2] support/testing: use aarch64 for TestPythonPy3Botocore Raphaël Mélotte

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=20220720235057.2aba2ffc@windsurf \
    --to=buildroot@buildroot.org \
    --cc=raphael.melotte@mind.be \
    --cc=ricardo.martincoski@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox