Skip to contentSkip to conversation

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

PATCH Applied Cristian Marussi 3 participants 5 messages Sep 20, 2021 – Sep 21, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")

---
As a consequence KSelfTest TAP results will now report this when a signal-SVE testcase run on a system missing SVE:

\# selftests: arm64: fake_sigreturn_sve_change_vl \# Registered handlers for all signals.
\# Detected MINSTKSIGSZ:4720
\# Required Features: [ SVE ] NOT supported
\# ==>> completed. SKIP.
\# # FAKE_SIGRETURN_SVE_CHANGE :: Attempt to change SVE VL \# ok 7 selftests: arm64: fake_sigreturn_sve_change_vl # SKIP

---
 tools/testing/selftests/arm64/signal/test_signals_utils.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
tools/testing/selftests/arm64/signal/test_signals_utils.c +5 -2
index 6836510a522f..22722abc9dfa 100644
@@ -266,16 +266,19 @@ int test_init(struct tdescr *td)
 			td->feats_supported |= FEAT_SSBS;
 		if (getauxval(AT_HWCAP) & HWCAP_SVE)
 			td->feats_supported |= FEAT_SVE;
-		if (feats_ok(td))
+		if (feats_ok(td)) {
 			fprintf(stderr,
 				"Required Features: [%s] supported\n",
 				feats_to_string(td->feats_required &
 						td->feats_supported));
-		else
+		} else {
 			fprintf(stderr,
 				"Required Features: [%s] NOT supported\n",
 				feats_to_string(td->feats_required &
 						~td->feats_supported));
+			td->result = KSFT_SKIP;
+			return 0;
+		}
 	}
 
 	/* Perform test specific additional initialization */
Signature · 1 line
2.17.1
#1 lore raw
Quoted 3 lines · Cristian Marussi

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.

I have a version of this locally which I thought I'd sent out already among all the in flight patches I've got for kseltest but it looks like it didn't make it.

#2 lore raw
Quoted 10 lines · Mark Brown
Quoted 3 lines · Cristian Marussi

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.

I have a version of this locally which I thought I'd sent out already among all the in flight patches I've got for kseltest but it looks like it didn't make it.

Ah ok sorry, I did not know. Pick either as you wish.

Thanks,
Cristian

#3 lore raw
Quoted 6 lines · Cristian Marussi
Quoted 4 lines · Mark Brown
Quoted 3 lines · Cristian Marussi

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.

Quoted 7 lines
Quoted 5 lines

I have a version of this locally which I thought I'd sent out already among all the in flight patches I've got for kseltest but it looks like it didn't make it.

Ah ok sorry, I did not know. Pick either as you wish.

No, please use this one - like I say I thought I'd sent mine out but it looks like I didn't.

maintainer Applied
#4 lore raw
In reply to Cristian Marussi
Quoted 6 lines · Cristian Marussi

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.

Applied to arm64 (for-next/fixes), thanks!

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

      https://git.kernel.org/arm64/c/0e3dbf765fe2
Signature · 1 line
Catalin