[Skiboot] [PATCH] gard: Add support to run gard tests on FSP platform

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Mon Oct 21 23:44:16 AEDT 2019


gard tool is not supported on FSP based system. But we can still
run gard tests on FSP based system.

Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
---
 external/gard/gard.c              | 12 ++++++------
 external/gard/test/tests/02-usage |  5 +++++
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/external/gard/gard.c b/external/gard/gard.c
index 6f75932bc..5e58fede9 100644
--- a/external/gard/gard.c
+++ b/external/gard/gard.c
@@ -821,12 +821,6 @@ int main(int argc, char **argv)
 	memset(ctx, 0, sizeof(*ctx));
 	memset(&blank_record, 0xff, sizeof(blank_record));
 
-	if (is_fsp()) {
-		fprintf(stderr, "This is the OpenPower gard tool which does "
-				"not support FSP systems\n");
-		return EXIT_FAILURE;
-	}
-
 	/* process global options */
 	for (;;) {
 		int c;
@@ -866,6 +860,12 @@ int main(int argc, char **argv)
 	}
 
 
+	if (is_fsp() && !filename) {
+		fprintf(stderr, "This is the OpenPower gard tool which does "
+				"not support FSP systems\n");
+		return EXIT_FAILURE;
+	}
+
 
 	/*
 	 * It doesn't make sense to specify that we have the gard partition but
diff --git a/external/gard/test/tests/02-usage b/external/gard/test/tests/02-usage
index 290cca130..7ef3c04e6 100644
--- a/external/gard/test/tests/02-usage
+++ b/external/gard/test/tests/02-usage
@@ -1,5 +1,10 @@
 #! /bin/sh
 
+# This test fails on FSP based system. Hence skip this test.
+if [ -d "/proc/device-tree/fsps" ] ; then
+	return 0
+fi
+
 run_binary "./opal-gard"
 if [ "$?" -ne 1 ] ; then
 	fail_test
-- 
2.21.0



More information about the Skiboot mailing list