ext4: add kunit test for decoding extended timestamps
Subsystems (2)
PATCH v3 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 derive 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 test for ext4 inode" + depends on 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.700.g56cf767bdb-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 derive from the table underDocumentation/filesystems/ext4/inodes.rstInode Timestamps.Signed-off-by Iurii Zaikin <[email protected]>
This looks good. Thanks, Iurii!
- Ted