From: AKASHI Takahiro <takahiro.akashi@linaro.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 4/4] test/py: test_fs: add tests for creating/deleting many files
Date: Wed, 15 May 2019 15:05:16 +0900 [thread overview]
Message-ID: <20190515060515.GS11160@linaro.org> (raw)
In-Reply-To: <5e1fdb2f-f6e0-d199-76a8-d4f9bd2cd042@gmx.de>
On Tue, May 14, 2019 at 08:09:53PM +0200, Heinrich Schuchardt wrote:
> On 5/13/19 7:49 AM, AKASHI Takahiro wrote:
> >Two test cases are added under test_fs_ext:
> > test case 10: for root directory
> > test case 11: for non-root directory
>
> When running `make tests` all of these tests seem to be skipped:
>
> test/py/tests/test_fs/test_basic.py
> sssssssssssssssssssssssssssssssssssssss
> [ 0%]
> test/py/tests/test_fs/test_ext.py ssssssssssssssssssssss
>
> [ 0%]
> test/py/tests/test_fs/test_mkdir.py ssssssssssss
>
> [ 0%]
> test/py/tests/test_fs/test_symlink.py ssss
>
> [ 0%]
> test/py/tests/test_fs/test_unlink.py ssssssssssssss
>
> How can they be executed?
Install guestmount and set it up correctly.
-Takahiro Akashi
> I think it is worthwhile to mention as a comment that you are testing
> long file names (not 8.3).
>
> Best regards
>
> Heinrich
>
> >
> >Those will verify a behavior fixed by the commits related to
> >root directory
> >("fs: fat: allocate a new cluster for root directory of fat32" and
> >"fs: fat: flush a directory cluster properly").
> >
> >Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
> >---
> > test/py/tests/test_fs/test_ext.py | 84 +++++++++++++++++++++++++++++++
> > 1 file changed, 84 insertions(+)
> >
> >diff --git a/test/py/tests/test_fs/test_ext.py b/test/py/tests/test_fs/test_ext.py
> >index 2c47738b8df2..361f440dd6d4 100644
> >--- a/test/py/tests/test_fs/test_ext.py
> >+++ b/test/py/tests/test_fs/test_ext.py
> >@@ -233,3 +233,87 @@ class TestFsExt(object):
> > % (fs_type, ADDR, MIN_FILE)])
> > assert('Unable to write "/dir1' in ''.join(output))
> > assert_fs_integrity(fs_type, fs_img)
> >+
> >+ def test_fs_ext10(self, u_boot_console, fs_obj_ext):
> >+ """
> >+ 'Test Case 10 - create/delete as many directories under root directory
> >+ as amount of directory entries goes beyond one cluster size)'
> >+ """
> >+ fs_type,fs_img,md5val = fs_obj_ext
> >+ with u_boot_console.log.section('Test Case 10 - create/delete (many)'):
> >+ # Test Case 10a - Create many files
> >+ # Please note that the size of directory entry is 32 bytes.
> >+ # So one typical cluster may holds 64 (2048/32) entries.
> >+ output = u_boot_console.run_command(
> >+ 'host bind 0 %s' % fs_img)
> >+
> >+ for i in range(0, 66):
> >+ output = u_boot_console.run_command(
> >+ '%swrite host 0:0 %x /FILE0123456789_%02x 100'
> >+ % (fs_type, ADDR, i))
> >+ output = u_boot_console.run_command('%sls host 0:0 /' % fs_type)
> >+ assert('FILE0123456789_00' in output)
> >+ assert('FILE0123456789_41' in output)
> >+
> >+ # Test Case 10b - Delete many files
> >+ for i in range(0, 66):
> >+ output = u_boot_console.run_command(
> >+ '%srm host 0:0 /FILE0123456789_%02x'
> >+ % (fs_type, i))
> >+ output = u_boot_console.run_command('%sls host 0:0 /' % fs_type)
> >+ assert(not 'FILE0123456789_00' in output)
> >+ assert(not 'FILE0123456789_41' in output)
> >+
> >+ # Test Case 10c - Create many files again
> >+ # Please note no.64 and 65 are intentionally re-created
> >+ for i in range(64, 128):
> >+ output = u_boot_console.run_command(
> >+ '%swrite host 0:0 %x /FILE0123456789_%02x 100'
> >+ % (fs_type, ADDR, i))
> >+ output = u_boot_console.run_command('%sls host 0:0 /' % fs_type)
> >+ assert('FILE0123456789_40' in output)
> >+ assert('FILE0123456789_79' in output)
> >+
> >+ assert_fs_integrity(fs_type, fs_img)
> >+
> >+ def test_fs_ext11(self, u_boot_console, fs_obj_ext):
> >+ """
> >+ 'Test Case 11 - create/delete as many directories under non-root
> >+ directory as amount of directory entries goes beyond one cluster size)'
> >+ """
> >+ fs_type,fs_img,md5val = fs_obj_ext
> >+ with u_boot_console.log.section('Test Case 10 - create/delete (many)'):
> >+ # Test Case 11a - Create many files
> >+ # Please note that the size of directory entry is 32 bytes.
> >+ # So one typical cluster may holds 64 (2048/32) entries.
> >+ output = u_boot_console.run_command(
> >+ 'host bind 0 %s' % fs_img)
> >+
> >+ for i in range(0, 66):
> >+ output = u_boot_console.run_command(
> >+ '%swrite host 0:0 %x /dir1/FILE0123456789_%02x 100'
> >+ % (fs_type, ADDR, i))
> >+ output = u_boot_console.run_command('%sls host 0:0 /dir1' % fs_type)
> >+ assert('FILE0123456789_00' in output)
> >+ assert('FILE0123456789_41' in output)
> >+
> >+ # Test Case 11b - Delete many files
> >+ for i in range(0, 66):
> >+ output = u_boot_console.run_command(
> >+ '%srm host 0:0 /dir1/FILE0123456789_%02x'
> >+ % (fs_type, i))
> >+ output = u_boot_console.run_command('%sls host 0:0 /dir1' % fs_type)
> >+ assert(not 'FILE0123456789_00' in output)
> >+ assert(not 'FILE0123456789_41' in output)
> >+
> >+ # Test Case 11c - Create many files again
> >+ # Please note no.64 and 65 are intentionally re-created
> >+ for i in range(64, 128):
> >+ output = u_boot_console.run_command(
> >+ '%swrite host 0:0 %x /dir1/FILE0123456789_%02x 100'
> >+ % (fs_type, ADDR, i))
> >+ output = u_boot_console.run_command('%sls host 0:0 /dir1' % fs_type)
> >+ assert('FILE0123456789_40' in output)
> >+ assert('FILE0123456789_79' in output)
> >+
> >+ assert_fs_integrity(fs_type, fs_img)
> >
>
next prev parent reply other threads:[~2019-05-15 6:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-13 5:49 [U-Boot] [PATCH 0/4] fs: fat: fixes for write under root directory AKASHI Takahiro
2019-05-13 5:49 ` [U-Boot] [PATCH 1/4] fs: fat: write to non-cluster-aligned " AKASHI Takahiro
2019-05-14 17:26 ` Heinrich Schuchardt
2019-05-13 5:49 ` [U-Boot] [PATCH 2/4] fs: fat: flush a directory cluster properly AKASHI Takahiro
2019-05-14 17:29 ` Heinrich Schuchardt
2019-05-13 5:49 ` [U-Boot] [PATCH 3/4] fs: fat: allocate a new cluster for root directory of fat32 AKASHI Takahiro
2019-05-14 17:30 ` Heinrich Schuchardt
2019-05-13 5:49 ` [U-Boot] [PATCH 4/4] test/py: test_fs: add tests for creating/deleting many files AKASHI Takahiro
2019-05-14 18:09 ` Heinrich Schuchardt
2019-05-15 6:05 ` AKASHI Takahiro [this message]
2019-05-15 12:49 ` Tom Rini
2019-05-20 17:10 ` [U-Boot] [PATCH 0/4] fs: fat: fixes for write under root directory Heinrich Schuchardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190515060515.GS11160@linaro.org \
--to=takahiro.akashi@linaro.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.