Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 806F9C433F5 for ; Wed, 12 Jan 2022 00:15:14 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2C05283105; Wed, 12 Jan 2022 01:14:48 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 28F3E830A0; Wed, 12 Jan 2022 01:14:42 +0100 (CET) Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E9DA0830AB for ; Wed, 12 Jan 2022 01:14:37 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tom.rini@gmail.com Received: by mail-qk1-f170.google.com with SMTP id h16so738546qkp.3 for ; Tue, 11 Jan 2022 16:14:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=a7rXxXxN+i/HD/1ltYxoj4jHOKQnlsgKc0kIKZr0rYQ=; b=ZHMHtMeCp5WtmYgDr0ohDFdRvaLwidtsi/cR8Re540FhkDmrfOHbg8G+ya4U6FXm4R xQYfET865pRvvNzIROAz8trW5/o17JlSW+vfiFUD4O18hPEkTb1Tj9Fz+5LOQ2pvIe/p BlFOwPsz2F4At4ipZ+4Wrx20kiiEACRT7R1k7SZ7dI3UMRH8pkyGwvZ3WQnWEcWewQD3 nGWYBJHOyUtt0jsMTy2akq1cwR9zYv6/+CEiKBzbmR9+7KVBn2WVSvgWC5E3T1fdGT7j 3BRU+5U75Sj+DQmVFrUuJRgbLIbZameR8EF1ucL+AbVnChhHyzbSS8iXZf8w6+iFMJAt A5xg== X-Gm-Message-State: AOAM533QLHYkWgor0pmJ+FWoew9IBeUw10N49J/Brmwv8TsSSyxY1Umz 6cduvF5HJst2UUjfmdP6Q6xUx/jNqg== X-Google-Smtp-Source: ABdhPJxZQJzwXhJbsS7YinOVZBGYIryD6QbFTMvjwtnABeSE+04F/UazZa2KYf/N8dXxj6eZm20CPg== X-Received: by 2002:a05:620a:2415:: with SMTP id d21mr4937138qkn.93.1641946476699; Tue, 11 Jan 2022 16:14:36 -0800 (PST) Received: from bill-the-cat.lan (2603-6081-7b01-cbda-456a-4482-4d5b-efcf.res6.spectrum.com. [2603:6081:7b01:cbda:456a:4482:4d5b:efcf]) by smtp.gmail.com with ESMTPSA id u10sm8023192qtx.3.2022.01.11.16.14.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jan 2022 16:14:36 -0800 (PST) From: Tom Rini To: u-boot@lists.denx.de Cc: Heiko Thiery , Simon Glass Subject: [PATCH 3/4] binman: Have faked binaries live in the output directory. Date: Tue, 11 Jan 2022 19:14:30 -0500 Message-Id: <20220112001431.1280749-3-trini@konsulko.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220112001431.1280749-1-trini@konsulko.com> References: <20220112001431.1280749-1-trini@konsulko.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean 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 Cc: Simon Glass Signed-off-by: Tom Rini --- 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