ext4: add kunit test for decoding extended timestamps
Subsystems (2)
PATCH v5 1/1 ext4: add kunit test for decoding extended timestamps
KUnit tests for decoding extended 64 bit timestamps
that verify the seconds part of [a/c/m]
timestamps in ext4 inode structs are decoded correctly. KUnit tests, which run on boot and output
the results to the debug log in TAP format (http://testanything.org/).
are only useful for kernel devs running KUnit test harness. Not for inclusion into a production build.
Test data is derived from the table under Documentation/filesystems/ext4/inodes.rst Inode Timestamps.
--- fs/ext4/Kconfig | 14 +++ fs/ext4/Makefile | 1 + fs/ext4/inode-test.c | 239 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 254 insertions(+) create mode 100644 fs/ext4/inode-test.c
fs/ext4/Kconfig +14 -0
@@ -106,3 +106,17 @@ config EXT4_DEBUG If you select Y here, then you will be able to turn on debugging with a command such as: echo 1 > /sys/module/ext4/parameters/mballoc_debug + +config EXT4_KUNIT_TESTS + bool "KUnit tests for ext4" + select EXT4_FS + depends on KUNIT + help + This builds the ext4 KUnit tests, which run on boot and output + the results to the debug log in TAP format (http://testanything.org/). + Only useful for kernel devs running KUnit test harness. Not for + inclusion into a production build. + For more information on KUnit and unit tests in general please refer + to the KUnit documentation in Documentation/dev-tools/kunit/. + + If unsure, say N.
fs/ext4/Makefile +1 -0
@@ -13,4 +13,5 @@ ext4-y := balloc.o bitmap.o block_validity.o dir.o ext4_jbd2.o extents.o \ ext4-$(CONFIG_EXT4_FS_POSIX_ACL) += acl.o ext4-$(CONFIG_EXT4_FS_SECURITY) += xattr_security.o +ext4-$(CONFIG_EXT4_KUNIT_TESTS) += inode-test.o ext4-$(CONFIG_FS_VERITY) += verity.o
fs/ext4/inode-test.c new file +239 -0
239 lines not on this page · raw message
--
2.23.0.866.gb869b98d4c-goog
Quoted 11 lines · Iurii Zaikin
KUnit tests for decoding extended 64 bit timestamps
that verify the seconds part of [a/c/m]
timestamps in ext4 inode structs are decoded correctly. KUnit tests, which run on boot and output
the results to the debug log in TAP format (http://testanything.org/).
are only useful for kernel devs running KUnit test harness. Not for inclusion into a production build.
Test data is derived from the table underDocumentation/filesystems/ext4/inodes.rstInode Timestamps.Signed-off-by Iurii Zaikin <[email protected]>
You got Reviewed-bys from both Ted and myself. Unless you make *substantial* changes you should generally include all Reviewed-bys, Tested-bys, Acked-bys, etc in all future revisions.
Cheers!
Quoted 11 lines · Iurii Zaikin
KUnit tests for decoding extended 64 bit timestamps
that verify the seconds part of [a/c/m]
timestamps in ext4 inode structs are decoded correctly. KUnit tests, which run on boot and output
the results to the debug log in TAP format (http://testanything.org/).
are only useful for kernel devs running KUnit test harness. Not for inclusion into a production build.
Test data is derived from the table underDocumentation/filesystems/ext4/inodes.rstInode Timestamps.Signed-off-by Iurii Zaikin <[email protected]>
Minor nit. The above commit description would look nicer when looked at in "git log" when formatted as follows:
--- cut here ---
KUnit tests for decoding extended 64 bit timestamps that verify the seconds part of [a/c/m] timestamps in ext4 inode structs are decoded correctly.
KUnit tests, which run on boot and output the results to the debug log in TAP format (http://testanything.org/) are only useful for kernel devs running KUnit test harness and are not for inclusion into a production build.
Test data is derived from the table in the Inode Timestamps section of Documentation/filesystems/ext4/inodes.rst.
--- cut here ---
- Ted
Theodore Y. Ts'o
maintainerQuoted 14 lines · Theodore Y. Ts'o
Minor nit. The above commit description would look nicer when looked at in "git log" when formatted as follows:
--- cut here ---
KUnit tests for decoding extended 64 bit timestamps that verify the seconds part of [a/c/m] timestamps in ext4 inode structs are decoded correctly.
KUnit tests, which run on boot and output the results to the debug log in TAP format (http://testanything.org/) are only useful for kernel devs running KUnit test harness and are not for inclusion into a production build.
Quoted 4 lines
Test data is derived from the table in the Inode Timestamps section of
Documentation/filesystems/ext4/inodes.rst.--- cut here ---
Upon rereading, swapping the 2nd and 3rd paragraphis would read better, I think.
- Ted