public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Cc: Heiko Thiery <heiko.thiery@gmail.com>, Simon Glass <sjg@chromium.org>
Subject: [PATCH 3/4] binman: Have faked binaries live in the output directory.
Date: Tue, 11 Jan 2022 19:14:30 -0500	[thread overview]
Message-ID: <20220112001431.1280749-3-trini@konsulko.com> (raw)
In-Reply-To: <20220112001431.1280749-1-trini@konsulko.com>

In general, and for Azure specifically, we need to have files created in
the output directory and cannot assume a writable source directory.
Rework the faked blob support to put the faked binary in to the output
directory and then stop the test from deleting the now non-existent
file.

Cc: Heiko Thiery <heiko.thiery@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
---
 tools/binman/etype/blob.py | 4 +++-
 tools/binman/ftest.py      | 1 -
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/binman/etype/blob.py b/tools/binman/etype/blob.py
index 65ebb2ecf4d8..ca8023b1a0b2 100644
--- a/tools/binman/etype/blob.py
+++ b/tools/binman/etype/blob.py
@@ -39,11 +39,13 @@ class Entry_blob(Entry):
 
     def ObtainContents(self):
         if self.allow_fake and not pathlib.Path(self._filename).is_file():
+            self._filename = tools.GetOutputFilename(self._filename)
             with open(self._filename, "wb") as out:
                 out.truncate(1024)
             self.faked = True
+        else:
+            self._filename = self.GetDefaultFilename()
 
-        self._filename = self.GetDefaultFilename()
         self._pathname = tools.GetInputFilename(self._filename,
             self.external and self.section.GetAllowMissing())
         # Allow the file to be missing
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index a9b7880f362f..d03ce6f05f8d 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -4675,7 +4675,6 @@ class TestFunctional(unittest.TestCase):
         err = stderr.getvalue()
         self.assertRegex(err,
                          "Image '.*' has faked external blobs and is non-functional: .*")
-        os.remove('binman_faking_test_blob')
 
     def testVersion(self):
         """Test we can get the binman version"""
-- 
2.25.1


  parent reply	other threads:[~2022-01-12  0:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-12  0:14 [PATCH 1/4] ci: azure: Update to use stages Tom Rini
2022-01-12  0:14 ` [PATCH 2/4] CI, Dockerfile: Update to latest "focal" tag Tom Rini
2022-01-12  1:55   ` Fabio Estevam
2022-01-12  1:56     ` Tom Rini
2022-01-13 12:53   ` Tom Rini
2022-01-12  0:14 ` Tom Rini [this message]
2022-01-12 20:01   ` [PATCH 3/4] binman: Have faked binaries live in the output directory Simon Glass
2022-01-12 20:03     ` Tom Rini
2022-01-12 20:11       ` Simon Glass
2022-01-12  0:14 ` [PATCH 4/4] .readthedocs.yml: Set our requirements file Tom Rini
2022-01-12  2:33   ` Heinrich Schuchardt
2022-01-12 22:05 ` [PATCH 1/4] ci: azure: Update to use stages Tom Rini
2022-01-13 12:53 ` Tom Rini

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=20220112001431.1280749-3-trini@konsulko.com \
    --to=trini@konsulko.com \
    --cc=heiko.thiery@gmail.com \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /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