[1/2] test/rib: speed up rib autotests

Message ID dd22d4d965e4e932a7e3408ea889dc3fe2892cce.1573042633.git.vladimir.medvedkin@intel.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series [1/2] test/rib: speed up rib autotests |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail apply issues

Commit Message

Vladimir Medvedkin Nov. 6, 2019, 12:21 p.m. UTC
  Split slow part of rib_autotest into rib_slow_autotest

Fixes: b35df4dd666e ("test/rib: add autotests")

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
---
 app/test/autotest_data.py |  6 ++++++
 app/test/meson.build      |  1 +
 app/test/test_rib.c       | 20 ++++++++++++++++++--
 3 files changed, 25 insertions(+), 2 deletions(-)
  

Comments

Aaron Conole Nov. 7, 2019, 3:21 p.m. UTC | #1
Vladimir Medvedkin <vladimir.medvedkin@intel.com> writes:

> Split slow part of rib_autotest into rib_slow_autotest
>
> Fixes: b35df4dd666e ("test/rib: add autotests")
>
> Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
> ---

Acked-by: Aaron Conole <aconole@redhat.com>
  
David Marchand Nov. 7, 2019, 4:42 p.m. UTC | #2
On Thu, Nov 7, 2019 at 4:21 PM Aaron Conole <aconole@redhat.com> wrote:
>
> Vladimir Medvedkin <vladimir.medvedkin@intel.com> writes:
>
> > Split slow part of rib_autotest into rib_slow_autotest
> >
> > Fixes: b35df4dd666e ("test/rib: add autotests")
> >
> > Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
> > ---
>
> Acked-by: Aaron Conole <aconole@redhat.com>

Series applied, thanks.



--
David Marchand
  

Patch

diff --git a/app/test/autotest_data.py b/app/test/autotest_data.py
index e89707e..ab150db 100644
--- a/app/test/autotest_data.py
+++ b/app/test/autotest_data.py
@@ -117,6 +117,12 @@ 
         "Report":  None,
     },
     {
+        "Name":    "RIB slow autotest",
+        "Command": "rib_slow_autotest",
+        "Func":    default_autotest,
+        "Report":  None,
+    },
+    {
         "Name":    "RIB6 autotest",
         "Command": "rib6_autotest",
         "Func":    default_autotest,
diff --git a/app/test/meson.build b/app/test/meson.build
index 37ab9d2..8847d5a 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -259,6 +259,7 @@  perf_test_names = [
         'reciprocal_division',
         'reciprocal_division_perf',
         'lpm_perf_autotest',
+        'rib_slow_autotest',
         'fib_slow_autotest',
         'fib_perf_autotest',
         'red_all',
diff --git a/app/test/test_rib.c b/app/test/test_rib.c
index c95957a..3dc48fe 100644
--- a/app/test/test_rib.c
+++ b/app/test/test_rib.c
@@ -76,7 +76,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 +329,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 +338,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 +357,11 @@  test_rib(void)
 	return unit_test_suite_runner(&rib_tests);
 }
 
+static int
+test_slow_rib(void)
+{
+	return unit_test_suite_runner(&rib_slow_tests);
+}
+
 REGISTER_TEST_COMMAND(rib_autotest, test_rib);
+REGISTER_TEST_COMMAND(rib_slow_autotest, test_slow_rib);