diff mbox series

gard: Add support to run gard tests on FSP platform

Message ID 20191021124416.8404-1-hegdevasant@linux.vnet.ibm.com
State Accepted
Headers show
Series gard: Add support to run gard tests on FSP platform | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch master (d75e82dbfbb9443efeb3f9a5921ac23605aab469)
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot success Test snowpatch/job/snowpatch-skiboot on branch master
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot-dco success Signed-off-by present

Commit Message

Vasant Hegde Oct. 21, 2019, 12:44 p.m. UTC
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@linux.vnet.ibm.com>
---
 external/gard/gard.c              | 12 ++++++------
 external/gard/test/tests/02-usage |  5 +++++
 2 files changed, 11 insertions(+), 6 deletions(-)

Comments

Stewart Smith Oct. 22, 2019, 2:55 a.m. UTC | #1
On Mon, Oct 21, 2019, at 5:44 AM, Vasant Hegde wrote:
> 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@linux.vnet.ibm.com>

(without actually building it or looking at context, but simply going from memory and previous discussion)

Acked-by: Stewart Smith <stewart@flamingspork.com>
Oliver O'Halloran Oct. 30, 2019, 6:28 a.m. UTC | #2
On Mon, Oct 21, 2019 at 11:44 PM Vasant Hegde
<hegdevasant@linux.vnet.ibm.com> wrote:
>
> 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@linux.vnet.ibm.com>

merged as of 49be337732ca
diff mbox series

Patch

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