Skip to contentSkip to conversation

test: skip test when cores do not meet requirement

PATCH New Michael Santana 1 participant 1 message Jun 3, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 test: skip test when cores do not meet requirement

If the running platform does not meet the required 4 cores or more to run tests rcu_qsbr_autotest and hash_readwrite_autotest meson reports them as failed tests when they really should be skipped tests.

The working change can be shown here:
FAIL:
https://travis-ci.com/Maickii/dpdk-2/jobs/205045946#L645
https://travis-ci.com/Maickii/dpdk-2/jobs/205045946#L671
SKIP:
https://travis-ci.com/Maickii/dpdk-2/jobs/205047293#L645
https://travis-ci.com/Maickii/dpdk-2/jobs/205047293#L671

---
 app/test/test_hash_readwrite.c | 2 +-
 app/test/test_rcu_qsbr.c       | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
app/test/test_hash_readwrite.c +1 -1
index 480ae97d8..a34193e98 100644
@@ -621,7 +621,7 @@ test_hash_readwrite_main(void)
 	if (rte_lcore_count() <= 2) {
 		printf("More than two lcores are required "
 			"to do read write test\n");
-		return -1;
+		return TEST_SKIPPED;
 	}
 
 	RTE_LCORE_FOREACH_SLAVE(core_id) {
app/test/test_rcu_qsbr.c +2 -2
index 92ab0c20a..f3e02dd3f 100644
@@ -953,8 +953,8 @@ test_rcu_qsbr_main(void)
 		return -1;
 
 	if (num_cores < 4) {
-		printf("Test failed! Need 4 or more cores\n");
-		goto test_fail;
+		printf("Test skipped! Need 4 or more cores\n");
+		return TEST_SKIPPED;
 	}
 
 	/* Error-checking test cases */
Signature · 1 line
2.20.1