Skip to contentSkip to conversation

lib-glob-convert-selftest-to-kunit.patch removed from -mm tree

merged mm-nonmm-stable Andrew Morton 1 participant 1 message Jan 21

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: lib/glob: convert selftest to KUnit
has been removed from the -mm tree. Its filename was
lib-glob-convert-selftest-to-kunit.patch

This patch was dropped because it was merged into the mm-nonmm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Kir Chou <[email protected]>
Subject: lib/glob: convert selftest to KUnit
Date: Thu, 8 Jan 2026 21:07:53 +0900

This patch converts the existing glob selftest (lib/globtest.c) to use the KUnit framework (lib/tests/glob_kunit.c).

The new test:

- Migrates all 64 test cases from the original test to the KUnit suite.
- Removes the custom 'verbose' module parameter as KUnit handles logging.
- Updates Kconfig.debug and Makefile to support the new KUnit test.
- Updates Kconfig and Makefile to remove the original selftest.
- Updates GLOB_SELFTEST to GLOB_KUNIT_TEST for arch/m68k/configs.

This commit is verified by `./tools/testing/kunit/kunit.py run' with the .kunit/.kunitconfig:

CONFIG_KUNIT=y
CONFIG_GLOB_KUNIT_TEST=y

---

 arch/m68k/configs/amiga_defconfig    |    1 
 arch/m68k/configs/apollo_defconfig   |    1 
 arch/m68k/configs/atari_defconfig    |    1 
 arch/m68k/configs/bvme6000_defconfig |    1 
 arch/m68k/configs/hp300_defconfig    |    1 
 arch/m68k/configs/mac_defconfig      |    1 
 arch/m68k/configs/multi_defconfig    |    1 
 arch/m68k/configs/mvme147_defconfig  |    1 
 arch/m68k/configs/mvme16x_defconfig  |    1 
 arch/m68k/configs/q40_defconfig      |    1 
 arch/m68k/configs/sun3_defconfig     |    1 
 arch/m68k/configs/sun3x_defconfig    |    1 
 lib/Kconfig                          |   13 -
 lib/Kconfig.debug                    |   13 +
 lib/Makefile                         |    1 
 lib/globtest.c                       |  167 -------------------------
 lib/tests/Makefile                   |    1 
 lib/tests/glob_kunit.c               |  125 ++++++++++++++++++
 18 files changed, 139 insertions(+), 193 deletions(-)
arch/m68k/configs/amiga_defconfig renamed from arch/m68k/configs/amiga_defconfig~lib-glob-convert-selftest-to-kunit +0 -1
@@ -600,7 +600,6 @@ CONFIG_CRYPTO_USER_API_AEAD=m
 CONFIG_PRIME_NUMBERS=m
 CONFIG_CRC_BENCHMARK=y
 CONFIG_XZ_DEC_TEST=m
-CONFIG_GLOB_SELFTEST=m
 # CONFIG_SECTION_MISMATCH_WARN_ONLY is not set
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_TEST_LOCKUP=m
arch/m68k/configs/apollo_defconfig renamed from arch/m68k/configs/apollo_defconfig~lib-glob-convert-selftest-to-kunit +0 -1
@@ -557,7 +557,6 @@ CONFIG_CRYPTO_USER_API_AEAD=m
 CONFIG_PRIME_NUMBERS=m
 CONFIG_CRC_BENCHMARK=y
 CONFIG_XZ_DEC_TEST=m
-CONFIG_GLOB_SELFTEST=m
 # CONFIG_SECTION_MISMATCH_WARN_ONLY is not set
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_TEST_LOCKUP=m
arch/m68k/configs/atari_defconfig renamed from arch/m68k/configs/atari_defconfig~lib-glob-convert-selftest-to-kunit +0 -1
@@ -577,7 +577,6 @@ CONFIG_CRYPTO_USER_API_AEAD=m
 CONFIG_PRIME_NUMBERS=m
 CONFIG_CRC_BENCHMARK=y
 CONFIG_XZ_DEC_TEST=m
-CONFIG_GLOB_SELFTEST=m
 # CONFIG_SECTION_MISMATCH_WARN_ONLY is not set
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_TEST_LOCKUP=m
arch/m68k/configs/bvme6000_defconfig renamed from arch/m68k/configs/bvme6000_defconfig~lib-glob-convert-selftest-to-kunit +0 -1
@@ -549,7 +549,6 @@ CONFIG_CRYPTO_USER_API_AEAD=m
 CONFIG_PRIME_NUMBERS=m
 CONFIG_CRC_BENCHMARK=y
 CONFIG_XZ_DEC_TEST=m
-CONFIG_GLOB_SELFTEST=m
 # CONFIG_SECTION_MISMATCH_WARN_ONLY is not set
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_TEST_LOCKUP=m
arch/m68k/configs/hp300_defconfig renamed from arch/m68k/configs/hp300_defconfig~lib-glob-convert-selftest-to-kunit +0 -1
@@ -559,7 +559,6 @@ CONFIG_CRYPTO_USER_API_AEAD=m
 CONFIG_PRIME_NUMBERS=m
 CONFIG_CRC_BENCHMARK=y
 CONFIG_XZ_DEC_TEST=m
-CONFIG_GLOB_SELFTEST=m
 # CONFIG_SECTION_MISMATCH_WARN_ONLY is not set
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_TEST_LOCKUP=m
arch/m68k/configs/mac_defconfig renamed from arch/m68k/configs/mac_defconfig~lib-glob-convert-selftest-to-kunit +0 -1
@@ -576,7 +576,6 @@ CONFIG_CRYPTO_USER_API_AEAD=m
 CONFIG_PRIME_NUMBERS=m
 CONFIG_CRC_BENCHMARK=y
 CONFIG_XZ_DEC_TEST=m
-CONFIG_GLOB_SELFTEST=m
 # CONFIG_SECTION_MISMATCH_WARN_ONLY is not set
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_TEST_LOCKUP=m
arch/m68k/configs/multi_defconfig renamed from arch/m68k/configs/multi_defconfig~lib-glob-convert-selftest-to-kunit +0 -1
@@ -663,7 +663,6 @@ CONFIG_CRYPTO_USER_API_AEAD=m
 CONFIG_PRIME_NUMBERS=m
 CONFIG_CRC_BENCHMARK=y
 CONFIG_XZ_DEC_TEST=m
-CONFIG_GLOB_SELFTEST=m
 # CONFIG_SECTION_MISMATCH_WARN_ONLY is not set
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_TEST_LOCKUP=m
arch/m68k/configs/mvme147_defconfig renamed from arch/m68k/configs/mvme147_defconfig~lib-glob-convert-selftest-to-kunit +0 -1
@@ -549,7 +549,6 @@ CONFIG_CRYPTO_USER_API_AEAD=m
 CONFIG_PRIME_NUMBERS=m
 CONFIG_CRC_BENCHMARK=y
 CONFIG_XZ_DEC_TEST=m
-CONFIG_GLOB_SELFTEST=m
 # CONFIG_SECTION_MISMATCH_WARN_ONLY is not set
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_TEST_LOCKUP=m
arch/m68k/configs/mvme16x_defconfig renamed from arch/m68k/configs/mvme16x_defconfig~lib-glob-convert-selftest-to-kunit +0 -1
@@ -550,7 +550,6 @@ CONFIG_CRYPTO_USER_API_AEAD=m
 CONFIG_PRIME_NUMBERS=m
 CONFIG_CRC_BENCHMARK=y
 CONFIG_XZ_DEC_TEST=m
-CONFIG_GLOB_SELFTEST=m
 # CONFIG_SECTION_MISMATCH_WARN_ONLY is not set
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_TEST_LOCKUP=m
arch/m68k/configs/q40_defconfig renamed from arch/m68k/configs/q40_defconfig~lib-glob-convert-selftest-to-kunit +0 -1
@@ -566,7 +566,6 @@ CONFIG_CRYPTO_USER_API_AEAD=m
 CONFIG_PRIME_NUMBERS=m
 CONFIG_CRC_BENCHMARK=y
 CONFIG_XZ_DEC_TEST=m
-CONFIG_GLOB_SELFTEST=m
 # CONFIG_SECTION_MISMATCH_WARN_ONLY is not set
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_TEST_LOCKUP=m
arch/m68k/configs/sun3_defconfig renamed from arch/m68k/configs/sun3_defconfig~lib-glob-convert-selftest-to-kunit +0 -1
@@ -547,7 +547,6 @@ CONFIG_CRYPTO_USER_API_AEAD=m
 CONFIG_PRIME_NUMBERS=m
 CONFIG_CRC_BENCHMARK=y
 CONFIG_XZ_DEC_TEST=m
-CONFIG_GLOB_SELFTEST=m
 # CONFIG_SECTION_MISMATCH_WARN_ONLY is not set
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_TEST_LOCKUP=m
arch/m68k/configs/sun3x_defconfig renamed from arch/m68k/configs/sun3x_defconfig~lib-glob-convert-selftest-to-kunit +0 -1
@@ -547,7 +547,6 @@ CONFIG_CRYPTO_USER_API_AEAD=m
 CONFIG_PRIME_NUMBERS=m
 CONFIG_CRC_BENCHMARK=y
 CONFIG_XZ_DEC_TEST=m
-CONFIG_GLOB_SELFTEST=m
 # CONFIG_SECTION_MISMATCH_WARN_ONLY is not set
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_TEST_LOCKUP=m
lib/globtest.c deleted +0 -167

167 lines not on this page · raw message

lib/Kconfig renamed from lib/Kconfig~lib-glob-convert-selftest-to-kunit +0 -13
@@ -430,19 +430,6 @@ config GLOB
 	  are compiling an out-of tree driver which tells you that it
 	  depends on this.
 
-config GLOB_SELFTEST
-	tristate "glob self-test on init"
-	depends on GLOB
-	help
-	  This option enables a simple self-test of the glob_match
-	  function on startup.	It is primarily useful for people
-	  working on the code to ensure they haven't introduced any
-	  regressions.
-
-	  It only adds a little bit of code and slows kernel boot (or
-	  module load) by a small amount, so you're welcome to play with
-	  it, but you probably don't need it.
-
 #
 # Netlink attribute parsing support is select'ed if needed
 #
lib/Kconfig.debug renamed from lib/Kconfig.debug~lib-glob-convert-selftest-to-kunit +13 -0
@@ -3401,6 +3401,19 @@ config PRIME_NUMBERS_KUNIT_TEST
 
 	  If unsure, say N
 
+config GLOB_KUNIT_TEST
+	tristate "Glob matching test" if !KUNIT_ALL_TESTS
+	depends on GLOB
+	depends on KUNIT
+	default KUNIT_ALL_TESTS
+	help
+	  Enable this option to test the glob functions at runtime.
+
+	  This test suite verifies the correctness of glob_match() across various
+	  scenarios, including edge cases.
+
+	  If unsure, say N
+
 endif # RUNTIME_TESTING_MENU
 
 config ARCH_USE_MEMTEST
lib/Makefile renamed from lib/Makefile~lib-glob-convert-selftest-to-kunit +0 -1
@@ -224,7 +224,6 @@ obj-$(CONFIG_CLOSURES) += closure.o
 obj-$(CONFIG_DQL) += dynamic_queue_limits.o
 
 obj-$(CONFIG_GLOB) += glob.o
-obj-$(CONFIG_GLOB_SELFTEST) += globtest.o
 
 obj-$(CONFIG_DIMLIB) += dim/
 obj-$(CONFIG_SIGNATURE) += digsig.o
lib/tests/glob_kunit.c new file +125 -0

125 lines not on this page · raw message

lib/tests/Makefile renamed from lib/tests/Makefile~lib-glob-convert-selftest-to-kunit +1 -0
@@ -19,6 +19,7 @@ CFLAGS_fortify_kunit.o += $(DISABLE_STRU
 obj-$(CONFIG_FORTIFY_KUNIT_TEST) += fortify_kunit.o
 CFLAGS_test_fprobe.o += $(CC_FLAGS_FTRACE)
 obj-$(CONFIG_FPROBE_SANITY_TEST) += test_fprobe.o
+obj-$(CONFIG_GLOB_KUNIT_TEST) += glob_kunit.o
 obj-$(CONFIG_HASHTABLE_KUNIT_TEST) += hashtable_test.o
 obj-$(CONFIG_HASH_KUNIT_TEST) += test_hash.o
 obj-$(CONFIG_TEST_IOV_ITER) += kunit_iov_iter.o

_

Patches currently in -mm which might be from [email protected] are