test: skip tests when missing requirements
[dpdk.git] / app / test / test_rcu_qsbr_perf.c
index c918a94..363365f 100644 (file)
@@ -606,6 +606,11 @@ test_rcu_qsbr_main(void)
 {
        uint16_t core_id;
 
+       if (rte_lcore_count() < 3) {
+               printf("Not enough cores for rcu_qsbr_perf_autotest, expecting at least 3\n");
+               return TEST_SKIPPED;
+       }
+
        rte_atomic64_init(&updates);
        rte_atomic64_init(&update_cycles);
        rte_atomic64_init(&checks);
@@ -618,11 +623,6 @@ test_rcu_qsbr_main(void)
        }
 
        printf("Number of cores provided = %d\n", num_cores);
-       if (num_cores < 2) {
-               printf("Test failed! Need 2 or more cores\n");
-               goto test_fail;
-       }
-
        printf("Perf test with all reader threads registered\n");
        printf("--------------------------------------------\n");
        all_registered = 1;