From patchwork Sat Jul 20 18:23:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1134442 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="iccyQICz"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45rc944pDkz9s4Y for ; Sun, 21 Jul 2019 04:39:20 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 4F318C21DD7; Sat, 20 Jul 2019 18:31:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 6BDC2C21E79; Sat, 20 Jul 2019 18:25:59 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 45284C21E50; Sat, 20 Jul 2019 18:25:15 +0000 (UTC) Received: from mail-io1-f65.google.com (mail-io1-f65.google.com [209.85.166.65]) by lists.denx.de (Postfix) with ESMTPS id 3AA3DC21D74 for ; Sat, 20 Jul 2019 18:25:15 +0000 (UTC) Received: by mail-io1-f65.google.com with SMTP id h6so65219186iom.7 for ; Sat, 20 Jul 2019 11:25:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YlxNvWWycSsouroIZNc45D+pA7hkO7kSCHRiajNcA3g=; b=iccyQICzJbPNQesVL6jarvKvtbsDUvIk27lqw8m89jdextqfJegHHUtbTD0MXOw3J5 D5jLKvwEnGrBUKmdEBdjKIZjTlv+CPUfsgxHQgVgSNTLYUYBevz9s4VDu7UVRPNHyKZ1 4VuWY3et3YXwCkkWt7kJx3IilUHDMxK/36m1g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YlxNvWWycSsouroIZNc45D+pA7hkO7kSCHRiajNcA3g=; b=NVxGAb4B/npk7kktwPZKzSPiIdr/11rwqPPuDBz9J2jaC9TM4CEkqpPMVeOxlm5Kpn DmfCmJC7UpzJvW7YX+BjgApYRANx5YFuZtBNq43M8ka2fsS8PfQIgrO5KuYL+qJ8SHQ7 iVC9ZKlx/fvNldWp+QVYypMBWd0GR9xJwxSiWytqFIPr5joslaQkL6pZwToIJhLJnyAs JNPSr7nWuLF9lyu0HaKtu9s0lVdzM78rnlz7IeH4cD5iDHoT3ZTW6TG7j98HfgIB24/v WyJsgxAQP7RNZ+Upy+lpFaJGA+HvALbAkt0eIT8KgSOs0m9JuUCaP4BR7twJji+kdzju 60LA== X-Gm-Message-State: APjAAAWHXm5RFkwIxr7zJtSiVOaio3/eNpv5XwLh0H/oXCOlLEU4+0MD S7P/27L6IaK/NTeznm7NiCqUx0fyFxk= X-Google-Smtp-Source: APXvYqwK3WnBfwJ//hyIOIaQDQzd4biZuYNrHCmRaNs6zReJxIwwB95qoXvLBbZhc+FS5r+EF50qsA== X-Received: by 2002:a5e:9701:: with SMTP id w1mr56825231ioj.294.1563647114085; Sat, 20 Jul 2019 11:25:14 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id z17sm49778933iol.73.2019.07.20.11.25.13 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 20 Jul 2019 11:25:13 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 20 Jul 2019 12:23:47 -0600 Message-Id: <20190720182416.183626-26-sjg@chromium.org> X-Mailer: git-send-email 2.22.0.657.g960e92d24f-goog In-Reply-To: <20190720182416.183626-1-sjg@chromium.org> References: <20190720182416.183626-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 25/53] binman: Add a constant for common entry properties X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" We use this same combination of properties several times in tests. Add a constant for it to avoid typos, etc. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/binman/ftest.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index 08a1df03077..bb886266277 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -69,8 +69,12 @@ FILES_DATA = (b"sorry I'm late\nOh, don't bother apologising, I'm " + COMPRESS_DATA = b'compress xxxxxxxxxxxxxxxxxxxxxx data' REFCODE_DATA = b'refcode' +# The expected size for the device tree in some tests EXTRACT_DTB_SIZE = 0x3c9 +# Properties expected to be in the device tree when update_dtb is used +BASE_DTB_PROPS = ['offset', 'size', 'image-pos'] + class TestFunctional(unittest.TestCase): """Functional tests for binman @@ -1240,7 +1244,7 @@ class TestFunctional(unittest.TestCase): update_dtb=True) dtb = fdt.Fdt(out_dtb_fname) dtb.Scan() - props = self._GetPropTree(dtb, ['offset', 'size', 'image-pos']) + props = self._GetPropTree(dtb, BASE_DTB_PROPS) self.assertEqual({ 'image-pos': 0, 'offset': 0, @@ -1583,8 +1587,7 @@ class TestFunctional(unittest.TestCase): for item in ['', 'spl', 'tpl']: dtb = fdt.Fdt.FromData(data[start:]) dtb.Scan() - props = self._GetPropTree(dtb, ['offset', 'size', 'image-pos', - 'spl', 'tpl']) + props = self._GetPropTree(dtb, BASE_DTB_PROPS + ['spl', 'tpl']) expected = dict(base_expected) if item: expected[item] = 0 @@ -2052,8 +2055,7 @@ class TestFunctional(unittest.TestCase): fdt_data = fdtmap_data[16:] dtb = fdt.Fdt.FromData(fdt_data) dtb.Scan() - props = self._GetPropTree(dtb, ['offset', 'size', 'image-pos'], - prefix='/') + props = self._GetPropTree(dtb, BASE_DTB_PROPS, prefix='/') self.assertEqual({ 'image-pos': 0, 'offset': 0, @@ -2172,8 +2174,7 @@ class TestFunctional(unittest.TestCase): update_dtb=True) dtb = fdt.Fdt(out_dtb_fname) dtb.Scan() - props = self._GetPropTree(dtb, ['offset', 'size', 'image-pos', - 'uncomp-size']) + props = self._GetPropTree(dtb, BASE_DTB_PROPS + ['uncomp-size']) del props['cbfs/u-boot:size'] self.assertEqual({ 'offset': 0,