{"id":2222500,"url":"http://patchwork.ozlabs.org/api/1.2/patches/2222500/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/20260412111958.943933-13-sjg@chromium.org/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/1.2/projects/18/?format=json","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":"<20260412111958.943933-13-sjg@chromium.org>","list_archive_url":null,"date":"2026-04-12T11:19:49","name":"[v2,12/12] test: fs: Update Python tests to call C implementations","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"a4a7c4613f3a435eda323792c540428a48d316f2","submitter":{"id":6170,"url":"http://patchwork.ozlabs.org/api/1.2/people/6170/?format=json","name":"Simon Glass","email":"sjg@chromium.org"},"delegate":{"id":3651,"url":"http://patchwork.ozlabs.org/api/1.2/users/3651/?format=json","username":"trini","first_name":"Tom","last_name":"Rini","email":"trini@ti.com"},"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/20260412111958.943933-13-sjg@chromium.org/mbox/","series":[{"id":499596,"url":"http://patchwork.ozlabs.org/api/1.2/series/499596/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=499596","date":"2026-04-12T11:19:37","name":"test: Add support for passing arguments to C unit tests","version":2,"mbox":"http://patchwork.ozlabs.org/series/499596/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2222500/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2222500/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=ULkQIls0;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=85.214.62.61; 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=\"ULkQIls0\";\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 [85.214.62.61])\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 4ftpBB0NVqz1yCx\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 12 Apr 2026 21:25:38 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id E66DD84227;\n\tSun, 12 Apr 2026 13:24:40 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id D10BB841D7; Sun, 12 Apr 2026 13:24:39 +0200 (CEST)","from mail-ot1-x32a.google.com (mail-ot1-x32a.google.com\n [IPv6:2607:f8b0:4864:20::32a])\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 30B1184222\n for <u-boot@lists.denx.de>; Sun, 12 Apr 2026 13:24:37 +0200 (CEST)","by mail-ot1-x32a.google.com with SMTP id\n 46e09a7af769-7dbcf927395so2052162a34.0\n for <u-boot@lists.denx.de>; Sun, 12 Apr 2026 04:24:37 -0700 (PDT)","from chromium.org ([73.34.74.121]) by smtp.gmail.com with ESMTPSA id\n 586e51a60fabf-423dd395606sm6622071fac.1.2026.04.12.04.24.32\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Sun, 12 Apr 2026 04:24:34 -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=1775993075; x=1776597875; 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=7ZEcZEYVEXNb8uU8+BrYsp2Wj3HiMZ08j0r/2uf5zrw=;\n b=ULkQIls0YRFQTbUh18p41xNdrCMxmnlzLTB4mpT0hUG4XpseTUDWKMOKrYO1fR5mP1\n hpT9K/pq2nO+bic/o7JL2ehyZ5eDc3aNeOR85Q88JDbKcEvyMZPPyG+2TKMTW9AvYqjO\n 7MnwrV3rnhGzgE/9lvSFSyQeQTfKF4+5NrRFI=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775993075; x=1776597875;\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=7ZEcZEYVEXNb8uU8+BrYsp2Wj3HiMZ08j0r/2uf5zrw=;\n b=pBFtCnFfoNABH7qGgIK5W/ixR5OFD5s/dCrS6TXm4Mt+GsYUN2gDYs6maK0DI3gmqR\n zTG1iqpw7b5f8+n7Eoe0XRS8KW+0J97Ko2BgZGJePCPgUYaAd6R31xrOAnloBAf7Ql9e\n aM8WjZWfcxNgj+bID0Q3ikqQ0Mm6vKN61pF7WnwlfE/GMO+yRPRwA1WmLjC16A18rjdC\n 2GJWbVBaVCbVszget44Ct57DJcUiW3X96QZPb2fKxcVsr8v9J2afD747Fgj544O0+P9u\n XQ19U9OFhcZ2nvwAJoq0aM8MeNPVPxeOpZ5w3Lkj4rxzdpS+i3ZgXgSTcgGaM1k6aNuv\n BWyw==","X-Gm-Message-State":"AOJu0YyjaMTCaiXzv3bdKs22qDItHYjqVC8ZHUMQ+UjzUQjyWRwX3YtX\n vSOAIpP45bcMpydFCQDwoLAOMNx/WqRCD/0XeNwY0D9HWvfI4R5KoKn0FJdegTe7nX5a7tcOTkt\n h/YsCnw==","X-Gm-Gg":"AeBDiesTmJ2WRskBpPx2vQfvYLrfj/4VA8jGnk4jeI3Hreac2qrPbSuLeojCG8htB+9\n oERomNRuVWTXChAcr3N6SqQavxrhadRK8Tk4j4Miqt+b6GsPdyByXeCifIDlIfiZ821QTg5fzIc\n YXfyesaDqaUIKBBSyhZcwDSOmx2G6Zffk8zTyTW+QDmKnUQbb2/BT1M6NHPWf0w/qajTr179Ib/\n iLCcZKKkheu6K/4j4l8kbbcr//DbkX9j/uaE4+0S/AA6icBWdbj5ekI+1+j1oz5Asas2lX8fHr5\n 68pE80IBmYiWUkZ0m5FY3/4/GzeCCqGMRKzGSVmWsPyxdmyyXgt2133r0tvSHMtUH1gb9pOuMaU\n fOdPbus4DqbUhTCxmKh4cTproavxI0eWKwFvLJXShTv3p+++64agpuxVIw96fzFl0n61xLIc9zg\n tH7oovX7dVFcjTqCSCAw==","X-Received":"by 2002:a4a:e84a:0:b0:67f:abdd:24b9 with SMTP id\n 006d021491bc7-68be7de9138mr4524053eaf.29.1775993074954;\n Sun, 12 Apr 2026 04:24:34 -0700 (PDT)","From":"Simon Glass <sjg@chromium.org>","To":"u-boot@lists.denx.de","Cc":"Tom Rini <trini@konsulko.com>, Heinrich Schuchardt <xypron.glpk@gmx.de>,\n Simon Glass <sjg@chromium.org>, Marek Vasut <marex@denx.de>","Subject":"[PATCH v2 12/12] test: fs: Update Python tests to call C\n implementations","Date":"Sun, 12 Apr 2026 05:19:49 -0600","Message-ID":"<20260412111958.943933-13-sjg@chromium.org>","X-Mailer":"git-send-email 2.43.0","In-Reply-To":"<20260412111958.943933-1-sjg@chromium.org>","References":"<20260412111958.943933-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":"Update test_basic.py to call the new C-based filesystem tests via the\n'ut' command. This allows tests to run more directly, calling the actual\nFS layer, without having to go through the command interface and\nworrying about which filesystem command to use.\n\nSigned-off-by: Simon Glass <sjg@chromium.org>\n---\n\n(no changes since v1)\n\n test/py/tests/test_fs/conftest.py   |   4 +-\n test/py/tests/test_fs/test_basic.py | 346 ++++++++--------------------\n 2 files changed, 98 insertions(+), 252 deletions(-)","diff":"diff --git a/test/py/tests/test_fs/conftest.py b/test/py/tests/test_fs/conftest.py\nindex 0205048e73a..5fc796097e3 100644\n--- a/test/py/tests/test_fs/conftest.py\n+++ b/test/py/tests/test_fs/conftest.py\n@@ -198,8 +198,6 @@ def fs_obj_basic(request, u_boot_config):\n         volume file name and  a list of MD5 hashes.\n     \"\"\"\n     fs_type = request.param\n-    fs_cmd_prefix = fstype_to_prefix(fs_type)\n-    fs_cmd_write = 'save' if fs_type == 'fs_generic' or fs_type == 'exfat' else 'write'\n     fs_img = ''\n \n     fs_ubtype = fstype_to_ubname(fs_type)\n@@ -289,7 +287,7 @@ def fs_obj_basic(request, u_boot_config):\n         pytest.skip('Setup failed for filesystem: ' + fs_type + '. {}'.format(err))\n         return\n     else:\n-        yield [fs_ubtype, fs_cmd_prefix, fs_cmd_write, fs_img, md5val]\n+        yield [fs_ubtype, fs_img, md5val]\n     finally:\n         call('rm -rf %s' % scratch_dir, shell=True)\n         call('rm -f %s' % fs_img, shell=True)\ndiff --git a/test/py/tests/test_fs/test_basic.py b/test/py/tests/test_fs/test_basic.py\nindex 88b163ce305..7f805d04dd5 100644\n--- a/test/py/tests/test_fs/test_basic.py\n+++ b/test/py/tests/test_fs/test_basic.py\n@@ -6,298 +6,146 @@\n \n \"\"\"\n This test verifies basic read/write operation on file system.\n+\n+Tests are implemented in C (test/fs/fs_basic.c) and called from here.\n+Python handles filesystem image setup and environment variable configuration.\n \"\"\"\n \n import pytest\n-import re\n-from fstest_defs import *\n+from fstest_defs import SMALL_FILE, BIG_FILE\n from fstest_helpers import assert_fs_integrity\n \n-@pytest.mark.boardspec('sandbox')\n-@pytest.mark.slow\n-class TestFsBasic(object):\n-    def test_fs1(self, ubman, fs_obj_basic):\n-        \"\"\"\n-        Test Case 1 - ls command, listing a root directory and invalid directory\n-        \"\"\"\n-        fs_type,fs_cmd_prefix,fs_cmd_write,fs_img,md5val = fs_obj_basic\n-        with ubman.log.section('Test Case 1a - ls'):\n-            # Test Case 1 - ls\n-            output = ubman.run_command_list([\n-                'host bind 0 %s' % fs_img,\n-                '%sls host 0:0' % fs_cmd_prefix])\n-            assert(re.search('2621440000 *%s' % BIG_FILE, ''.join(output)))\n-            assert(re.search('1048576 *%s' % SMALL_FILE, ''.join(output)))\n \n-        with ubman.log.section('Test Case 1b - ls (invalid dir)'):\n-            # In addition, test with a nonexistent directory to see if we crash.\n-            output = ubman.run_command(\n-                '%sls host 0:0 invalid_d' % fs_cmd_prefix)\n-            assert('' == output)\n+def run_c_test(ubman, fs_type, fs_img, test_name, small=None, big=None,\n+               md5val=None):\n+    \"\"\"Run a C unit test with proper setup.\n \n-        with ubman.log.section('Test Case 1c - test -e'):\n-            # Test Case 1 - test -e\n-            output = ubman.run_command_list([\n-                'host bind 0 %s' % fs_img,\n-                'test -e host 0:0 1MB.file && echo PASS'])\n-            assert('PASS' in ''.join(output))\n+    Args:\n+        ubman (ConsoleBase): U-Boot console manager\n+        fs_type (str): Filesystem type (ext4, fat, fs_generic, exfat)\n+        fs_img (str): Path to filesystem image\n+        test_name (str): Name of C test function (without _norun suffix)\n+        small (str): Filename of small test file (optional)\n+        big (str): Filename of big test file (optional)\n+        md5val (str): Expected MD5 value for verification (optional)\n \n-        with ubman.log.section('Test Case 1d - test -e (invalid file)'):\n-            # In addition, test with a nonexistent file to see if we crash.\n-            output = ubman.run_command(\n-                'test -e host 0:0 2MB.file || echo PASS')\n-            assert('PASS' in ''.join(output))\n+    Returns:\n+        bool: True if test passed, False otherwise\n+    \"\"\"\n+    # Build the command with arguments\n+    cmd = f'ut -f fs {test_name}_norun fs_type={fs_type} fs_image={fs_img}'\n+    if small:\n+        cmd += f' small={small}'\n+    if big:\n+        cmd += f' big={big}'\n+    if md5val:\n+        cmd += f' md5val={md5val}'\n \n-    def test_fs2(self, ubman, fs_obj_basic):\n-        \"\"\"\n-        Test Case 2 - size command for a small file\n-        \"\"\"\n-        fs_type,fs_cmd_prefix,fs_cmd_write,fs_img,md5val = fs_obj_basic\n-        with ubman.log.section('Test Case 2a - size (small)'):\n-            # 1MB is 0x0010 0000\n-            # Test Case 2a - size of small file\n-            output = ubman.run_command_list([\n-                'host bind 0 %s' % fs_img,\n-                '%ssize host 0:0 /%s' % (fs_cmd_prefix, SMALL_FILE),\n-                'printenv filesize',\n-                'setenv filesize'])\n-            assert('filesize=100000' in ''.join(output))\n+    # Run the C test\n+    ubman.run_command(cmd)\n+\n+    # Check result\n+    result = ubman.run_command('echo $?')\n+    return result.strip() == '0'\n+\n+\n+@pytest.mark.boardspec('sandbox')\n+@pytest.mark.slow\n+class TestFsBasic:\n+    \"\"\"Test basic filesystem operations via C unit tests.\"\"\"\n+\n+    def test_fs1(self, ubman, fs_obj_basic):\n+        \"\"\"Test Case 1 - ls command, listing root and invalid directories\"\"\"\n+        fs_type, fs_img, _ = fs_obj_basic\n+        with ubman.log.section('Test Case 1 - ls'):\n+            assert run_c_test(ubman, fs_type, fs_img, 'fs_test_ls',\n+                              small=SMALL_FILE, big=BIG_FILE)\n \n-        with ubman.log.section('Test Case 2b - size (/../<file>)'):\n-            # Test Case 2b - size of small file via a path using '..'\n-            output = ubman.run_command_list([\n-                '%ssize host 0:0 /SUBDIR/../%s' % (fs_cmd_prefix, SMALL_FILE),\n-                'printenv filesize',\n-                'setenv filesize'])\n-            assert('filesize=100000' in ''.join(output))\n+    def test_fs2(self, ubman, fs_obj_basic):\n+        \"\"\"Test Case 2 - size command for a small file\"\"\"\n+        fs_type, fs_img, _ = fs_obj_basic\n+        with ubman.log.section('Test Case 2 - size (small)'):\n+            assert run_c_test(ubman, fs_type, fs_img, 'fs_test_size_small',\n+                              small=SMALL_FILE)\n \n     def test_fs3(self, ubman, fs_obj_basic):\n-        \"\"\"\n-        Test Case 3 - size command for a large file\n-        \"\"\"\n-        fs_type,fs_cmd_prefix,fs_cmd_write,fs_img,md5val = fs_obj_basic\n+        \"\"\"Test Case 3 - size command for a large file\"\"\"\n+        fs_type, fs_img, _ = fs_obj_basic\n         with ubman.log.section('Test Case 3 - size (large)'):\n-            # 2.5GB (1024*1024*2500) is 0x9C40 0000\n-            # Test Case 3 - size of big file\n-            output = ubman.run_command_list([\n-                'host bind 0 %s' % fs_img,\n-                '%ssize host 0:0 /%s' % (fs_cmd_prefix, BIG_FILE),\n-                'printenv filesize',\n-                'setenv filesize'])\n-            assert('filesize=9c400000' in ''.join(output))\n+            assert run_c_test(ubman, fs_type, fs_img, 'fs_test_size_big',\n+                              big=BIG_FILE)\n \n     def test_fs4(self, ubman, fs_obj_basic):\n-        \"\"\"\n-        Test Case 4 - load a small file, 1MB\n-        \"\"\"\n-        fs_type,fs_cmd_prefix,fs_cmd_write,fs_img,md5val = fs_obj_basic\n+        \"\"\"Test Case 4 - load a small file, 1MB\"\"\"\n+        fs_type, fs_img, md5val = fs_obj_basic\n         with ubman.log.section('Test Case 4 - load (small)'):\n-            # Test Case 4a - Read full 1MB of small file\n-            output = ubman.run_command_list([\n-                'host bind 0 %s' % fs_img,\n-                '%sload host 0:0 %x /%s' % (fs_cmd_prefix, ADDR, SMALL_FILE),\n-                'printenv filesize'])\n-            assert('filesize=100000' in ''.join(output))\n-\n-            # Test Case 4b - Read full 1MB of small file\n-            output = ubman.run_command_list([\n-                'md5sum %x $filesize' % ADDR,\n-                'setenv filesize'])\n-            assert(md5val[0] in ''.join(output))\n+            assert run_c_test(ubman, fs_type, fs_img, 'fs_test_load_small',\n+                              small=SMALL_FILE, md5val=md5val[0])\n \n     def test_fs5(self, ubman, fs_obj_basic):\n-        \"\"\"\n-        Test Case 5 - load, reading first 1MB of 3GB file\n-        \"\"\"\n-        fs_type,fs_cmd_prefix,fs_cmd_write,fs_img,md5val = fs_obj_basic\n+        \"\"\"Test Case 5 - load, reading first 1MB of 3GB file\"\"\"\n+        fs_type, fs_img, md5val = fs_obj_basic\n         with ubman.log.section('Test Case 5 - load (first 1MB)'):\n-            # Test Case 5a - First 1MB of big file\n-            output = ubman.run_command_list([\n-                'host bind 0 %s' % fs_img,\n-                '%sload host 0:0 %x /%s %x 0x0' % (fs_cmd_prefix, ADDR, BIG_FILE, LENGTH),\n-                'printenv filesize'])\n-            assert('filesize=100000' in ''.join(output))\n-\n-            # Test Case 5b - First 1MB of big file\n-            output = ubman.run_command_list([\n-                'md5sum %x $filesize' % ADDR,\n-                'setenv filesize'])\n-            assert(md5val[1] in ''.join(output))\n+            assert run_c_test(ubman, fs_type, fs_img, 'fs_test_load_big_first',\n+                              big=BIG_FILE, md5val=md5val[1])\n \n     def test_fs6(self, ubman, fs_obj_basic):\n-        \"\"\"\n-        Test Case 6 - load, reading last 1MB of 3GB file\n-        \"\"\"\n-        fs_type,fs_cmd_prefix,fs_cmd_write,fs_img,md5val = fs_obj_basic\n+        \"\"\"Test Case 6 - load, reading last 1MB of 3GB file\"\"\"\n+        fs_type, fs_img, md5val = fs_obj_basic\n         with ubman.log.section('Test Case 6 - load (last 1MB)'):\n-            # fails for ext as no offset support\n-            # Test Case 6a - Last 1MB of big file\n-            output = ubman.run_command_list([\n-                'host bind 0 %s' % fs_img,\n-                '%sload host 0:0 %x /%s %x 0x9c300000'\n-                    % (fs_cmd_prefix, ADDR, BIG_FILE, LENGTH),\n-                'printenv filesize'])\n-            assert('filesize=100000' in ''.join(output))\n-\n-            # Test Case 6b - Last 1MB of big file\n-            output = ubman.run_command_list([\n-                'md5sum %x $filesize' % ADDR,\n-                'setenv filesize'])\n-            assert(md5val[2] in ''.join(output))\n+            assert run_c_test(ubman, fs_type, fs_img, 'fs_test_load_big_last',\n+                              big=BIG_FILE, md5val=md5val[2])\n \n     def test_fs7(self, ubman, fs_obj_basic):\n-        \"\"\"\n-        Test Case 7 - load, 1MB from the last 1MB in 2GB\n-        \"\"\"\n-        fs_type,fs_cmd_prefix,fs_cmd_write,fs_img,md5val = fs_obj_basic\n+        \"\"\"Test Case 7 - load, 1MB from the last 1MB in 2GB\"\"\"\n+        fs_type, fs_img, md5val = fs_obj_basic\n         with ubman.log.section('Test Case 7 - load (last 1MB in 2GB)'):\n-            # fails for ext as no offset support\n-            # Test Case 7a - One from the last 1MB chunk of 2GB\n-            output = ubman.run_command_list([\n-                'host bind 0 %s' % fs_img,\n-                '%sload host 0:0 %x /%s %x 0x7ff00000'\n-                    % (fs_cmd_prefix, ADDR, BIG_FILE, LENGTH),\n-                'printenv filesize'])\n-            assert('filesize=100000' in ''.join(output))\n-\n-            # Test Case 7b - One from the last 1MB chunk of 2GB\n-            output = ubman.run_command_list([\n-                'md5sum %x $filesize' % ADDR,\n-                'setenv filesize'])\n-            assert(md5val[3] in ''.join(output))\n+            assert run_c_test(ubman, fs_type, fs_img,\n+                              'fs_test_load_big_2g_last',\n+                              big=BIG_FILE, md5val=md5val[3])\n \n     def test_fs8(self, ubman, fs_obj_basic):\n-        \"\"\"\n-        Test Case 8 - load, reading first 1MB in 2GB\n-        \"\"\"\n-        fs_type,fs_cmd_prefix,fs_cmd_write,fs_img,md5val = fs_obj_basic\n+        \"\"\"Test Case 8 - load, reading first 1MB in 2GB\"\"\"\n+        fs_type, fs_img, md5val = fs_obj_basic\n         with ubman.log.section('Test Case 8 - load (first 1MB in 2GB)'):\n-            # fails for ext as no offset support\n-            # Test Case 8a - One from the start 1MB chunk from 2GB\n-            output = ubman.run_command_list([\n-                'host bind 0 %s' % fs_img,\n-                '%sload host 0:0 %x /%s %x 0x80000000'\n-                    % (fs_cmd_prefix, ADDR, BIG_FILE, LENGTH),\n-                'printenv filesize'])\n-            assert('filesize=100000' in ''.join(output))\n-\n-            # Test Case 8b - One from the start 1MB chunk from 2GB\n-            output = ubman.run_command_list([\n-                'md5sum %x $filesize' % ADDR,\n-                'setenv filesize'])\n-            assert(md5val[4] in ''.join(output))\n+            assert run_c_test(ubman, fs_type, fs_img,\n+                              'fs_test_load_big_2g_first',\n+                              big=BIG_FILE, md5val=md5val[4])\n \n     def test_fs9(self, ubman, fs_obj_basic):\n-        \"\"\"\n-        Test Case 9 - load, 1MB crossing 2GB boundary\n-        \"\"\"\n-        fs_type,fs_cmd_prefix,fs_cmd_write,fs_img,md5val = fs_obj_basic\n+        \"\"\"Test Case 9 - load, 1MB crossing 2GB boundary\"\"\"\n+        fs_type, fs_img, md5val = fs_obj_basic\n         with ubman.log.section('Test Case 9 - load (crossing 2GB boundary)'):\n-            # fails for ext as no offset support\n-            # Test Case 9a - One 1MB chunk crossing the 2GB boundary\n-            output = ubman.run_command_list([\n-                'host bind 0 %s' % fs_img,\n-                '%sload host 0:0 %x /%s %x 0x7ff80000'\n-                    % (fs_cmd_prefix, ADDR, BIG_FILE, LENGTH),\n-                'printenv filesize'])\n-            assert('filesize=100000' in ''.join(output))\n-\n-            # Test Case 9b - One 1MB chunk crossing the 2GB boundary\n-            output = ubman.run_command_list([\n-                'md5sum %x $filesize' % ADDR,\n-                'setenv filesize'])\n-            assert(md5val[5] in ''.join(output))\n+            assert run_c_test(ubman, fs_type, fs_img,\n+                              'fs_test_load_big_2g_cross',\n+                              big=BIG_FILE, md5val=md5val[5])\n \n     def test_fs10(self, ubman, fs_obj_basic):\n-        \"\"\"\n-        Test Case 10 - load, reading beyond file end'):\n-        \"\"\"\n-        fs_type,fs_cmd_prefix,fs_cmd_write,fs_img,md5val = fs_obj_basic\n+        \"\"\"Test Case 10 - load, reading beyond file end\"\"\"\n+        fs_type, fs_img, _ = fs_obj_basic\n         with ubman.log.section('Test Case 10 - load (beyond file end)'):\n-            # Generic failure case\n-            # Test Case 10 - 2MB chunk from the last 1MB of big file\n-            output = ubman.run_command_list([\n-                'host bind 0 %s' % fs_img,\n-                '%sload host 0:0 %x /%s 0x00200000 0x9c300000'\n-                    % (fs_cmd_prefix, ADDR, BIG_FILE),\n-                'printenv filesize',\n-                'md5sum %x $filesize' % ADDR,\n-                'setenv filesize'])\n-        assert('filesize=100000' in ''.join(output))\n+            assert run_c_test(ubman, fs_type, fs_img, 'fs_test_load_beyond',\n+                              big=BIG_FILE)\n \n     def test_fs11(self, ubman, fs_obj_basic):\n-        \"\"\"\n-        Test Case 11 - write'\n-        \"\"\"\n-        fs_type,fs_cmd_prefix,fs_cmd_write,fs_img,md5val = fs_obj_basic\n+        \"\"\"Test Case 11 - write\"\"\"\n+        fs_type, fs_img, md5val = fs_obj_basic\n         with ubman.log.section('Test Case 11 - write'):\n-            # Read 1MB from small file\n-            # Write it back to test the writes\n-            # Test Case 11a - Check that the write succeeded\n-            output = ubman.run_command_list([\n-                'host bind 0 %s' % fs_img,\n-                '%sload host 0:0 %x /%s' % (fs_cmd_prefix, ADDR, SMALL_FILE),\n-                '%s%s host 0:0 %x /%s.w $filesize'\n-                    % (fs_cmd_prefix, fs_cmd_write, ADDR, SMALL_FILE)])\n-            assert('1048576 bytes written' in ''.join(output))\n-\n-            # Test Case 11b - Check md5 of written to is same\n-            # as the one read from\n-            output = ubman.run_command_list([\n-                '%sload host 0:0 %x /%s.w' % (fs_cmd_prefix, ADDR, SMALL_FILE),\n-                'md5sum %x $filesize' % ADDR,\n-                'setenv filesize'])\n-            assert(md5val[0] in ''.join(output))\n+            assert run_c_test(ubman, fs_type, fs_img, 'fs_test_write',\n+                              small=SMALL_FILE, md5val=md5val[0])\n             assert_fs_integrity(fs_type, fs_img)\n \n     def test_fs12(self, ubman, fs_obj_basic):\n-        \"\"\"\n-        Test Case 12 - write to \".\" directory\n-        \"\"\"\n-        fs_type,fs_cmd_prefix,fs_cmd_write,fs_img,md5val = fs_obj_basic\n+        \"\"\"Test Case 12 - write to \".\" directory\"\"\"\n+        fs_type, fs_img, _ = fs_obj_basic\n         with ubman.log.section('Test Case 12 - write (\".\")'):\n-            # Next test case checks writing a file whose dirent\n-            # is the first in the block, which is always true for \".\"\n-            # The write should fail, but the lookup should work\n-            # Test Case 12 - Check directory traversal\n-            output = ubman.run_command_list([\n-                'host bind 0 %s' % fs_img,\n-                '%s%s host 0:0 %x /. 0x10'\n-                    % (fs_cmd_prefix, fs_cmd_write, ADDR)])\n-            assert('Unable to write' in ''.join(output))\n+            assert run_c_test(ubman, fs_type, fs_img, 'fs_test_write_dot')\n             assert_fs_integrity(fs_type, fs_img)\n \n     def test_fs13(self, ubman, fs_obj_basic):\n-        \"\"\"\n-        Test Case 13 - write to a file with \"/./<filename>\"\n-        \"\"\"\n-        fs_type,fs_cmd_prefix,fs_cmd_write,fs_img,md5val = fs_obj_basic\n+        \"\"\"Test Case 13 - write to a file with '/./<filename>'\"\"\"\n+        fs_type, fs_img, md5val = fs_obj_basic\n         with ubman.log.section('Test Case 13 - write  (\"./<file>\")'):\n-            # Read 1MB from small file\n-            # Write it via \"same directory\", i.e. \".\" dirent\n-            # Test Case 13a - Check directory traversal\n-            output = ubman.run_command_list([\n-                'host bind 0 %s' % fs_img,\n-                '%sload host 0:0 %x /%s' % (fs_cmd_prefix, ADDR, SMALL_FILE),\n-                '%s%s host 0:0 %x /./%s2 $filesize'\n-                    % (fs_cmd_prefix, fs_cmd_write, ADDR, SMALL_FILE)])\n-            assert('1048576 bytes written' in ''.join(output))\n-\n-            # Test Case 13b - Check md5 of written to is same\n-            # as the one read from\n-            output = ubman.run_command_list([\n-                'mw.b %x 00 100' % ADDR,\n-                '%sload host 0:0 %x /./%s2' % (fs_cmd_prefix, ADDR, SMALL_FILE),\n-                'md5sum %x $filesize' % ADDR,\n-                'setenv filesize'])\n-            assert(md5val[0] in ''.join(output))\n-\n-            # Test Case 13c - Check md5 of written to is same\n-            # as the one read from\n-            output = ubman.run_command_list([\n-                'mw.b %x 00 100' % ADDR,\n-                '%sload host 0:0 %x /%s2' % (fs_cmd_prefix, ADDR, SMALL_FILE),\n-                'md5sum %x $filesize' % ADDR,\n-                'setenv filesize'])\n-            assert(md5val[0] in ''.join(output))\n+            assert run_c_test(ubman, fs_type, fs_img, 'fs_test_write_dotpath',\n+                              small=SMALL_FILE, md5val=md5val[0])\n             assert_fs_integrity(fs_type, fs_img)\n","prefixes":["v2","12/12"]}