get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/1.2/patches/2219911/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2219911,
    "url": "http://patchwork.ozlabs.org/api/1.2/patches/2219911/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20260405111206.945185-8-sjg@chromium.org/",
    "project": {
        "id": 18,
        "url": "http://patchwork.ozlabs.org/api/1.2/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": "<20260405111206.945185-8-sjg@chromium.org>",
    "list_archive_url": null,
    "date": "2026-04-05T11:11:52",
    "name": "[v2,7/8] test: Add fsetup fixture and prepare helper for FIT test",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "ffb92fd5c016d28cab3e9e3eb7290e988a9f92a3",
    "submitter": {
        "id": 6170,
        "url": "http://patchwork.ozlabs.org/api/1.2/people/6170/?format=api",
        "name": "Simon Glass",
        "email": "sjg@chromium.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20260405111206.945185-8-sjg@chromium.org/mbox/",
    "series": [
        {
            "id": 498774,
            "url": "http://patchwork.ozlabs.org/api/1.2/series/498774/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=498774",
            "date": "2026-04-05T11:11:45",
            "name": "test: Refactor FIT test for clarity and extensibility",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/498774/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2219911/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2219911/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=EZwCpSv3;\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=\"EZwCpSv3\";\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 4fpVFK1Nnnz1yD3\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 05 Apr 2026 21:13:25 +1000 (AEST)",
            "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 76CC784132;\n\tSun,  5 Apr 2026 13:12:50 +0200 (CEST)",
            "by phobos.denx.de (Postfix, from userid 109)\n id 8DF5084144; Sun,  5 Apr 2026 13:12:47 +0200 (CEST)",
            "from mail-oi1-x231.google.com (mail-oi1-x231.google.com\n [IPv6:2607:f8b0:4864:20::231])\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 9A8A884105\n for <u-boot@lists.denx.de>; Sun,  5 Apr 2026 13:12:43 +0200 (CEST)",
            "by mail-oi1-x231.google.com with SMTP id\n 5614622812f47-470145d7df5so1013638b6e.0\n for <u-boot@lists.denx.de>; Sun, 05 Apr 2026 04:12:43 -0700 (PDT)",
            "from chromium.org ([73.34.74.121]) by smtp.gmail.com with ESMTPSA id\n 5614622812f47-46d8d109b69sm6414382b6e.0.2026.04.05.04.12.38\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Sun, 05 Apr 2026 04:12:39 -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.6 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=1775387562; x=1775992362; 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=aEYrJQkEAcr3JpkQxN9U8byArabKvvJJW6GVGLaBlGk=;\n b=EZwCpSv3HkgXnMAShtlnmzyvlHsXhnb6HaCBR4OpTOh3mivlHdAzuqTQ+mXmAXxOMk\n rY9Iq4EAeXRBrMGdOTJbJIYXMNMPtVJPSeC6Aun+F6WyM8gxdj6JRw78XG6DwjBxUHl3\n oqYguAC4BM0kklYE6JtozBYpJSM9ef8SvFg0U=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775387562; x=1775992362;\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=aEYrJQkEAcr3JpkQxN9U8byArabKvvJJW6GVGLaBlGk=;\n b=pPWYW6GIDXW9/w32WQ9y33bcumS2Gt0t4LUUQEtZIifYI5wK0gXc/YgIYpHZktkvvC\n 6jNxz8jPsL1IadPi24M1V+BdEZYM9VNGDtzXvDBdAKU0FdliJt7YSyDk0zkp9PwkOatz\n zhn+8bYTuDhpCmwt8YbNs0n2g5RkcOlIdHVZ52Rka4Rx6LGmuK27QxqUlFdlV036SZD+\n NmZRFxk2DccKBGcv2+5BwWFK9kVGYRZpA3inmRmdFeyvrLlP6ppTndnfpSTI7Wxkuk8e\n 7+JyB2KdKeARxxl934B8OL3Suh3tdNUgyvFgkrty9n7DfWZyD2kcR0JBcWcxk9eiR25r\n 4BQw==",
        "X-Gm-Message-State": "AOJu0Yw9P4mdCosB0eZ0z8jfO1EjOMUWroXQc3LssYEUrQwakv+qpi10\n 2JqMLY4gOl5wUZ16VEVudo8FPlbEGcAtYFBOj/4kj6IHN0kXPaatUw21cYl9Ox4kzOQgHVHsY1W\n x+wGdAw==",
        "X-Gm-Gg": "AeBDievIxx13BRsiKHBEPs91yD8roVP4M15JgszfvMWoJEf2of3nKnSYVYC5uQaaM6R\n pQDNF8H9Nw8whYQ4RY8ZXZm5rX1DNhE40KjkrB+gDQVatfVwgwGE2WpP/nMK0kK1+rBABUvBrIB\n e2xBTv4fylhN1iHsAvvVIfjGodtaphu9Z1+vrDLDShrVG8/TykEEP1DLhkv4YmFhukJGLybslec\n wvdAHAGrSgq9nRf7j1bu+mXURRJNxa4gi5gDv4tK4i+yuJsqAi78wU3qfiYALi4eog4ODlYoi0k\n OqcmL4gQ8el5/HR0+9+CqquV9kOUpwPAreei6zgK2fl/6z3+CsS0OSiCQ634/VvugTsev5jaGZl\n X9KAEyvqj9n7/jVTNMGP2TglbLpGaI+nZWNB5+n60hYJN229ZWGTXdUK99LKVsgi2+lDpzFlTz1\n wj4n2gSamNn9Z6RVgsiA==",
        "X-Received": "by 2002:a05:6808:320f:b0:467:1504:eb13 with SMTP id\n 5614622812f47-46efb2cc160mr4897913b6e.36.1775387561700;\n Sun, 05 Apr 2026 04:12:41 -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 v2 7/8] test: Add fsetup fixture and prepare helper for FIT\n test",
        "Date": "Sun,  5 Apr 2026 05:11:52 -0600",
        "Message-ID": "<20260405111206.945185-8-sjg@chromium.org>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20260405111206.945185-1-sjg@chromium.org>",
        "References": "<20260405111206.945185-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": "Create an 'fsetup' fixture which sets up files and parameters, and a\nprepare() helper which builds a FIT with given parameter overrides.\n\nUpdate check_equal() and check_not_equal() to look up filenames from a\nparams dict by key, reducing the number of local variables needed.\n\nSplit the single test_fit_operations() into individual test functions so\nthat each appears separately in the results.\n\nSigned-off-by: Simon Glass <sjg@chromium.org>\n---\n\n(no changes since v1)\n\n test/py/tests/test_fit.py | 286 +++++++++++++++++++-------------------\n 1 file changed, 146 insertions(+), 140 deletions(-)",
    "diff": "diff --git a/test/py/tests/test_fit.py b/test/py/tests/test_fit.py\nindex aec52985c65..7c94eb0ac44 100755\n--- a/test/py/tests/test_fit.py\n+++ b/test/py/tests/test_fit.py\n@@ -227,91 +227,70 @@ class TestFitImage:\n         pytest.fail(\"Expected '%s' but not found in output\")\n         return '<no-match>'\n \n-    def check_equal(self, expected_fname, actual_fname, failure_msg):\n+    def check_equal(self, params, expected_key, actual_key, 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         script anyway, which in some cases may be larger than what we're\n         actually looking for. So it's safe to truncate it to the size of the\n         expected data.\n-\n-        Args:\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 = self.read_file(expected_fname)\n-        actual_data = self.read_file(actual_fname)\n+        expected_data = self.read_file(params[expected_key])\n+        actual_data = self.read_file(params[actual_key])\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(self, expected_fname, actual_fname, failure_msg):\n-        \"\"\"Check that a file does not match its expected contents\n-\n-        Args:\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 = self.read_file(expected_fname)\n-        actual_data = self.read_file(actual_fname)\n+    def check_not_equal(self, params, expected_key, actual_key, failure_msg):\n+        \"\"\"Check that a file does not match its expected contents\"\"\"\n+        expected_data = self.read_file(params[expected_key])\n+        actual_data = self.read_file(params[actual_key])\n         assert expected_data != actual_data, failure_msg\n \n-    def test_fit_operations(self, ubman):\n-        \"\"\"Basic sanity check of FIT loading in U-Boot\n-\n-        This test covers various FIT configurations and verifies correct behavior.\n-\n-        Args:\n-            ubman (ConsoleBase): U-Boot fixture\n-        \"\"\"\n+    @pytest.fixture()\n+    def fsetup(self, ubman):\n+        \"\"\"Set up files and default parameters for FIT tests\"\"\"\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         kernel = fit_util.make_kernel(ubman, 'test-kernel.bin', 'kernel')\n         ramdisk = self.make_ramdisk(ubman, 'test-ramdisk.bin', 'ramdisk')\n-        loadables1 = fit_util.make_kernel(ubman, 'test-loadables1.bin', 'lenrek')\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+        loadables1 = fit_util.make_kernel(ubman, 'test-loadables1.bin',\n+                                          'lenrek')\n+        loadables2 = self.make_ramdisk(ubman, 'test-loadables2.bin',\n+                                       'ksidmar')\n+\n+        yield {\n+            'mkimage' : mkimage,\n             'fit_addr' : 0x1000,\n \n             'kernel' : kernel,\n-            'kernel_out' : kernel_out,\n+            'kernel_out' : self.make_fname(ubman, 'kernel-out.bin'),\n             'kernel_addr' : 0x40000,\n             'kernel_size' : self.filesize(kernel),\n             'kernel_config' : 'kernel = \"kernel-1\";',\n \n-            'fdt' : fdt,\n-            'fdt_out' : fdt_out,\n+            'fdt_data' : fdt_data,\n+            'fdt' : self.make_fname(ubman, 'u-boot.dtb'),\n+            'fdt_out' : self.make_fname(ubman, 'fdt-out.dtb'),\n             'fdt_addr' : 0x80000,\n             'fdt_size' : self.filesize(fdt_data),\n             'fdt_load' : '',\n \n             'ramdisk' : ramdisk,\n-            'ramdisk_out' : ramdisk_out,\n+            'ramdisk_out' : self.make_fname(ubman, 'ramdisk-out.bin'),\n             'ramdisk_addr' : 0xc0000,\n             'ramdisk_size' : self.filesize(ramdisk),\n             'ramdisk_load' : '',\n             'ramdisk_config' : '',\n \n             'loadables1' : loadables1,\n-            'loadables1_out' : loadables1_out,\n+            'loadables1_out' : self.make_fname(ubman, 'loadables1-out.bin'),\n             'loadables1_addr' : 0x100000,\n             'loadables1_size' : self.filesize(loadables1),\n             'loadables1_load' : '',\n \n             'loadables2' : loadables2,\n-            'loadables2_out' : loadables2_out,\n+            'loadables2_out' : self.make_fname(ubman, 'loadables2-out.bin'),\n             'loadables2_addr' : 0x140000,\n             'loadables2_size' : self.filesize(loadables2),\n             'loadables2_load' : '',\n@@ -320,101 +299,128 @@ class TestFitImage:\n             'compression' : 'none',\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+    def prepare(self, ubman, fsetup, **kwargs):\n+        \"\"\"Build a FIT with given overrides\n+\n+        Args:\n+            ubman (ConsoleBase): U-Boot fixture\n+            fsetup (dict): Default parameters from the fsetup fixture\n+            kwargs: Parameter overrides for this particular test\n+\n+        Return:\n+            tuple:\n+                list of str: Commands to run for the test\n+                dict: Parameters used by the test\n+                str: Filename of the FIT that was created\n+        \"\"\"\n+        params = {**fsetup, **kwargs}\n+        fit = fit_util.make_fit(ubman, params['mkimage'], BASE_ITS, params)\n         params['fit'] = fit\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-            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 = 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 = 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+        cmds = (BASE_SCRIPT % params).splitlines()\n+        return cmds, params, fit\n+\n+    def test_fit_kernel_load(self, ubman, fsetup):\n+        \"\"\"Test loading a FIT image with only a kernel\"\"\"\n+        cmds, params, fit = self.prepare(ubman, fsetup)\n+\n+        output = ubman.run_command_list(cmds)\n+        self.check_equal(params, 'kernel', 'kernel_out', 'Kernel not loaded')\n+        self.check_not_equal(params, 'fdt_data', 'fdt_out',\n+                             'FDT loaded but should be ignored')\n+        self.check_not_equal(params, '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 = 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 = 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 \n         # Check bootargs string substitution\n-            output = ubman.run_command_list([\n-                'env set bootargs \\\\\"\\'my_boot_var=${foo}\\'\\\\\"',\n-                'env set foo bar',\n-                'bootm prep',\n-                'env print bootargs'])\n-            assert 'bootargs=\"my_boot_var=bar\"' in output, \"Bootargs strings not substituted\"\n-\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-            params['fit'] = fit\n-            cmd = BASE_SCRIPT % params\n-            output = ubman.run_command_list(cmd.splitlines())\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-            params['fit'] = fit\n-            cmd = BASE_SCRIPT % params\n-            output = ubman.run_command_list(cmd.splitlines())\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['loadables2_load'] = ('load = <%#x>;' %\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-            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'] = 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-            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-            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+        output = ubman.run_command_list([\n+            'env set bootargs \\\\\"\\'my_boot_var=${foo}\\'\\\\\"',\n+            'env set foo bar',\n+            'bootm prep',\n+            'env print bootargs'])\n+        assert 'bootargs=\"my_boot_var=bar\"' in output, \\\n+                \"Bootargs strings not substituted\"\n+\n+    def test_fit_kernel_fdt_load(self, ubman, fsetup):\n+        \"\"\"Test loading a FIT image with a kernel and FDT\"\"\"\n+        cmds, params, _ = self.prepare(\n+            ubman, fsetup,\n+            fdt_load='load = <%#x>;' % fsetup['fdt_addr'])\n+\n+        ubman.run_command_list(cmds)\n+        self.check_equal(params, 'kernel', 'kernel_out', 'Kernel not loaded')\n+        self.check_equal(params, 'fdt_data', 'fdt_out', 'FDT not loaded')\n+        self.check_not_equal(params, 'ramdisk', 'ramdisk_out',\n+                             'Ramdisk loaded but should not be')\n+\n+    def test_fit_kernel_fdt_ramdisk_load(self, ubman, fsetup):\n+        \"\"\"Test loading a FIT image with kernel, FDT, and ramdisk\"\"\"\n+        cmds, params, _ = self.prepare(\n+            ubman, fsetup,\n+            fdt_load='load = <%#x>;' % fsetup['fdt_addr'],\n+            ramdisk_config='ramdisk = \"ramdisk-1\";',\n+            ramdisk_load='load = <%#x>;' % fsetup['ramdisk_addr'])\n+\n+        ubman.run_command_list(cmds)\n+        self.check_equal(params, 'ramdisk', 'ramdisk_out',\n+                         'Ramdisk not loaded')\n+\n+    def test_fit_loadables_load(self, ubman, fsetup):\n+        \"\"\"Test a configuration with loadables\"\"\"\n+        cmds, params, _ = self.prepare(\n+            ubman, fsetup,\n+            fdt_load='load = <%#x>;' % fsetup['fdt_addr'],\n+            ramdisk_config='ramdisk = \"ramdisk-1\";',\n+            ramdisk_load='load = <%#x>;' % fsetup['ramdisk_addr'],\n+            loadables_config='loadables = \"kernel-2\", \"ramdisk-2\";',\n+            loadables1_load='load = <%#x>;' % fsetup['loadables1_addr'],\n+            loadables2_load='load = <%#x>;' % fsetup['loadables2_addr'])\n+\n+        ubman.run_command_list(cmds)\n+        self.check_equal(params, 'loadables1', 'loadables1_out',\n+                         'Loadables1 (kernel) not loaded')\n+        self.check_equal(params, 'loadables2', 'loadables2_out',\n+                         'Loadables2 (ramdisk) not loaded')\n+\n+    def test_fit_compressed_images_load(self, ubman, fsetup):\n+        \"\"\"Test loading compressed kernel, FDT, and ramdisk images\"\"\"\n+        cmds, params, _ = self.prepare(\n+            ubman, fsetup,\n+            fdt_load='load = <%#x>;' % fsetup['fdt_addr'],\n+            ramdisk_config='ramdisk = \"ramdisk-1\";',\n+            ramdisk_load='load = <%#x>;' % fsetup['ramdisk_addr'],\n+            compression='gzip',\n+            kernel=self.make_compressed(ubman, fsetup['kernel']),\n+            fdt=self.make_compressed(ubman, fsetup['fdt']),\n+            ramdisk=self.make_compressed(ubman, fsetup['ramdisk']))\n+\n+        ubman.run_command_list(cmds)\n+        self.check_equal(fsetup, 'kernel', 'kernel_out',\n+                         'Kernel not loaded')\n+        self.check_equal(fsetup, 'fdt_data', 'fdt_out', 'FDT not loaded')\n+        self.check_not_equal(fsetup, 'ramdisk', 'ramdisk_out',\n+                             'Ramdisk got decompressed?')\n+        self.check_equal(params, 'ramdisk', 'ramdisk_out',\n+                         'Ramdisk not loaded')\n+\n+    def test_fit_no_kernel_load(self, ubman, fsetup):\n+        \"\"\"Test that bootm fails when no kernel is specified\"\"\"\n+        cmds = self.prepare(\n+            ubman, fsetup,\n+            fdt_load='load = <%#x>;' % fsetup['fdt_addr'],\n+            kernel_config='',\n+            ramdisk_config='',\n+            ramdisk_load='')[0]\n+\n+        output = ubman.run_command_list(cmds)\n+        assert \"can't get kernel image!\" in '\\n'.join(output)\n",
    "prefixes": [
        "v2",
        "7/8"
    ]
}