build: make ring mempool driver mandatory
[dpdk.git] / app / test / test_rib.c
index c95957a..06058f8 100644 (file)
@@ -3,14 +3,31 @@
  * Copyright(c) 2019 Intel Corporation
  */
 
+#include "test.h"
+
 #include <stdio.h>
 #include <stdint.h>
 #include <stdlib.h>
 
 #include <rte_ip.h>
-#include <rte_rib.h>
 
-#include "test.h"
+#ifdef RTE_EXEC_ENV_WINDOWS
+static int
+test_rib(void)
+{
+       printf("rib not supported on Windows, skipping test\n");
+       return TEST_SKIPPED;
+}
+
+static int
+test_slow_rib(void)
+{
+       printf("slow_rib not supported on Windows, skipping test\n");
+       return TEST_SKIPPED;
+}
+#else
+
+#include <rte_rib.h>
 
 typedef int32_t (*rte_rib_test)(void);
 
@@ -76,7 +93,7 @@ test_multiple_create(void)
 
        config.ext_sz = 0;
 
-       for (i = 0; i < 10; i++) {
+       for (i = 0; i < 100; i++) {
                config.max_nodes = MAX_RULES - i;
                rib = rte_rib_create(__func__, SOCKET_ID_ANY, &config);
                RTE_TEST_ASSERT(rib != NULL, "Failed to create RIB\n");
@@ -329,7 +346,6 @@ static struct unit_test_suite rib_tests = {
        .teardown = NULL,
        .unit_test_cases = {
                TEST_CASE(test_create_invalid),
-               TEST_CASE(test_multiple_create),
                TEST_CASE(test_free_null),
                TEST_CASE(test_insert_invalid),
                TEST_CASE(test_get_fn),
@@ -339,6 +355,16 @@ static struct unit_test_suite rib_tests = {
        }
 };
 
+static struct unit_test_suite rib_slow_tests = {
+       .suite_name = "rib slow autotest",
+       .setup = NULL,
+       .teardown = NULL,
+       .unit_test_cases = {
+               TEST_CASE(test_multiple_create),
+               TEST_CASES_END()
+       }
+};
+
 /*
  * Do all unit tests.
  */
@@ -348,4 +374,13 @@ test_rib(void)
        return unit_test_suite_runner(&rib_tests);
 }
 
+static int
+test_slow_rib(void)
+{
+       return unit_test_suite_runner(&rib_slow_tests);
+}
+
+#endif /* !RTE_EXEC_ENV_WINDOWS */
+
 REGISTER_TEST_COMMAND(rib_autotest, test_rib);
+REGISTER_TEST_COMMAND(rib_slow_autotest, test_slow_rib);