public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "chris.larson via isar-users" <isar-users@googlegroups.com>
To: isar-users@googlegroups.com
Cc: Cedric Hombourger <cedric.hombourger@siemens.com>,
	Christopher Larson <chris.larson@siemens.com>
Subject: [PATCH 3/4] testsuite: add 'extra_lines' argument to configure
Date: Fri, 11 Apr 2025 13:08:51 -0700	[thread overview]
Message-ID: <20250411200852.51967-4-chris.larson@siemens.com> (raw)
In-Reply-To: <20250411200852.51967-1-chris.larson@siemens.com>

From: Christopher Larson <chris.larson@siemens.com>

This allows us to add extra lines to the configuration file, which is generally
useful, and will ease future creation of tests by avoiding the need to add new
arguments to the configure function for each configuration needed.

Signed-off-by: Christopher Larson <chris.larson@siemens.com>
---
 testsuite/cibuilder.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/testsuite/cibuilder.py b/testsuite/cibuilder.py
index e726ba87..f47d6a77 100755
--- a/testsuite/cibuilder.py
+++ b/testsuite/cibuilder.py
@@ -114,6 +114,7 @@ def configure(
         installer_distro=None,
         installer_device=None,
         customizations=None,
+        lines=None,
         **kwargs,
     ):
         # write configuration file and set bitbake_args
@@ -142,6 +143,7 @@ def configure(
         distro_apt_premir = os.getenv('DISTRO_APT_PREMIRRORS')
         fail_on_cleanup = os.getenv('ISAR_FAIL_ON_CLEANUP')
 
+        strlines = None if lines is None else '\\n'.join(lines)
         self.log.info(
             f"===================================================\n"
             f"Configuring build_dir {self.build_dir}\n"
@@ -162,6 +164,7 @@ def configure(
             f"  image_install = {image_install}\n"
             f"  installer_image = {installer_image}\n"
             f"  customizations = {customizations}\n"
+            f"  lines = {strlines}\n"
             f"==================================================="
         )
 
@@ -248,6 +251,8 @@ def configure(
                 f.write('CUSTOMIZATION_VARS:append = " ${IMAGE}"\n')
                 f.write('CUSTOMIZATION_FOR_IMAGES:append = " isar-image-ci"\n')
                 f.write('HOSTNAME:isar-image-ci = "isar-ci"\n')
+            if lines is not None:
+                f.writelines((line + '\n' if not line.endswith('\n') else line) for line in lines)
 
         # include ci_build.conf in local.conf
         with open(self.build_dir + '/conf/local.conf', 'r+') as f:
-- 
2.47.2

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20250411200852.51967-4-chris.larson%40siemens.com.

  parent reply	other threads:[~2025-04-11 20:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-11 20:08 [PATCHv2 0/4] Add support for per-kernel recipe variants chris.larson via isar-users
2025-04-11 20:08 ` [PATCH 1/4] per-kernel.bbclass: add class chris.larson via isar-users
2025-04-11 20:08 ` [PATCH 2/4] linux-module: inherit per-kernel chris.larson via isar-users
2025-04-11 20:08 ` chris.larson via isar-users [this message]
2025-04-11 20:08 ` [PATCH 4/4] testsuite: add a test for per_kernel support chris.larson via isar-users
2025-04-11 20:10 ` [PATCHv2 0/4] Add support for per-kernel recipe variants 'Larson, Chris' via isar-users

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=20250411200852.51967-4-chris.larson@siemens.com \
    --to=isar-users@googlegroups.com \
    --cc=cedric.hombourger@siemens.com \
    --cc=chris.larson@siemens.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