[Accel-config] [PATCH 4/5] accel-config/test: Skip tests if device is not configurable

ramesh.thomas at intel.com
Newsgroups dev.linux.lists.accel-config
Message-ID <[email protected]>
From: Ramesh Thomas <ramesh.thomas(a)intel.com>

None of the tests can be run if the devices are not configurable so
skip.

Signed-off-by: Ramesh Thomas <ramesh.thomas(a)intel.com>
---
 test/libaccfg.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/test/libaccfg.c b/test/libaccfg.c
index 0257ddb..951985d 100644
--- a/test/libaccfg.c
+++ b/test/libaccfg.c
@@ -1116,7 +1116,7 @@ int test_libaccfg(int loglevel, struct accfg_test *test,
 
 	/*
 	 * iterate to check the state of each device, skip entire test if any of
-	 * them is active
+	 * them is active or not configurable
 	 */
 	accfg_device_foreach(ctx, device) {
 		if (accfg_device_is_active(device)) {
@@ -1134,6 +1134,12 @@ int test_libaccfg(int loglevel, struct accfg_test *test,
 			fprintf(stderr, "device has no pasid support, skipping tests\n");
 			return EXIT_SKIP;
 		}
+
+		if (!accfg_device_get_configurable(device)) {
+			accfg_test_skip(test);
+			fprintf(stderr, "device is not configuratble, skipping tests\n");
+			return EXIT_SKIP;
+		}
 	}
 
 	for (i = 0; i < ARRAY_SIZE(test_cases); i++) {
-- 
2.26.3
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.