mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] selftests/alsa: Let the pcmtest test run on kselftest kernels
@ 2026-11-26  3:55 HyeongJun An
  2026-11-26  3:55 ` [PATCH 1/2] selftests/alsa: Add a config file for the test-only options HyeongJun An
  2026-11-26  3:55 ` [PATCH 2/2] selftests: ALSA: pcmtest: Load the module when it is missing HyeongJun An
  0 siblings, 2 replies; 3+ messages in thread
From: HyeongJun An @ 2026-11-26  3:55 UTC (permalink / raw)
  To: Mark Brown, Takashi Iwai
  Cc: Jaroslav Kysela, Shuah Khan, Ivan Orlov, Ben Copeland,
	linux-sound, linux-kselftest, linux-kernel, HyeongJun An

On the kernels that CI labs such as KernelCI build for kselftest, every
test-pcmtest-driver case skips. The KernelCI arm64 kselftest kernel has
CONFIG_SND_PCMTEST, CONFIG_SND_SEQ_UMP and CONFIG_SND_UTIMER off, and
nothing would load the pcmtest module even if it were built.

Patch 1 adds a config file for make kselftest-merge with only the
options the tests themselves need. When Ben sent a config file in March
[1], Mark pointed out that mixer-test and pcm-test check whatever
drivers a system has, while test-pcmtest-driver does need a config
option for its module. So no drivers are listed here. Patch 2 lets
test-pcmtest-driver load the module itself.

Tested in QEMU (x86_64) on sound/for-next 0dfd513a1557, with a kernel
from defconfig and make kselftest-merge and no sound modules loaded at
boot. All four options are on with patch 1 and off without it. On the
kernel with patch 1, test-pcmtest-driver goes from 10 skipped to 10
passed with patch 2, and seq-ump-test, which skips without
CONFIG_SND_SEQ_UMP, passes.

[1] https://lore.kernel.org/all/20260319084347.134744-1-ben.copeland@linaro.org/

Prepared with Claude Code (Claude Opus 5.5).

HyeongJun An (2):
  selftests/alsa: Add a config file for the test-only options
  selftests: ALSA: pcmtest: Load the module when it is missing

 tools/testing/selftests/alsa/config                | 6 ++++++
 tools/testing/selftests/alsa/test-pcmtest-driver.c | 4 ++++
 2 files changed, 10 insertions(+)
 create mode 100644 tools/testing/selftests/alsa/config

-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] selftests/alsa: Add a config file for the test-only options
  2026-11-26  3:55 [PATCH 0/2] selftests/alsa: Let the pcmtest test run on kselftest kernels HyeongJun An
@ 2026-11-26  3:55 ` HyeongJun An
  2026-11-26  3:55 ` [PATCH 2/2] selftests: ALSA: pcmtest: Load the module when it is missing HyeongJun An
  1 sibling, 0 replies; 3+ messages in thread
From: HyeongJun An @ 2026-11-26  3:55 UTC (permalink / raw)
  To: Mark Brown, Takashi Iwai
  Cc: Jaroslav Kysela, Shuah Khan, Ivan Orlov, Ben Copeland,
	linux-sound, linux-kselftest, linux-kernel, HyeongJun An

Some of the ALSA selftests need kernel options that a normal config does
not enable. test-pcmtest-driver needs the pcmtest driver, seq-ump-test
needs CONFIG_SND_SEQ_UMP, utimer-test needs CONFIG_SND_UTIMER, and
aloop-test needs snd-aloop. Without them these tests skip.

CI systems build their kselftest kernels with make kselftest-merge, which
merges the config file of each selftest directory, and alsa has none. On
the KernelCI arm64 kselftest kernel all four options are off, and every
test-pcmtest-driver case skips.

Add a config file with only these options. mixer-test and pcm-test check
whatever sound drivers a system has, so no drivers are listed.

Signed-off-by: HyeongJun An <sammiee5311@gmail.com>
---
 tools/testing/selftests/alsa/config | 6 ++++++
 1 file changed, 6 insertions(+)
 create mode 100644 tools/testing/selftests/alsa/config

diff --git a/tools/testing/selftests/alsa/config b/tools/testing/selftests/alsa/config
new file mode 100644
index 000000000000..67fa26a87217
--- /dev/null
+++ b/tools/testing/selftests/alsa/config
@@ -0,0 +1,6 @@
+CONFIG_DEBUG_FS=y
+CONFIG_SND_ALOOP=m
+CONFIG_SND_PCMTEST=m
+CONFIG_SND_SEQUENCER=m
+CONFIG_SND_SEQ_UMP=y
+CONFIG_SND_UTIMER=y
-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2/2] selftests: ALSA: pcmtest: Load the module when it is missing
  2026-11-26  3:55 [PATCH 0/2] selftests/alsa: Let the pcmtest test run on kselftest kernels HyeongJun An
  2026-11-26  3:55 ` [PATCH 1/2] selftests/alsa: Add a config file for the test-only options HyeongJun An
@ 2026-11-26  3:55 ` HyeongJun An
  1 sibling, 0 replies; 3+ messages in thread
From: HyeongJun An @ 2026-11-26  3:55 UTC (permalink / raw)
  To: Mark Brown, Takashi Iwai
  Cc: Jaroslav Kysela, Shuah Khan, Ivan Orlov, Ben Copeland,
	linux-sound, linux-kselftest, linux-kernel, HyeongJun An

test-pcmtest-driver skips when the pcmtest debugfs files are missing.
The driver has no device to bind to, so nothing loads the module, and the
test skips even on a kernel that builds it.

Run modprobe once before skipping, as the net pktgen test does. The
module stays loaded. In the default order the test runs after mixer-test
and pcm-test, so the extra card does not change what they check.

Signed-off-by: HyeongJun An <sammiee5311@gmail.com>
---
 tools/testing/selftests/alsa/test-pcmtest-driver.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/testing/selftests/alsa/test-pcmtest-driver.c b/tools/testing/selftests/alsa/test-pcmtest-driver.c
index b796a5613c6f..ea6a9e0f7483 100644
--- a/tools/testing/selftests/alsa/test-pcmtest-driver.c
+++ b/tools/testing/selftests/alsa/test-pcmtest-driver.c
@@ -6,6 +6,7 @@
  * Copyright 2023 Ivan Orlov <ivan.orlov0322@gmail.com>
  */
 #include <errno.h>
+#include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 #include <alsa/asoundlib.h>
@@ -171,6 +172,9 @@ FIXTURE_SETUP(pcmtest) {
 		SKIP(return, "This test needs root to run!");
 
 	err = read_patterns();
+	/* nothing loads the module on its own, so ask for it */
+	if (err && !system("modprobe -q snd-pcmtest"))
+		err = read_patterns();
 	if (err)
 		SKIP(return, "Can't read patterns. Probably, module isn't loaded");
 
-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-26  3:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-26  3:55 [PATCH 0/2] selftests/alsa: Let the pcmtest test run on kselftest kernels HyeongJun An
2026-11-26  3:55 ` [PATCH 1/2] selftests/alsa: Add a config file for the test-only options HyeongJun An
2026-11-26  3:55 ` [PATCH 2/2] selftests: ALSA: pcmtest: Load the module when it is missing HyeongJun An

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®