Re: [PATCH] selftests: ALSA: Skip tests when devices are unavailable
From: Mark Brown
Date: Sat Sep 26 2026 - 12:55:46 EST
On Sat, Sep 26, 2026 at 09:57:56AM +0000, Alireza Feyzabadi Farahani wrote:
> A kernel built without CONFIG_SND exposes no ALSA devices. In that
> environment, the mixer and PCM tests currently report success with a
> zero-test plan, while the userspace timer tests fail when opening
> /dev/snd/timer. Neither result accurately describes an unsupported test
> environment.
>
> Report KSFT_SKIP when no sound cards are detected and when the timer
> device is unavailable. Keep the PCM missing-card failures when a matching
> hardware configuration says that a card should exist, and continue to
> fail timer opens for unexpected errors.
>
> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218479
The timer tests are clearly a good fix here but the other two programs
are a lot less clear - they aren't reporting any false errors, they're
just reporting a pass as they found no sound cards and therefore no
problems on them. Or to put it another way all the available sound
cards were fine. We don't know if this was due to missing configs, or
just that the machine physically has no sound cards (eg, a VM). I'd at
least make this two patches, or TBH just leave the PCM and mixer tests
alone. They certainly don't have an issue that needs fixing in the same
way that the timer test does.
Attachment:
signature.asc
Description: PGP signature