<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mtd-utils.git/tests, branch v2.3.1</title>
<subtitle>A mirror of http://git.infradead.org/mtd-utils.git</subtitle>
<id>https://git.infraroot.at/mtd-utils.git/atom?h=v2.3.1</id>
<link rel='self' href='https://git.infraroot.at/mtd-utils.git/atom?h=v2.3.1'/>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/'/>
<updated>2026-04-13T06:42:56+00:00</updated>
<entry>
<title>mtd-utils: tests: jittertest: reject overlong file names</title>
<updated>2026-04-13T06:42:56+00:00</updated>
<author>
<name>Aviv Daum</name>
<email>aviv.daum@gmail.com</email>
</author>
<published>2026-03-18T22:53:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=514063a6d7a628e358894b6a6a6cb089c264fc09'/>
<id>urn:sha1:514063a6d7a628e358894b6a6a6cb089c264fc09</id>
<content type='text'>
plotJittervsFill copies the -f argument into a 250-byte buffer with
strncpy(..., sizeof(LogFile)). A 250-byte file name leaves the buffer
unterminated, and the subsequent fopen() reads past the end of LogFile.

JitterTest uses the same fixed-size file name pattern for -r, while -c
still silently truncates overlong names and -f already rejects them.

Validate jittertest file name arguments before copying them so these
options all reject overlong input instead of truncating it or reading
past the end of fixed-size buffers.

Add a shell regression test that exercises the accepted and rejected
boundary lengths for plotJittervsFill and JitterTest during make check.

Signed-off-by: Aviv Daum &lt;aviv.daum@gmail.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>mtd-tests: flash_speed: fix error message in read_eraseblock()</title>
<updated>2025-11-28T19:13:57+00:00</updated>
<author>
<name>Gabor Juhos</name>
<email>j4g8y7@gmail.com</email>
</author>
<published>2025-07-23T11:28:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=0f532c9990d4d920e390135c04adb03bf6074e46'/>
<id>urn:sha1:0f532c9990d4d920e390135c04adb03bf6074e46</id>
<content type='text'>
Replace 'write' with 'read' in the error message of the read_eraseblock()
function to indicate the correct direction of the operation.

Signed-off-by: Gabor Juhos &lt;j4g8y7@gmail.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>mtd-tests: flash_speed: really skip destructive tests</title>
<updated>2025-11-28T19:13:56+00:00</updated>
<author>
<name>Gabor Juhos</name>
<email>j4g8y7@gmail.com</email>
</author>
<published>2025-07-23T11:28:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=b139f3ccd1521071aab29420f417abb937d021ce'/>
<id>urn:sha1:b139f3ccd1521071aab29420f417abb937d021ce</id>
<content type='text'>
Although both the 'multi-block erase' and the 'read-while-write latency'
tests are destructive, but those are executed irregardless of whether
destructive mode is enabled or not.

Change the code to skip these tests if the DESTRUCTIVE flag is not set
to avoid unexpected behaviour.

Signed-off-by: Gabor Juhos &lt;j4g8y7@gmail.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>tests: add test_DATA to EXTRA_DIST</title>
<updated>2025-11-28T18:52:57+00:00</updated>
<author>
<name>Michael Olbrich</name>
<email>m.olbrich@pengutronix.de</email>
</author>
<published>2025-02-20T11:25:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=09e151c895326824383258469f5c6f85652f19cd'/>
<id>urn:sha1:09e151c895326824383258469f5c6f85652f19cd</id>
<content type='text'>
Otherwise, the test files are missin in the tarball and building fails
with:

make[1]: *** No rule to make target 'tests/ubifs_tools-tests/images/good.gz', needed by 'all-am'.  Stop.

unless --without-tests is uses.

Reviewed-by: Zhihao Cheng &lt;chengzhihao1@huawei.com&gt;
Signed-off-by: Michael Olbrich &lt;m.olbrich@pengutronix.de&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>tests: checkfs: Add previous prototype for do_pwr_dn()</title>
<updated>2025-01-30T17:30:16+00:00</updated>
<author>
<name>Zhihao Cheng</name>
<email>chengzhihao1@huawei.com</email>
</author>
<published>2025-01-26T06:42:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=b66c6ce14c0089ac4fa5372df1af631a055ad5b4'/>
<id>urn:sha1:b66c6ce14c0089ac4fa5372df1af631a055ad5b4</id>
<content type='text'>
The compiler complains following message:
 tests/checkfs/comm.c:37:5: warning: no previous prototype for
 ‘do_pwr_dn’
The function do_pwr_dn() is only used in tests/checkfs/checkfs.c, but
we still keep it in tests/checkfs/comm.c in case the function() is
used by more callers. Fix it by adding a previous declaration.

Signed-off-by: Zhihao Cheng &lt;chengzhihao1@huawei.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>tests: ubifs_tools: Add README</title>
<updated>2024-11-11T09:32:46+00:00</updated>
<author>
<name>Zhihao Cheng</name>
<email>chengzhihao1@huawei.com</email>
</author>
<published>2024-11-11T09:08:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=5c0c51078f2b47aca64b4fabdd7c069cb684cad3'/>
<id>urn:sha1:5c0c51078f2b47aca64b4fabdd7c069cb684cad3</id>
<content type='text'>
Add document for fsck.ubifs and mkfs.ubifs testcases, explain all
testcases and how to run them.

Signed-off-by: Zhihao Cheng &lt;chengzhihao1@huawei.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>tests: ubifs_tools: Add run_all script</title>
<updated>2024-11-11T09:32:46+00:00</updated>
<author>
<name>Zhihao Cheng</name>
<email>chengzhihao1@huawei.com</email>
</author>
<published>2024-11-11T09:08:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=ba0168492cd8cdc05dce2f2afd2fe456aeab88c6'/>
<id>urn:sha1:ba0168492cd8cdc05dce2f2afd2fe456aeab88c6</id>
<content type='text'>
Add run_all script to run all UBIFS fsck &amp; mkfs testcases.

Signed-off-by: Zhihao Cheng &lt;chengzhihao1@huawei.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>tests: ubifs_tools: mkfs_tests: Add fs content check test</title>
<updated>2024-11-11T09:32:46+00:00</updated>
<author>
<name>Zhihao Cheng</name>
<email>chengzhihao1@huawei.com</email>
</author>
<published>2024-11-11T09:08:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=389048a771e625a559b53b804a8e0739312cb12c'/>
<id>urn:sha1:389048a771e625a559b53b804a8e0739312cb12c</id>
<content type='text'>
Initialize UBIFS image from a given directory, then check whether the
fs content in mounted UBIFS is consistent with the original directory.
Both UBI volume and file are chosen as storage mediums to test.

Signed-off-by: Zhihao Cheng &lt;chengzhihao1@huawei.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>tests: ubifs_tools: fsck_tests: Add bad images fixing test</title>
<updated>2024-11-11T09:32:46+00:00</updated>
<author>
<name>Zhihao Cheng</name>
<email>chengzhihao1@huawei.com</email>
</author>
<published>2024-11-11T09:08:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=60fd097fb0c436956e58d0a30535a04a35258225'/>
<id>urn:sha1:60fd097fb0c436956e58d0a30535a04a35258225</id>
<content type='text'>
For kinds of inconsistent UBIFS images(which can simulate corruptions
caused by some potentional UBIFS bug), check the result of fsck.
This testcase mainly checks whether the behavior is in expected after
repairing specific inconsistent UBIFS image.

Signed-off-by: Zhihao Cheng &lt;chengzhihao1@huawei.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>tests: ubifs_tools: fsck_tests: Add corrupted images</title>
<updated>2024-11-11T09:32:46+00:00</updated>
<author>
<name>Zhihao Cheng</name>
<email>chengzhihao1@huawei.com</email>
</author>
<published>2024-11-11T09:08:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=4e6f5098716ad2bf8859a1915fc0e42e69eaf88a'/>
<id>urn:sha1:4e6f5098716ad2bf8859a1915fc0e42e69eaf88a</id>
<content type='text'>
This is a preparation for adding bad images fsck testcase. There is
no debugfs tools (for example: debugfs[ext4], xfs_db) for UBIFS, so
there is no way to inject precise corruption into UBIFS image, we have
to prepare inconsistent UBIFS images in advance like e2fsprogs[1] does.
(Goto [2] to see how to generate inconsistent UBIFS images).
Original UBIFS image content:
 /
 ├── corrupt_file (xattr - user.corrupt:123, 2K data)
 ├── dir
 │   ├── block_dev
 │   ├── char_dev
 │   ├── dir
 │   └── file (content: '123')
 ├── hardl_corrupt_file =&gt; corrupt_file
 └── softl_corrupt_file -&gt; corrupt_file

Here's a descriptons of the various testing images:
=========================================================================
      image         |     Description     |          expectancy
-------------------------------------------------------------------------
good                | good image contains | fsck success, fs content is
                    | kinds of files.     | not changed.
-------------------------------------------------------------------------
sb_fanout           | invalid fanout in   | fsck failed.
                    | superblock.         |
-------------------------------------------------------------------------
sb_fmt_version      | invalid fmt_version | fsck failed.
                    | in superblock.      |
-------------------------------------------------------------------------
sb_leb_size         | invalid leb_size in | fsck failed.
                    | superblock.         |
-------------------------------------------------------------------------
sb_log_lebs         | invalid log lebs in | fsck failed.
                    | superblock.         |
-------------------------------------------------------------------------
sb_min_io_size      | invalid min_io_size | fsck failed.
                    | in superblock.      |
-------------------------------------------------------------------------
master_highest_inum | invalid highest_inum| fsck success, fs content is
                    | in master nodes.    | not changed.
-------------------------------------------------------------------------
master_lpt          | bad lpt pos in      | fsck success, fs content is
                    | master nodes.       | not changed.
-------------------------------------------------------------------------
master_tnc          | bad tnc pos in      | fsck success, fs content is
                    | master nodes.       | not changed.
-------------------------------------------------------------------------
master_total_dead   | bad total_dead in   | fsck success, fs content is
                    | master nodes.       | not changed.
-------------------------------------------------------------------------
master_total_dirty  | bad total_dirty in  | fsck success, fs content is
                    | master nodes.       | not changed.
-------------------------------------------------------------------------
master_total_free   | bad total_free in   | fsck success, fs content is
                    | master nodes.       | not changed.
-------------------------------------------------------------------------
journal_log         | corrupted log area. | fsck success, fs content is
                    |                     | not changed.
-------------------------------------------------------------------------
journal_bud         | corrupted bud area. | fsck success, file data is
                    |                     | lost.
-------------------------------------------------------------------------
orphan_node         | bad orphan node.    | fsck success, file is
                    |                     | deleted as expected.
-------------------------------------------------------------------------
lpt_dirty           | bad dirty in pnode. | fsck success, fs content is
                    |                     | not changed.
-------------------------------------------------------------------------
lpt_flags           | bad flags in pnode  | fsck success, fs content is
                    | (eg. index).        | not changed.
-------------------------------------------------------------------------
lpt_free            | bad free in pnode.  | fsck success, fs content is
                    |                     | not changed.
-------------------------------------------------------------------------
lpt_pos             | bad pos in nnode.   | fsck success, fs content is
                    |                     | not changed.
-------------------------------------------------------------------------
ltab_dirty          | bad dirty in lprops | fsck success, fs content is
                    | table.              | not changed.
-------------------------------------------------------------------------
ltab_free           | bad free in lprops  | fsck success, fs content is
                    | table.              | not changed.
-------------------------------------------------------------------------
index_size          | bad index size in   | fsck success, fs content is
                    | master nodes.       | not changed.
-------------------------------------------------------------------------
tnc_lv0_key         | bad key in lv0      | fsck success, fs content is
                    | znode.              | not changed.
-------------------------------------------------------------------------
tnc_lv0_len         | bad len in lv0      | fsck success, fs content is
                    | znode.              | not changed.
-------------------------------------------------------------------------
tnc_lv0_pos         | bad pos in lv0      | fsck success, fs content is
                    | znode.              | not changed.
-------------------------------------------------------------------------
tnc_noleaf_key      | bad key in non-leaf | fsck success, fs content is
                    | znode.              | not changed.
-------------------------------------------------------------------------
tnc_noleaf_len      | bad len in non-leaf | fsck success, fs content is
                    | znode.              | not changed.
-------------------------------------------------------------------------
tnc_noleaf_pos      | bad pos in non-leaf | fsck success, fs content is
                    | znode.              | not changed.
-------------------------------------------------------------------------
corrupted_data_leb  | corrupted data leb. | fsck success, partial data of
                    |                     | file is lost.
-------------------------------------------------------------------------
corrupted_idx_leb   | corrupted index leb.| fsck success, fs content is
                    |                     | not changed.
-------------------------------------------------------------------------
inode_data          | bad data node.      | fsck success, file content
                    |                     | is changed, other files are
                    |                     | not changed.
-------------------------------------------------------------------------
inode_mode          | bad inode mode for  | fsck success, file is
                    | file.               | dropped, other files are not
                    |                     | changed.
-------------------------------------------------------------------------
inode_nlink         | wrong nlink for     | fsck success, nlink is
                    | file.               | corrected, fs content is not
                    |                     | changed.
-------------------------------------------------------------------------
inode_size          | wrong inode size    | fsck success, inode size is
                    | for file.           | corrected, fs content is not
                    |                     | changed.
-------------------------------------------------------------------------
inode_xcnt          | wrong inode         | fsck success, xattr_cnt is
                    | xattr_cnt for file. | corrected, fs content is not
                    |                     | changed.
-------------------------------------------------------------------------
soft_link_inode_mode| bad inode mode for  | fsck success, soft link
                    | solf link file.     | file is dropped, other files
                    |                     | are not changed.
-------------------------------------------------------------------------
soft_link_data_len  | bad inode data_len  | fsck success, soft link
                    | for solt link file. | file is dropped, other files
                    |                     | are not changed.
-------------------------------------------------------------------------
dentry_key          | bad dentry key for  | fsck success, dentry is
                    | file.               | removed, other files are
                    |                     | not changed.
-------------------------------------------------------------------------
dentry_nlen         | inconsistent nlen   | fsck success, dentry is
                    | and name in dentry  | removed, other files are
                    | for file.           | not changed.
-------------------------------------------------------------------------
dentry_type         | inconsistent type   | fsck success, dentry is
                    | between dentry and  | removed, other files are
                    | inode for file.     | not changed.
-------------------------------------------------------------------------
xinode_flags        | lost UBIFS_XATTR_FL | fsck success, xattr is
                    | in xattr inode      | removed, other files are
                    | flags for file.     | not changed.
-------------------------------------------------------------------------
xinode_key          | bad xattr inode key | fsck success, xattr is
                    | for file.           | removed, other files are
                    |                     | not changed.
-------------------------------------------------------------------------
xinode_mode         | bad xattr inode     | fsck success, xattr is
                    | mode for file.      | removed, other files are
                    |                     | not changed.
-------------------------------------------------------------------------
xentry_key          | bad xattr entry key | fsck success, xattr is
                    | for file.           | removed, other files are
                    |                     | not changed.
-------------------------------------------------------------------------
xentry_nlen         | inconsistent nlen   | fsck success, xattr is
                    | and name in xattr   | removed, other files are
                    | entry for file.     | not changed.
-------------------------------------------------------------------------
xentry_type         | inconsistent type   | fsck success, xattr is
                    | between xattr entry | removed, other files are
                    | and xattr inode for | not changed.
                    | file.               |
-------------------------------------------------------------------------
xent_host           | the xattr's host    | fsck success, file, hard
                    | is a xattr too, the | link and soft link are
                    | flag of corrupt_file| dropped, other files are
                    | inode is modified.  | not changed.
-------------------------------------------------------------------------
dir_many_dentry     | dir has too many    | fsck success, hard link is
                    | dentries, the dentry| dropped, other files are not
                    | of hard link is     | changed.
                    | modified.           |
-------------------------------------------------------------------------
dir_lost            | bad dentry for dir. | fsck success, the 'file' is
                    |                     | recovered under lost+found,
                    |                     | left files under dir are
                    |                     | removed, other files are not
                    |                     | changed.
-------------------------------------------------------------------------
dir_lost_duplicated | bad inode for dir,  | fsck success, the 'file' is
                    | there is a file     | recovered with INO_&lt;inum&gt;_1
                    | under lost+found,   | under lost+found, left files
                    | which named with the| under dir are removed, other
                    | inum of the 'file'. | files are not changed.
-------------------------------------------------------------------------
dir_lost_not_recover| bad inode for dir,  | fsck success, all files
                    | lost+found is a     | under dir are removed,
                    | regular file and    | other files are not changed.
                    | exists under root   |
                    | dir.                |
-------------------------------------------------------------------------
root_dir            | bad '/'.            | fsck success, create new
                    |                     | root dir('/'). All regular
                    |                     | files are reocovered under
                    |                     | lost+found, other files are
                    |                     | removed.
-------------------------------------------------------------------------
empty_tnc           | all files have bad  | fsck success, fs content
                    | inode.              | becomes empty.
=========================================================================

[1] https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/tree/tests/README
[2] https://bugzilla.kernel.org/show_bug.cgi?id=218924

Signed-off-by: Zhihao Cheng &lt;chengzhihao1@huawei.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
</feed>
