Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kselftest/arm64: signal: Skip tests if required features are missing

During initialization of a signal testcase, features declared as required
are properly checked against the running system but no action is then taken
to effectively skip such a testcase.

Fix core signals test logic to abort initialization and report such a
testcase as skipped to the KSelfTest framework.

Fixes: f96bf4340316 ("kselftest: arm64: mangle_pstate_invalid_compat_toggle and common utils")
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210920121228.35368-1-cristian.marussi@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>

authored by

Cristian Marussi and committed by
Catalin Marinas
0e3dbf76 59a68d41

+5 -2
+5 -2
tools/testing/selftests/arm64/signal/test_signals_utils.c
··· 266 266 td->feats_supported |= FEAT_SSBS; 267 267 if (getauxval(AT_HWCAP) & HWCAP_SVE) 268 268 td->feats_supported |= FEAT_SVE; 269 - if (feats_ok(td)) 269 + if (feats_ok(td)) { 270 270 fprintf(stderr, 271 271 "Required Features: [%s] supported\n", 272 272 feats_to_string(td->feats_required & 273 273 td->feats_supported)); 274 - else 274 + } else { 275 275 fprintf(stderr, 276 276 "Required Features: [%s] NOT supported\n", 277 277 feats_to_string(td->feats_required & 278 278 ~td->feats_supported)); 279 + td->result = KSFT_SKIP; 280 + return 0; 281 + } 279 282 } 280 283 281 284 /* Perform test specific additional initialization */