Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2215587/?format=api
{ "id": 2215587, "url": "http://patchwork.ozlabs.org/api/patches/2215587/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20260324194323.2335679-6-sjg@chromium.org/", "project": { "id": 18, "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api", "name": "U-Boot", "link_name": "uboot", "list_id": "u-boot.lists.denx.de", "list_email": "u-boot@lists.denx.de", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260324194323.2335679-6-sjg@chromium.org>", "list_archive_url": null, "date": "2026-03-24T19:43:20", "name": "[5/6] test: Convert FIT test to use a class", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "24d6be8565381f9f1f834e76a57a5a56b6a5d767", "submitter": { "id": 6170, "url": "http://patchwork.ozlabs.org/api/people/6170/?format=api", "name": "Simon Glass", "email": "sjg@chromium.org" }, "delegate": { "id": 3651, "url": "http://patchwork.ozlabs.org/api/users/3651/?format=api", "username": "trini", "first_name": "Tom", "last_name": "Rini", "email": "trini@ti.com" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20260324194323.2335679-6-sjg@chromium.org/mbox/", "series": [ { "id": 497338, "url": "http://patchwork.ozlabs.org/api/series/497338/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=497338", "date": "2026-03-24T19:43:15", "name": "test: Refactor FIT test for clarity and extensibility", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/497338/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2215587/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2215587/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<u-boot-bounces@lists.denx.de>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256\n header.s=google header.b=SVn2ysoU;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)", "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=chromium.org", "phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de", "phobos.denx.de;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=chromium.org header.i=@chromium.org\n header.b=\"SVn2ysoU\";\n\tdkim-atps=neutral", "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=chromium.org", "phobos.denx.de;\n spf=pass smtp.mailfrom=sjg@chromium.org" ], "Received": [ "from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fgL8R6Q5rz1xy1\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 25 Mar 2026 06:44:23 +1100 (AEDT)", "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 9342C83F86;\n\tTue, 24 Mar 2026 20:43:44 +0100 (CET)", "by phobos.denx.de (Postfix, from userid 109)\n id 9053B83952; Tue, 24 Mar 2026 20:43:42 +0100 (CET)", "from mail-oa1-x29.google.com (mail-oa1-x29.google.com\n [IPv6:2001:4860:4864:20::29])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 267D6807C0\n for <u-boot@lists.denx.de>; Tue, 24 Mar 2026 20:43:39 +0100 (CET)", "by mail-oa1-x29.google.com with SMTP id\n 586e51a60fabf-41c096fab64so199443fac.1\n for <u-boot@lists.denx.de>; Tue, 24 Mar 2026 12:43:39 -0700 (PDT)", "from chromium.org ([73.34.74.121]) by smtp.gmail.com with ESMTPSA id\n 586e51a60fabf-41c88218654sm3714784fac.17.2026.03.24.12.43.35\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 24 Mar 2026 12:43:36 -0700 (PDT)" ], "X-Spam-Checker-Version": "SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de", "X-Spam-Level": "", "X-Spam-Status": "No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,\n DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,\n RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham\n autolearn_force=no version=3.4.2", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=chromium.org; s=google; t=1774381417; x=1774986217; darn=lists.denx.de;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=3PUj7RGoYUE5OCs2/ZxZAY2JSdztA6s/Im1vqJQofYw=;\n b=SVn2ysoUGaySY8q29LSuOAhb8zx0Ayk5noZcfZWLjVpyXX+SIBOvIA+tJgwJBGEQWT\n 98wwczJryUb6dsiKgK+Yoq+MNJJbIE7sEQAzu9JRRv5XChJ2bDZhKF03G4PzZWerdZvW\n suzUQxmOi1PoFpO2Zzlm1wF0sZkki5S9Mg6wA=", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1774381417; x=1774986217;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=3PUj7RGoYUE5OCs2/ZxZAY2JSdztA6s/Im1vqJQofYw=;\n b=g5Ar6VsMORl2QQZa6FwOp9dzvAxDdgPR2ty9Gu/C1ZO0w1GStvjUohJS8enU8MUyVA\n 68usI4GkRlGxujt2lT/3o6r2h95c2TGCmnYqSXqGk3+zvaOyv1ux5NTMiaf8eX0N31vN\n d4D8PGUXpBPlyFeJTbigscVN+cQlfuqxHh24DA6bkyVaC92pbc39oRwiGPVMdBTInvyu\n z+pUqwSIMLgBEy6iyt2Jq5pDOoQr7H/I5uEMUidPjfXtrdUbOMbT1skPjXyvScTukDqg\n rH0rZzCwSYAKaE8NE3YLFE0Hp7G+HGyyXwJmdLECybsWtWrUSDU2Kl2poRZ+t3SACHhS\n aCFA==", "X-Gm-Message-State": "AOJu0YzQXwWe7Gk5eutINr0jaqwiF8Ld65kbRhOzXsOj1xglXi1KyCB/\n k6m9cFUQJdEb19dNrlJqQIZqkghOjA2s1V11HAMMQd8qag9WIj2zrgnDatCGHBiwvgIjZ/G+k3s\n dVA4=", "X-Gm-Gg": "ATEYQzznQ5MrnDeSbPZrVimFB4dQRDEQYZBcEE5epkQDs+hklOCkDM0VVPOQho7k8O+\n FVJSxPam6Cwd1HVcc57/gk2gvAEOIF24hAmL22eGcRzsjltP0hahU0fPWwx66vS1WZtubfDwtcc\n MSjDqlunHUNDBSJV0vDJdiTFaMfZf9d3Sm91pvrz/Y2WV2m9RElB4kBTh36XijqNN+ZPDf3Uthd\n uY3skUkRfyduPYiFYeLUdRN6gvXA0EzCScomiWRjX7k1/GyYuu2UXugrK3XlGzYb3icv604xHdS\n bTFf+NJbFS14F1Ahi+ErlFTpNIuq7H+IFpMj6SSMFwUSmyLC3wCkGNCzKp70TihhQPU1NYxUlnF\n //HTeU9zFnP5HSRAB5STy4rtpvz1OUkBZqL8GAr7O7JBRVn6VBaihLoelStjKsTFHahh1agotkg\n kerKR+PCUskDWzod0+pA==", "X-Received": "by 2002:a05:6871:5f01:b0:41c:686c:322b with SMTP id\n 586e51a60fabf-41c875bae1fmr2903409fac.9.1774381417055;\n Tue, 24 Mar 2026 12:43:37 -0700 (PDT)", "From": "Simon Glass <sjg@chromium.org>", "To": "u-boot@lists.denx.de", "Cc": "Simon Glass <sjg@chromium.org>,\n\tTom Rini <trini@konsulko.com>", "Subject": "[PATCH 5/6] test: Convert FIT test to use a class", "Date": "Tue, 24 Mar 2026 13:43:20 -0600", "Message-ID": "<20260324194323.2335679-6-sjg@chromium.org>", "X-Mailer": "git-send-email 2.43.0", "In-Reply-To": "<20260324194323.2335679-1-sjg@chromium.org>", "References": "<20260324194323.2335679-1-sjg@chromium.org>", "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 <u-boot.lists.denx.de>", "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>", "List-Archive": "<https://lists.denx.de/pipermail/u-boot/>", "List-Post": "<mailto:u-boot@lists.denx.de>", "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>", "List-Subscribe": "<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>", "Errors-To": "u-boot-bounces@lists.denx.de", "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>", "X-Virus-Scanned": "clamav-milter 0.103.8 at phobos.denx.de", "X-Virus-Status": "Clean" }, "content": "Move this test over to use a class instead of a function, so we can\neasily split it into some related tests.\n\nMove the TODO so it is part of the comment for the class.\n\nTidy up some function comments while we are here.\n\nSigned-off-by: Simon Glass <sjg@chromium.org>\n---\n\n test/py/tests/test_fit.py | 230 +++++++++++++++++++++-----------------\n 1 file changed, 127 insertions(+), 103 deletions(-)", "diff": "diff --git a/test/py/tests/test_fit.py b/test/py/tests/test_fit.py\nindex b3a08bedd70..db70a9deb89 100755\n--- a/test/py/tests/test_fit.py\n+++ b/test/py/tests/test_fit.py\n@@ -11,7 +11,7 @@ import fit_util\n import utils\n \n # Define a base ITS which we can adjust using % and a dictionary\n-base_its = '''\n+BASE_ITS = '''\n /dts-v1/;\n \n / {\n@@ -81,7 +81,7 @@ base_its = '''\n '''\n \n # Define a base FDT - currently we don't use anything in this\n-base_fdt = '''\n+BASE_FDT = '''\n /dts-v1/;\n \n / {\n@@ -104,7 +104,7 @@ base_fdt = '''\n # This is the U-Boot script that is run for each test. First load the FIT,\n # then run the 'bootm' command, then save out memory from the places where\n # we expect 'bootm' to write things. Then quit.\n-base_script = '''\n+BASE_SCRIPT = '''\n mw.b 0 0 160000\n host load hostfs 0 %(fit_addr)x %(fit)s\n fdt addr %(fit_addr)x\n@@ -120,45 +120,68 @@ host save hostfs 0 %(loadables2_addr)x %(loadables2_out)s %(loadables2_size)x\n @pytest.mark.boardspec('sandbox')\n @pytest.mark.buildconfigspec('fit_signature')\n @pytest.mark.requiredtool('dtc')\n-def test_fit_base(ubman):\n- def make_fname(leaf):\n+class TestFitImage:\n+ \"\"\"Test class for FIT image handling in U-Boot\n+\n+ TODO: Almost everything:\n+ - hash algorithms - invalid hash/contents should be detected\n+ - signature algorithms - invalid sig/contents should be detected\n+ - compression\n+ - checking that errors are detected like:\n+ - image overwriting\n+ - missing images\n+ - invalid configurations\n+ - incorrect os/arch/type fields\n+ - empty data\n+ - images too large/small\n+ - invalid FDT (e.g. putting a random binary in instead)\n+ - default configuration selection\n+ - bootm command line parameters should have desired effect\n+ - run code coverage to make sure we are testing all the code\n+ \"\"\"\n+\n+ def make_fname(self, ubman, leaf):\n \"\"\"Make a temporary filename\n \n Args:\n- leaf: Leaf name of file to create (within temporary directory)\n+ ubman (ConsoleBase): U-Boot fixture\n+ leaf (str): Leaf name of file to create (within temporary directory)\n+\n Return:\n- Temporary filename\n+ str: Temporary filename\n \"\"\"\n return os.path.join(ubman.config.build_dir, leaf)\n \n- def filesize(fname):\n+ def filesize(self, fname):\n \"\"\"Get the size of a file\n \n Args:\n- fname: Filename to check\n+ fname (str): Filename to check\n+\n Return:\n- Size of file in bytes\n+ int: Size of file in bytes\n \"\"\"\n return os.stat(fname).st_size\n \n- def read_file(fname):\n+ def read_file(self, fname):\n \"\"\"Read the contents of a file\n \n Args:\n- fname: Filename to read\n- Returns:\n- Contents of file as a string\n+ fname (str): Filename to read\n+\n+ Return:\n+ str: Contents of file\n \"\"\"\n with open(fname, 'rb') as fd:\n return fd.read()\n \n- def make_ramdisk(filename, text):\n+ def make_ramdisk(self, ubman, filename, text):\n \"\"\"Make a sample ramdisk with test data\n \n Returns:\n- Filename of ramdisk created\n+ str: Filename of ramdisk created\n \"\"\"\n- fname = make_fname(filename)\n+ fname = self.make_fname(ubman, filename)\n data = ''\n for i in range(100):\n data += f'{text} {i} was seldom used in the middle ages\\n'\n@@ -166,11 +189,12 @@ def test_fit_base(ubman):\n print(data, file=fd)\n return fname\n \n- def make_compressed(filename):\n+ def make_compressed(self, ubman, filename):\n+ \"\"\"Compress a file using gzip\"\"\"\n utils.run_and_log(ubman, ['gzip', '-f', '-k', filename])\n return filename + '.gz'\n \n- def find_matching(text, match):\n+ def find_matching(self, text, match):\n \"\"\"Find a match in a line of text, and return the unmatched line portion\n \n This is used to extract a part of a line from some text. The match string\n@@ -184,10 +208,12 @@ def test_fit_base(ubman):\n to use regex and return groups.\n \n Args:\n- text: Text to check (list of strings, one for each command issued)\n- match: String to search for\n+ text (list of str): Text to check, one for each command issued\n+ match (str): String to search for\n+\n Return:\n- String containing unmatched portion of line\n+ str: unmatched portion of line\n+\n Exceptions:\n ValueError: If match is not found\n \n@@ -213,7 +239,7 @@ def test_fit_base(ubman):\n pytest.fail(\"Expected '%s' but not found in output\")\n return '<no-match>'\n \n- def check_equal(expected_fname, actual_fname, failure_msg):\n+ def check_equal(self, expected_fname, actual_fname, failure_msg):\n \"\"\"Check that a file matches its expected contents\n \n This is always used on out-buffers whose size is decided by the test\n@@ -222,59 +248,50 @@ def test_fit_base(ubman):\n expected data.\n \n Args:\n- expected_fname: Filename containing expected contents\n- actual_fname: Filename containing actual contents\n- failure_msg: Message to print on failure\n+ expected_fname (str): Filename containing expected contents\n+ actual_fname (str): Filename containing actual contents\n+ failure_msg (str): Message to print on failure\n \"\"\"\n- expected_data = read_file(expected_fname)\n- actual_data = read_file(actual_fname)\n+ expected_data = self.read_file(expected_fname)\n+ actual_data = self.read_file(actual_fname)\n if len(expected_data) < len(actual_data):\n actual_data = actual_data[:len(expected_data)]\n assert expected_data == actual_data, failure_msg\n \n- def check_not_equal(expected_fname, actual_fname, failure_msg):\n+ def check_not_equal(self, expected_fname, actual_fname, failure_msg):\n \"\"\"Check that a file does not match its expected contents\n \n Args:\n- expected_fname: Filename containing expected contents\n- actual_fname: Filename containing actual contents\n- failure_msg: Message to print on failure\n+ expected_fname (str): Filename containing expected contents\n+ actual_fname (str): Filename containing actual contents\n+ failure_msg (str): Message to print on failure\n \"\"\"\n- expected_data = read_file(expected_fname)\n- actual_data = read_file(actual_fname)\n+ expected_data = self.read_file(expected_fname)\n+ actual_data = self.read_file(actual_fname)\n assert expected_data != actual_data, failure_msg\n \n- def run_fit_test(mkimage):\n+ def test_fit_operations(self, ubman):\n \"\"\"Basic sanity check of FIT loading in U-Boot\n \n- TODO: Almost everything:\n- - hash algorithms - invalid hash/contents should be detected\n- - signature algorithms - invalid sig/contents should be detected\n- - compression\n- - checking that errors are detected like:\n- - image overwriting\n- - missing images\n- - invalid configurations\n- - incorrect os/arch/type fields\n- - empty data\n- - images too large/small\n- - invalid FDT (e.g. putting a random binary in instead)\n- - default configuration selection\n- - bootm command line parameters should have desired effect\n- - run code coverage to make sure we are testing all the code\n+ This test covers various FIT configurations and verifies correct behavior.\n+\n+ Args:\n+ ubman (ConsoleBase): U-Boot fixture\n \"\"\"\n+ mkimage = os.path.join(ubman.config.build_dir, 'tools/mkimage')\n+\n # Set up invariant files\n- fdt_data = fit_util.make_dtb(ubman, base_fdt, 'u-boot')\n+ fdt_data = fit_util.make_dtb(ubman, BASE_FDT, 'u-boot')\n kernel = fit_util.make_kernel(ubman, 'test-kernel.bin', 'kernel')\n- ramdisk = make_ramdisk('test-ramdisk.bin', 'ramdisk')\n+ ramdisk = self.make_ramdisk(ubman, 'test-ramdisk.bin', 'ramdisk')\n loadables1 = fit_util.make_kernel(ubman, 'test-loadables1.bin', 'lenrek')\n- loadables2 = make_ramdisk('test-loadables2.bin', 'ksidmar')\n- kernel_out = make_fname('kernel-out.bin')\n- fdt = make_fname('u-boot.dtb')\n- fdt_out = make_fname('fdt-out.dtb')\n- ramdisk_out = make_fname('ramdisk-out.bin')\n- loadables1_out = make_fname('loadables1-out.bin')\n- loadables2_out = make_fname('loadables2-out.bin')\n+ loadables2 = self.make_ramdisk(ubman, 'test-loadables2.bin', 'ksidmar')\n+ kernel_out = self.make_fname(ubman, 'kernel-out.bin')\n+ fdt = self.make_fname(ubman, 'u-boot.dtb')\n+ fdt_out = self.make_fname(ubman, 'fdt-out.dtb')\n+ ramdisk_out = self.make_fname(ubman, 'ramdisk-out.bin')\n+ loadables1_out = self.make_fname(ubman, 'loadables1-out.bin')\n+ loadables2_out = self.make_fname(ubman, 'loadables2-out.bin')\n \n # Set up basic parameters with default values\n params = {\n@@ -283,32 +300,32 @@ def test_fit_base(ubman):\n 'kernel' : kernel,\n 'kernel_out' : kernel_out,\n 'kernel_addr' : 0x40000,\n- 'kernel_size' : filesize(kernel),\n+ 'kernel_size' : self.filesize(kernel),\n 'kernel_config' : 'kernel = \"kernel-1\";',\n \n 'fdt' : fdt,\n 'fdt_out' : fdt_out,\n 'fdt_addr' : 0x80000,\n- 'fdt_size' : filesize(fdt_data),\n+ 'fdt_size' : self.filesize(fdt_data),\n 'fdt_load' : '',\n \n 'ramdisk' : ramdisk,\n 'ramdisk_out' : ramdisk_out,\n 'ramdisk_addr' : 0xc0000,\n- 'ramdisk_size' : filesize(ramdisk),\n+ 'ramdisk_size' : self.filesize(ramdisk),\n 'ramdisk_load' : '',\n 'ramdisk_config' : '',\n \n 'loadables1' : loadables1,\n 'loadables1_out' : loadables1_out,\n 'loadables1_addr' : 0x100000,\n- 'loadables1_size' : filesize(loadables1),\n+ 'loadables1_size' : self.filesize(loadables1),\n 'loadables1_load' : '',\n \n 'loadables2' : loadables2,\n 'loadables2_out' : loadables2_out,\n 'loadables2_addr' : 0x140000,\n- 'loadables2_size' : filesize(loadables2),\n+ 'loadables2_size' : self.filesize(loadables2),\n 'loadables2_load' : '',\n \n 'loadables_config' : '',\n@@ -316,35 +333,35 @@ def test_fit_base(ubman):\n }\n \n # Make a basic FIT and a script to load it\n- fit = fit_util.make_fit(ubman, mkimage, base_its, params)\n+ fit = fit_util.make_fit(ubman, mkimage, BASE_ITS, params)\n params['fit'] = fit\n- cmd = base_script % params\n+ cmd = BASE_SCRIPT % params\n \n # First check that we can load a kernel\n # We could perhaps reduce duplication with some loss of readability\n with ubman.log.section('Kernel load'):\n output = ubman.run_command_list(cmd.splitlines())\n- check_equal(kernel, kernel_out, 'Kernel not loaded')\n- check_not_equal(fdt_data, fdt_out,\n- 'FDT loaded but should be ignored')\n- check_not_equal(ramdisk, ramdisk_out,\n- 'Ramdisk loaded but should not be')\n+ self.check_equal(kernel, kernel_out, 'Kernel not loaded')\n+ self.check_not_equal(fdt_data, fdt_out,\n+ 'FDT loaded but should be ignored')\n+ self.check_not_equal(ramdisk, ramdisk_out,\n+ 'Ramdisk loaded but should not be')\n \n # Find out the offset in the FIT where U-Boot has found the FDT\n- line = find_matching(output, 'Booting using the fdt blob at ')\n+ line = self.find_matching(output, 'Booting using the fdt blob at ')\n fit_offset = int(line, 16) - params['fit_addr']\n fdt_magic = struct.pack('>L', 0xd00dfeed)\n- data = read_file(fit)\n+ data = self.read_file(fit)\n \n # Now find where it actually is in the FIT (skip the first word)\n real_fit_offset = data.find(fdt_magic, 4)\n assert fit_offset == real_fit_offset, (\n- 'U-Boot loaded FDT from offset %#x, FDT is actually at %#x' %\n- (fit_offset, real_fit_offset))\n+ 'U-Boot loaded FDT from offset %#x, FDT is actually at %#x' %\n+ (fit_offset, real_fit_offset))\n \n- # Check if bootargs strings substitution works\n+ # Check bootargs string substitution\n output = ubman.run_command_list([\n- 'env set bootargs \\\\\\\"\\'my_boot_var=${foo}\\'\\\\\\\"',\n+ 'env set bootargs \\\\\"\\'my_boot_var=${foo}\\'\\\\\"',\n 'env set foo bar',\n 'bootm prep',\n 'env print bootargs'])\n@@ -353,56 +370,63 @@ def test_fit_base(ubman):\n # Now a kernel and an FDT\n with ubman.log.section('Kernel + FDT load'):\n params['fdt_load'] = 'load = <%#x>;' % params['fdt_addr']\n- fit = fit_util.make_fit(ubman, mkimage, base_its, params)\n+ fit = fit_util.make_fit(ubman, mkimage, BASE_ITS, params)\n+ params['fit'] = fit\n+ cmd = BASE_SCRIPT % params\n output = ubman.run_command_list(cmd.splitlines())\n- check_equal(kernel, kernel_out, 'Kernel not loaded')\n- check_equal(fdt_data, fdt_out, 'FDT not loaded')\n- check_not_equal(ramdisk, ramdisk_out,\n- 'Ramdisk loaded but should not be')\n+ self.check_equal(kernel, kernel_out, 'Kernel not loaded')\n+ self.check_equal(fdt_data, fdt_out, 'FDT not loaded')\n+ self.check_not_equal(ramdisk, ramdisk_out,\n+ 'Ramdisk loaded but should not be')\n \n # Try a ramdisk\n with ubman.log.section('Kernel + FDT + Ramdisk load'):\n params['ramdisk_config'] = 'ramdisk = \"ramdisk-1\";'\n params['ramdisk_load'] = 'load = <%#x>;' % params['ramdisk_addr']\n- fit = fit_util.make_fit(ubman, mkimage, base_its, params)\n+ fit = fit_util.make_fit(ubman, mkimage, BASE_ITS, params)\n+ params['fit'] = fit\n+ cmd = BASE_SCRIPT % params\n output = ubman.run_command_list(cmd.splitlines())\n- check_equal(ramdisk, ramdisk_out, 'Ramdisk not loaded')\n+ self.check_equal(ramdisk, ramdisk_out, 'Ramdisk not loaded')\n \n # Configuration with some Loadables\n with ubman.log.section('Kernel + FDT + Ramdisk load + Loadables'):\n params['loadables_config'] = 'loadables = \"kernel-2\", \"ramdisk-2\";'\n params['loadables1_load'] = ('load = <%#x>;' %\n- params['loadables1_addr'])\n+ params['loadables1_addr'])\n params['loadables2_load'] = ('load = <%#x>;' %\n- params['loadables2_addr'])\n- fit = fit_util.make_fit(ubman, mkimage, base_its, params)\n+ params['loadables2_addr'])\n+ fit = fit_util.make_fit(ubman, mkimage, BASE_ITS, params)\n+ params['fit'] = fit\n+ cmd = BASE_SCRIPT % params\n output = ubman.run_command_list(cmd.splitlines())\n- check_equal(loadables1, loadables1_out,\n- 'Loadables1 (kernel) not loaded')\n- check_equal(loadables2, loadables2_out,\n- 'Loadables2 (ramdisk) not loaded')\n+ self.check_equal(loadables1, loadables1_out,\n+ 'Loadables1 (kernel) not loaded')\n+ self.check_equal(loadables2, loadables2_out,\n+ 'Loadables2 (ramdisk) not loaded')\n \n # Kernel, FDT and Ramdisk all compressed\n with ubman.log.section('(Kernel + FDT + Ramdisk) compressed'):\n params['compression'] = 'gzip'\n- params['kernel'] = make_compressed(kernel)\n- params['fdt'] = make_compressed(fdt)\n- params['ramdisk'] = make_compressed(ramdisk)\n- fit = fit_util.make_fit(ubman, mkimage, base_its, params)\n+ params['kernel'] = self.make_compressed(ubman, kernel)\n+ params['fdt'] = self.make_compressed(ubman, fdt)\n+ params['ramdisk'] = self.make_compressed(ubman, ramdisk)\n+ fit = fit_util.make_fit(ubman, mkimage, BASE_ITS, params)\n+ params['fit'] = fit\n+ cmd = BASE_SCRIPT % params\n output = ubman.run_command_list(cmd.splitlines())\n- check_equal(kernel, kernel_out, 'Kernel not loaded')\n- check_equal(fdt_data, fdt_out, 'FDT not loaded')\n- check_not_equal(ramdisk, ramdisk_out, 'Ramdisk got decompressed?')\n- check_equal(ramdisk + '.gz', ramdisk_out, 'Ramdisk not loaded')\n+ self.check_equal(kernel, kernel_out, 'Kernel not loaded')\n+ self.check_equal(fdt_data, fdt_out, 'FDT not loaded')\n+ self.check_not_equal(ramdisk, ramdisk_out, 'Ramdisk got decompressed?')\n+ self.check_equal(ramdisk + '.gz', ramdisk_out, 'Ramdisk not loaded')\n \n # Try without a kernel\n with ubman.log.section('No kernel + FDT'):\n params['kernel_config'] = ''\n params['ramdisk_config'] = ''\n params['ramdisk_load'] = ''\n- fit = fit_util.make_fit(ubman, mkimage, base_its, params)\n+ fit = fit_util.make_fit(ubman, mkimage, BASE_ITS, params)\n+ params['fit'] = fit\n+ cmd = BASE_SCRIPT % params\n output = ubman.run_command_list(cmd.splitlines())\n assert \"can't get kernel image!\" in '\\n'.join(output)\n-\n- mkimage = ubman.config.build_dir + '/tools/mkimage'\n- run_fit_test(mkimage)\n", "prefixes": [ "5/6" ] }