[PATCH 2/2] test/power_intel_uncore: skip test if init fails

Bruce Richardson bruce.richardson at intel.com
Thu May 15 18:58:54 CEST 2025


If the initialization of the uncore power management fails, mark the
test as skipped rather than a failure. This prevents false failures in
the case where we are running as a normal user, who doesn't have
permissions to edit uncore power states.

Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
---
 app/test/test_power_intel_uncore.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/app/test/test_power_intel_uncore.c b/app/test/test_power_intel_uncore.c
index 049658627d..973dc7a945 100644
--- a/app/test/test_power_intel_uncore.c
+++ b/app/test/test_power_intel_uncore.c
@@ -35,7 +35,7 @@ static int check_power_uncore_init(void)
 			"may occur if environment is not configured "
 			"correctly(APCI cpufreq) or operating in another valid "
 			"Power management environment\n", VALID_PKG, VALID_DIE);
-		return -1;
+		return TEST_SKIPPED;
 	}
 
 	/* Unsuccessful Test */
@@ -257,8 +257,11 @@ test_power_intel_uncore(void)
 	}
 
 	ret = check_power_uncore_init();
-	if (ret < 0)
+	if (ret != 0) {
+		if (ret == TEST_SKIPPED)
+			return TEST_SKIPPED;
 		goto fail_all;
+	}
 
 	ret = check_power_get_uncore_freq();
 	if (ret < 0)
-- 
2.48.1



More information about the dev mailing list