Re: [PATCH 2/2] selftests: ALSA: pcmtest: Load the module when it is missing
From: Mark Brown
Date: Thu Nov 26 2026 - 11:11:41 EST
On Thu, Nov 26, 2026 at 12:55:25PM +0900, HyeongJun An wrote:
> 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.
> @@ -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();
It'd be polite to unload the module if we caused it to be loaded, though
potentially more trouble than it's worth. I'm also not sure if this
does the right thing if someone decided to build the driver in (to make
it easier to deploy onto a test system for example).
Attachment:
signature.asc
Description: PGP signature