public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Trevor Woerner <twoerner@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH v5 06/10] oe-selftest/cases/wic.py: update WicTestCase
Date: Mon, 23 Feb 2026 16:50:04 -0500	[thread overview]
Message-ID: <20260223215008.2062721-7-twoerner@gmail.com> (raw)
In-Reply-To: <20260223215008.2062721-1-twoerner@gmail.com>

The wic oe-selftest defines its own class, WicTestCase, for handling
setup, teardown, and other pieces needed to run the individual wic
oe-selftests. Now that wic is a tool external to oe-core, it, and the
tools on which it depends, need to be built natively before the test
can be run, need to be made available to the tests, and need to remain
available while the test is running.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
changes in v5:
- rebase with master
- split back out into smaller patches

v4: skipped to align/combine with other patch set

changes in v3:
- squashed into 1 large patch

changes in v2:
- none
---
 meta/lib/oeqa/selftest/cases/wic.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/meta/lib/oeqa/selftest/cases/wic.py b/meta/lib/oeqa/selftest/cases/wic.py
index 7ad61fa700f7..e9c28baf51eb 100644
--- a/meta/lib/oeqa/selftest/cases/wic.py
+++ b/meta/lib/oeqa/selftest/cases/wic.py
@@ -57,12 +57,22 @@ class WicTestCase(OESelftestTestCase):
 
     image_is_ready = False
     wicenv_cache = {}
+    oldpath = ""
+    envfile = ""
 
     def setUpLocal(self):
         """This code is executed before each test method."""
         self.resultdir = os.path.join(self.builddir, "wic-tmp")
         super(WicTestCase, self).setUpLocal()
 
+        config = 'DEPENDS:pn-core-image-minimal += " %s"' % get_bb_var("DEPENDS", "wic-tools")
+        self.append_config(config)
+        bitbake('wic-tools core-image-minimal core-image-minimal-mtdutils')
+        WicTestCase.oldpath = os.environ['PATH']
+        os.environ['PATH'] = get_bb_var("PATH", "wic-tools") + ":" + os.environ['PATH']
+        image = 'core-image-minimal'
+        WicTestCase.envfile = os.path.join(self._get_image_env_path(image), image) + '.env'
+
         # Do this here instead of in setUpClass as the base setUp does some
         # clean up which can result in the native tools built earlier in
         # setUpClass being unavailable.
@@ -78,6 +88,7 @@ class WicTestCase(OESelftestTestCase):
         """Remove resultdir as it may contain images."""
         rmtree(self.resultdir, ignore_errors=True)
         super(WicTestCase, self).tearDownLocal()
+        os.environ['PATH'] = WicTestCase.oldpath
 
     def _get_image_env_path(self, image):
         """Generate and obtain the path to <image>.env"""
-- 
2.51.0



  parent reply	other threads:[~2026-02-23 21:50 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-23 21:49 [PATCH v5 00/10] standalone wic Trevor Woerner
2026-02-23 21:49 ` [PATCH v5 01/10] wic: re-implement sector-size support Trevor Woerner
2026-02-24  9:52   ` [OE-core] " Paul Barker
2026-02-24 18:40     ` Trevor Woerner
2026-02-24 21:35       ` Paul Barker
2026-02-23 21:50 ` [PATCH v5 02/10] ufs image class: add Trevor Woerner
2026-02-24 10:02   ` [OE-core] " Paul Barker
2026-02-24 10:15     ` Paul Barker
2026-02-24 17:56     ` Trevor Woerner
2026-02-24 21:17       ` Paul Barker
2026-02-25  0:38         ` Trevor Woerner
2026-02-23 21:50 ` [PATCH v5 03/10] wic: remove Trevor Woerner
2026-02-24 10:05   ` [OE-core] " Paul Barker
2026-02-24 17:37     ` Trevor Woerner
2026-02-23 21:50 ` [PATCH v5 04/10] wic: provide oe-core wks files Trevor Woerner
2026-02-24 10:08   ` [OE-core] " Paul Barker
2026-02-24 17:38     ` Trevor Woerner
2026-02-23 21:50 ` [PATCH v5 05/10] wic: add recipe Trevor Woerner
2026-02-23 21:50 ` Trevor Woerner [this message]
2026-02-23 21:50 ` [PATCH v5 07/10] oe-selftest/cases/wic.py: oe-selftest -r wic.CLITests -> PASS Trevor Woerner
2026-02-23 21:50 ` [PATCH v5 08/10] oe-selftest/cases/wic.py: oe-selftest -r wic.ModifyTests " Trevor Woerner
2026-02-23 21:50 ` [PATCH v5 09/10] oe-selftest/cases/wic.py: oe-selftest -r wic.Wic " Trevor Woerner
2026-02-23 21:50 ` [PATCH v5 10/10] oe-selftest/cases/wic.py: oe-selftest -r wic.Wic2 " Trevor Woerner

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=20260223215008.2062721-7-twoerner@gmail.com \
    --to=twoerner@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /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