DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/6] test: refactor crypto unit test framework
@ 2021-03-16 14:32 Ciara Power
  2021-03-16 14:32 ` [dpdk-dev] [PATCH 1/6] app/test: refactor of unit test suite runner Ciara Power
                   ` (7 more replies)
  0 siblings, 8 replies; 14+ messages in thread
From: Ciara Power @ 2021-03-16 14:32 UTC (permalink / raw)
  To: dev; +Cc: declan.doherty, Ciara Power

The current crypto unit test framework is not granular enough to
accurately track unit test results. This is caused by one testcase
in a suite actually running multiple testcases, but only returning
one result.
 
The approach taken in this patchset allows a test suite have either a
list of sub-testsuites, or a list of testcases as previously used.
The unit test suite runner can then recursively iterate and run the
sub-testsuites, until it reaches a suite with testcases,
and it then runs each testcase as it had done previously.
 
By allowing this further breakdown into sub-testsuites,
a refactor of the crypto unit tests solves the issue of inaccurate
reporting, as sub-testsuites can be used in place of the testcases
that had multiple testcases hidden on a sub level.
The blockcipher tests previously had these hidden testcases,
but are now sub-testsuites that are dynamically created and added to a
parent test suite, allowing for each testcase status to be reported
directly to the runner.
The cryptodev test suite is broken down into smaller suites that are
used as sub-testsuites, which allows for more flexibility choosing which
sub-testsuites should run for the current device autotest.
The introduction of sub-testsuites also allows for more precise
setup/teardown functions, rather than general ones loaded with
conditions as was seen with the initial setup function used for all
crypto testsuites.
 
For example, when running the cryptodev_aesni_mb_autotest, 
the AESNI MB parent test suite has its own setup function to initialise
the AESNI MB device.
Various sub-testsuites are added to the parent test suite, such as some
of the static suites that were once in the cryptodev_testsuite,
and blockcipher suites.
The unit test runner can then run the AESNI MB parent test suite,
which in turn will run the sub-testsuites.
 
Documentation will be added in a later version of the patchset,
adding to the test document that isn't yet merged. [1]

---
[1] https://patchwork.dpdk.org/project/dpdk/patch/20210309155757.615536-1-aconole@redhat.com/

Ciara Power (6):
  app/test: refactor of unit test suite runner
  test: introduce parent testsuite format
  test/crypto: refactor to use sub-testsuites
  test/crypto: move testsuite params to header file
  test/crypto: dynamically build blockcipher suite
  doc: add unit test suite change to release notes

 app/test/test.c                        |  168 +-
 app/test/test.h                        |   22 +-
 app/test/test_bitratestats.c           |    4 +-
 app/test/test_compressdev.c            |    4 +-
 app/test/test_cryptodev.c              | 2020 ++++++++++++++++++------
 app/test/test_cryptodev.h              |   20 +
 app/test/test_cryptodev_asym.c         |  105 +-
 app/test/test_cryptodev_blockcipher.c  |  121 +-
 app/test/test_cryptodev_blockcipher.h  |   12 +-
 app/test/test_ethdev_link.c            |    4 +-
 app/test/test_event_crypto_adapter.c   |    4 +-
 app/test/test_event_eth_rx_adapter.c   |    8 +-
 app/test/test_event_eth_tx_adapter.c   |    4 +-
 app/test/test_event_timer_adapter.c    |    4 +-
 app/test/test_eventdev.c               |    4 +-
 app/test/test_fbarray.c                |    4 +-
 app/test/test_fib.c                    |    8 +-
 app/test/test_fib6.c                   |    8 +-
 app/test/test_graph.c                  |    4 +-
 app/test/test_graph_perf.c             |    4 +-
 app/test/test_ipfrag.c                 |    4 +-
 app/test/test_ipsec.c                  |   36 +-
 app/test/test_ipsec_sad.c              |    4 +-
 app/test/test_latencystats.c           |    4 +-
 app/test/test_link_bonding.c           |    4 +-
 app/test/test_link_bonding_mode4.c     |    4 +-
 app/test/test_link_bonding_rssconf.c   |    4 +-
 app/test/test_metrics.c                |    4 +-
 app/test/test_pmd_ring.c               |    4 +-
 app/test/test_reorder.c                |    4 +-
 app/test/test_rib.c                    |    8 +-
 app/test/test_rib6.c                   |    8 +-
 app/test/test_security.c               |    4 +-
 app/test/test_service_cores.c          |    4 +-
 app/test/test_trace.c                  |    4 +-
 doc/guides/rel_notes/release_21_05.rst |    5 +
 36 files changed, 1898 insertions(+), 739 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [dpdk-dev] [PATCH 1/6] app/test: refactor of unit test suite runner
  2021-03-16 14:32 [dpdk-dev] [PATCH 0/6] test: refactor crypto unit test framework Ciara Power
@ 2021-03-16 14:32 ` Ciara Power
  2021-03-31 14:42   ` Aaron Conole
  2021-03-16 14:32 ` [dpdk-dev] [PATCH 2/6] test: introduce parent testsuite format Ciara Power
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 14+ messages in thread
From: Ciara Power @ 2021-03-16 14:32 UTC (permalink / raw)
  To: dev; +Cc: declan.doherty, Ciara Power

Some small changes were made to the unit test suite runner for
readability and to enable reuse of some of the function in a later patch.

On test suite setup skip/fail, the loop to count testcases as
skipped/failed has been moved to another function.
This will allow for recursion in a later patch when nested sub-testsuites
are used.

The unit test suite runner accessed the list of testcases in the suite
structure every time the testcase was used. This is now replaced by a
testcase variable which improves readability.

The summary output now prints the suite name, this will be useful later
when multiple nested sub-testsuites are being run.

Signed-off-by: Ciara Power <ciara.power@intel.com>
---
 app/test/test.c | 51 ++++++++++++++++++++++++++++++++-----------------
 1 file changed, 33 insertions(+), 18 deletions(-)

diff --git a/app/test/test.c b/app/test/test.c
index 624dd48042..72768c8854 100644
--- a/app/test/test.c
+++ b/app/test/test.c
@@ -207,6 +207,23 @@ main(int argc, char **argv)
 	return ret;
 }
 
+static void
+unit_test_suite_count_tcs_on_setup_fail(struct unit_test_suite *suite,
+		int test_success, unsigned int *total, unsigned int *skipped,
+		unsigned int *failed)
+{
+	struct unit_test_case tc;
+
+	tc = suite->unit_test_cases[*total];
+	while (tc.testcase) {
+		if (!tc.enabled || test_success == TEST_SKIPPED)
+			(*skipped)++;
+		else
+			(*failed)++;
+		(*total)++;
+		tc = suite->unit_test_cases[*total];
+	}
+}
 
 int
 unit_test_suite_runner(struct unit_test_suite *suite)
@@ -215,6 +232,7 @@ unit_test_suite_runner(struct unit_test_suite *suite)
 	unsigned int total = 0, executed = 0, skipped = 0;
 	unsigned int succeeded = 0, failed = 0, unsupported = 0;
 	const char *status;
+	struct unit_test_case tc;
 
 	if (suite->suite_name) {
 		printf(" + ------------------------------------------------------- +\n");
@@ -228,38 +246,35 @@ unit_test_suite_runner(struct unit_test_suite *suite)
 			 * setup did not pass, so count all enabled tests and
 			 * mark them as failed/skipped
 			 */
-			while (suite->unit_test_cases[total].testcase) {
-				if (!suite->unit_test_cases[total].enabled ||
-				    test_success == TEST_SKIPPED)
-					skipped++;
-				else
-					failed++;
-				total++;
-			}
+			unit_test_suite_count_tcs_on_setup_fail(suite,
+					test_success, &total,
+					&skipped, &failed);
 			goto suite_summary;
 		}
 	}
 
 	printf(" + ------------------------------------------------------- +\n");
 
-	while (suite->unit_test_cases[total].testcase) {
-		if (!suite->unit_test_cases[total].enabled) {
+	tc = suite->unit_test_cases[total];
+	while (tc.testcase) {
+		if (!tc.enabled) {
 			skipped++;
 			total++;
+			tc = suite->unit_test_cases[total];
 			continue;
 		} else {
 			executed++;
 		}
 
 		/* run test case setup */
-		if (suite->unit_test_cases[total].setup)
-			test_success = suite->unit_test_cases[total].setup();
+		if (tc.setup)
+			test_success = tc.setup();
 		else
 			test_success = TEST_SUCCESS;
 
 		if (test_success == TEST_SUCCESS) {
 			/* run the test case */
-			test_success = suite->unit_test_cases[total].testcase();
+			test_success = tc.testcase();
 			if (test_success == TEST_SUCCESS)
 				succeeded++;
 			else if (test_success == TEST_SKIPPED)
@@ -275,8 +290,8 @@ unit_test_suite_runner(struct unit_test_suite *suite)
 		}
 
 		/* run the test case teardown */
-		if (suite->unit_test_cases[total].teardown)
-			suite->unit_test_cases[total].teardown();
+		if (tc.teardown)
+			tc.teardown();
 
 		if (test_success == TEST_SUCCESS)
 			status = "succeeded";
@@ -287,10 +302,10 @@ unit_test_suite_runner(struct unit_test_suite *suite)
 		else
 			status = "failed";
 
-		printf(" + TestCase [%2d] : %s %s\n", total,
-				suite->unit_test_cases[total].name, status);
+		printf(" + TestCase [%2d] : %s %s\n", total, tc.name, status);
 
 		total++;
+		tc = suite->unit_test_cases[total];
 	}
 
 	/* Run test suite teardown */
@@ -301,7 +316,7 @@ unit_test_suite_runner(struct unit_test_suite *suite)
 
 suite_summary:
 	printf(" + ------------------------------------------------------- +\n");
-	printf(" + Test Suite Summary \n");
+	printf(" + Test Suite Summary : %s\n", suite->suite_name);
 	printf(" + Tests Total :       %2d\n", total);
 	printf(" + Tests Skipped :     %2d\n", skipped);
 	printf(" + Tests Executed :    %2d\n", executed);
-- 
2.25.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [dpdk-dev] [PATCH 2/6] test: introduce parent testsuite format
  2021-03-16 14:32 [dpdk-dev] [PATCH 0/6] test: refactor crypto unit test framework Ciara Power
  2021-03-16 14:32 ` [dpdk-dev] [PATCH 1/6] app/test: refactor of unit test suite runner Ciara Power
@ 2021-03-16 14:32 ` Ciara Power
  2021-03-31 14:42   ` Aaron Conole
  2021-03-16 14:32 ` [dpdk-dev] [PATCH 3/6] test/crypto: refactor to use sub-testsuites Ciara Power
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 14+ messages in thread
From: Ciara Power @ 2021-03-16 14:32 UTC (permalink / raw)
  To: dev
  Cc: declan.doherty, Ciara Power, Fiona Trahe, Ashish Gupta,
	Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko,
	Abhinandan Gujjar, Jay Jayatheerthan, Erik Gabriel Carrillo,
	Jerin Jacob, Anatoly Burakov, Vladimir Medvedkin, Kiran Kumar K,
	Nithin Dabilpuram, Konstantin Ananyev, Bernard Iremonger,
	Reshma Pattan, Chas Williams, Min Hu (Connor),
	Bruce Richardson, Akhil Goyal, Harry van Haaren,
	Sunil Kumar Kori

The current structure for unit testing only allows for running a
test suite with nested test cases. This means all test cases for an
autotest must be in one suite, which is not ideal.
For example, in some cases we may want to run multiple lists of test
cases that each require different setup, so should be in separate suites.

The unit test suite struct is modified to hold either a pointer to a
list of test cases, or a pointer to a list of sub-testsuites.
A bool value is also introduced here to indicate whether the testsuite
is a parent suite or not.

Signed-off-by: Ciara Power <ciara.power@intel.com>
---
 app/test/test.c                      | 151 ++++++++++++++++++---------
 app/test/test.h                      |   6 +-
 app/test/test_bitratestats.c         |   4 +-
 app/test/test_compressdev.c          |   4 +-
 app/test/test_cryptodev.c            |  24 ++---
 app/test/test_cryptodev_asym.c       |  12 +--
 app/test/test_ethdev_link.c          |   4 +-
 app/test/test_event_crypto_adapter.c |   4 +-
 app/test/test_event_eth_rx_adapter.c |   8 +-
 app/test/test_event_eth_tx_adapter.c |   4 +-
 app/test/test_event_timer_adapter.c  |   4 +-
 app/test/test_eventdev.c             |   4 +-
 app/test/test_fbarray.c              |   4 +-
 app/test/test_fib.c                  |   8 +-
 app/test/test_fib6.c                 |   8 +-
 app/test/test_graph.c                |   4 +-
 app/test/test_graph_perf.c           |   4 +-
 app/test/test_ipfrag.c               |   4 +-
 app/test/test_ipsec.c                |   4 +-
 app/test/test_ipsec_sad.c            |   4 +-
 app/test/test_latencystats.c         |   4 +-
 app/test/test_link_bonding.c         |   4 +-
 app/test/test_link_bonding_mode4.c   |   4 +-
 app/test/test_link_bonding_rssconf.c |   4 +-
 app/test/test_metrics.c              |   4 +-
 app/test/test_pmd_ring.c             |   4 +-
 app/test/test_reorder.c              |   4 +-
 app/test/test_rib.c                  |   8 +-
 app/test/test_rib6.c                 |   8 +-
 app/test/test_security.c             |   4 +-
 app/test/test_service_cores.c        |   4 +-
 app/test/test_trace.c                |   4 +-
 32 files changed, 188 insertions(+), 137 deletions(-)

diff --git a/app/test/test.c b/app/test/test.c
index 72768c8854..fe40a91f97 100644
--- a/app/test/test.c
+++ b/app/test/test.c
@@ -213,24 +213,37 @@ unit_test_suite_count_tcs_on_setup_fail(struct unit_test_suite *suite,
 		unsigned int *failed)
 {
 	struct unit_test_case tc;
-
-	tc = suite->unit_test_cases[*total];
-	while (tc.testcase) {
-		if (!tc.enabled || test_success == TEST_SKIPPED)
-			(*skipped)++;
-		else
-			(*failed)++;
-		(*total)++;
-		tc = suite->unit_test_cases[*total];
+	int i, tc_count = 0;
+
+	if (suite->parent_testsuite) {
+		for (i = 0; suite->unit_test_suites[i].suite_name != NULL; i++)
+			unit_test_suite_count_tcs_on_setup_fail(
+				&suite->unit_test_suites[i],
+				test_success, total,
+				skipped, failed);
+	} else {
+		tc = suite->unit_test_cases[tc_count];
+		while (tc.testcase) {
+			if (!tc.enabled ||
+			test_success == TEST_SKIPPED)
+				(*skipped)++;
+			else
+				(*failed)++;
+			tc_count++;
+			tc = suite->unit_test_cases[tc_count];
+		}
+		*total += tc_count;
 	}
 }
 
 int
 unit_test_suite_runner(struct unit_test_suite *suite)
 {
-	int test_success;
+	int test_success, i, ret;
 	unsigned int total = 0, executed = 0, skipped = 0;
 	unsigned int succeeded = 0, failed = 0, unsupported = 0;
+	unsigned int sub_ts_succeeded = 0, sub_ts_failed = 0;
+	unsigned int sub_ts_skipped = 0, sub_ts_total = 0;
 	const char *status;
 	struct unit_test_case tc;
 
@@ -255,63 +268,80 @@ unit_test_suite_runner(struct unit_test_suite *suite)
 
 	printf(" + ------------------------------------------------------- +\n");
 
-	tc = suite->unit_test_cases[total];
-	while (tc.testcase) {
-		if (!tc.enabled) {
-			skipped++;
-			total++;
-			tc = suite->unit_test_cases[total];
-			continue;
-		} else {
-			executed++;
+	if (suite->parent_testsuite) {
+		for (i = 0; suite->unit_test_suites[i].suite_name != NULL; i++) {
+			ret = unit_test_suite_runner(&suite->unit_test_suites[i]);
+			if (ret == TEST_SUCCESS)
+				sub_ts_succeeded++;
+			else if (ret == TEST_SKIPPED)
+				sub_ts_skipped++;
+			else
+				sub_ts_failed++;
+			sub_ts_total++;
 		}
+	} else {
+		tc = suite->unit_test_cases[total];
+		while (tc.testcase) {
+			if (!tc.enabled) {
+				skipped++;
+				total++;
+				tc = suite->unit_test_cases[total];
+				continue;
+			} else {
+				executed++;
+			}
+
+			/* run test case setup */
+			if (tc.setup)
+				test_success = tc.setup();
+			else
+				test_success = TEST_SUCCESS;
+
+			if (test_success == TEST_SUCCESS) {
+				/* run the test case */
+				test_success = tc.testcase();
+				if (test_success == TEST_SUCCESS)
+					succeeded++;
+				else if (test_success == TEST_SKIPPED)
+					skipped++;
+				else if (test_success == -ENOTSUP)
+					unsupported++;
+				else
+					failed++;
+			} else if (test_success == -ENOTSUP) {
+				unsupported++;
+			} else {
+				failed++;
+			}
 
-		/* run test case setup */
-		if (tc.setup)
-			test_success = tc.setup();
-		else
-			test_success = TEST_SUCCESS;
+			/* run the test case teardown */
+			if (tc.teardown)
+				tc.teardown();
 
-		if (test_success == TEST_SUCCESS) {
-			/* run the test case */
-			test_success = tc.testcase();
 			if (test_success == TEST_SUCCESS)
-				succeeded++;
+				status = "succeeded";
 			else if (test_success == TEST_SKIPPED)
-				skipped++;
+				status = "skipped";
 			else if (test_success == -ENOTSUP)
-				unsupported++;
+				status = "unsupported";
 			else
-				failed++;
-		} else if (test_success == -ENOTSUP) {
-			unsupported++;
-		} else {
-			failed++;
-		}
-
-		/* run the test case teardown */
-		if (tc.teardown)
-			tc.teardown();
-
-		if (test_success == TEST_SUCCESS)
-			status = "succeeded";
-		else if (test_success == TEST_SKIPPED)
-			status = "skipped";
-		else if (test_success == -ENOTSUP)
-			status = "unsupported";
-		else
-			status = "failed";
+				status = "failed";
 
-		printf(" + TestCase [%2d] : %s %s\n", total, tc.name, status);
+			printf(" + TestCase [%2d] : %s %s\n", total,
+					tc.name, status);
 
-		total++;
-		tc = suite->unit_test_cases[total];
+			total++;
+			tc = suite->unit_test_cases[total];
+		}
 	}
 
 	/* Run test suite teardown */
 	if (suite->teardown)
 		suite->teardown();
 
+	if (suite->parent_testsuite)
+		goto parent_suite_summary;
+
 	goto suite_summary;
 
 suite_summary:
@@ -332,4 +362,21 @@ unit_test_suite_runner(struct unit_test_suite *suite)
 	if (total == skipped)
 		return TEST_SKIPPED;
 	return TEST_SUCCESS;
+
+parent_suite_summary:
+	printf(" + ------------------------------------------------------- +\n");
+	printf(" + Parent Test Suite Summary :  %s\n", suite->suite_name);
+	printf(" + Sub Testsuites Total :       %2d\n", sub_ts_total);
+	printf(" + Sub Testsuites Skipped :     %2d\n", sub_ts_skipped);
+	printf(" + Sub Testsuites Passed :      %2d\n", sub_ts_succeeded);
+	printf(" + Sub Testsuites Failed :      %2d\n", sub_ts_failed);
+	printf(" + ------------------------------------------------------- +\n");
+
+	last_test_result = failed;
+
+	if (sub_ts_failed)
+		return TEST_FAILED;
+	if (sub_ts_total == sub_ts_skipped)
+		return TEST_SKIPPED;
+	return TEST_SUCCESS;
 }
diff --git a/app/test/test.h b/app/test/test.h
index b07f6c1ef0..3fdac56631 100644
--- a/app/test/test.h
+++ b/app/test/test.h
@@ -138,7 +138,11 @@ struct unit_test_suite {
 	const char *suite_name;
 	int (*setup)(void);
 	void (*teardown)(void);
-	struct unit_test_case unit_test_cases[];
+	bool parent_testsuite;
+	union {
+		struct unit_test_case *unit_test_cases;
+		struct unit_test_suite *unit_test_suites;
+	};
 };
 
 int unit_test_suite_runner(struct unit_test_suite *suite);
diff --git a/app/test/test_bitratestats.c b/app/test/test_bitratestats.c
index f4a92c9be6..a3fe5e839a 100644
--- a/app/test/test_bitratestats.c
+++ b/app/test/test_bitratestats.c
@@ -189,7 +189,7 @@ unit_test_suite bitratestats_testsuite  = {
 	.suite_name = "BitRate Stats Unit Test Suite",
 	.setup = test_bit_ring_setup,
 	.teardown = test_bit_ring_free,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 		/* TEST CASE 1: Test to create bit rate data */
 		TEST_CASE(test_stats_bitrate_create),
 
@@ -231,7 +231,7 @@ unit_test_suite bitratestats_testsuite  = {
 		/* TEST CASE 9: Test to do the cleanup w.r.t create */
 		TEST_CASE(test_stats_bitrate_free),
 		TEST_CASES_END()
-	}
+	})
 };
 
 static int
diff --git a/app/test/test_compressdev.c b/app/test/test_compressdev.c
index 0571c17ecb..7789511bd0 100644
--- a/app/test/test_compressdev.c
+++ b/app/test/test_compressdev.c
@@ -4183,7 +4183,7 @@ static struct unit_test_suite compressdev_testsuite  = {
 	.suite_name = "compressdev unit test suite",
 	.setup = testsuite_setup,
 	.teardown = testsuite_teardown,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE_ST(NULL, NULL,
 			test_compressdev_invalid_configuration),
 		TEST_CASE_ST(generic_ut_setup, generic_ut_teardown,
@@ -4261,7 +4261,7 @@ static struct unit_test_suite compressdev_testsuite  = {
 		      test_compressdev_deflate_im_buffers_SGL_over_2ops_second),
 
 		TEST_CASES_END() /**< NULL terminate unit test array */
-	}
+	})
 };
 
 static int
diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index f91debc168..bdfb2727dd 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -13247,7 +13247,7 @@ static struct unit_test_suite cryptodev_scheduler_testsuite  = {
 	.suite_name = "Crypto Device Scheduler Unit Test Suite",
 	.setup = testsuite_setup,
 	.teardown = testsuite_teardown,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 		/* Multi Core */
 		TEST_CASE_ST(NULL, NULL, test_scheduler_attach_slave_op),
 		TEST_CASE_ST(NULL, NULL, test_scheduler_mode_multicore_op),
@@ -13281,7 +13281,7 @@ static struct unit_test_suite cryptodev_scheduler_testsuite  = {
 		TEST_CASE_ST(NULL, NULL, test_scheduler_detach_slave_op),
 
 		TEST_CASES_END() /**< NULL terminate unit test array */
-	}
+	})
 };
 
 #endif /* RTE_CRYPTO_SCHEDULER */
@@ -13290,7 +13290,7 @@ static struct unit_test_suite cryptodev_testsuite  = {
 	.suite_name = "Crypto Unit Test Suite",
 	.setup = testsuite_setup,
 	.teardown = testsuite_teardown,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE_ST(ut_setup, ut_teardown,
 				test_device_configure_invalid_dev_id),
 		TEST_CASE_ST(ut_setup, ut_teardown,
@@ -13921,25 +13921,25 @@ static struct unit_test_suite cryptodev_testsuite  = {
 		TEST_CASE_ST(ut_setup, ut_teardown, test_enq_callback_setup),
 		TEST_CASE_ST(ut_setup, ut_teardown, test_deq_callback_setup),
 		TEST_CASES_END() /**< NULL terminate unit test array */
-	}
+	})
 };
 
 static struct unit_test_suite cryptodev_virtio_testsuite = {
 	.suite_name = "Crypto VIRTIO Unit Test Suite",
 	.setup = testsuite_setup,
 	.teardown = testsuite_teardown,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_cipheronly_all),
 
 		TEST_CASES_END() /**< NULL terminate unit test array */
-	}
+	})
 };
 
 static struct unit_test_suite cryptodev_caam_jr_testsuite  = {
 	.suite_name = "Crypto CAAM JR Unit Test Suite",
 	.setup = testsuite_setup,
 	.teardown = testsuite_teardown,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			     test_device_configure_invalid_dev_id),
 		TEST_CASE_ST(ut_setup, ut_teardown,
@@ -13952,14 +13952,14 @@ static struct unit_test_suite cryptodev_caam_jr_testsuite  = {
 		TEST_CASE_ST(ut_setup, ut_teardown, test_authonly_all),
 
 		TEST_CASES_END() /**< NULL terminate unit test array */
-	}
+	})
 };
 
 static struct unit_test_suite cryptodev_mrvl_testsuite  = {
 	.suite_name = "Crypto Device Marvell Component Test Suite",
 	.setup = testsuite_setup,
 	.teardown = testsuite_teardown,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE_ST(ut_setup, ut_teardown, test_multi_session),
 		TEST_CASE_ST(ut_setup, ut_teardown,
 				test_multi_session_random_usage),
@@ -13980,14 +13980,14 @@ static struct unit_test_suite cryptodev_mrvl_testsuite  = {
 			auth_decryption_AES128CBC_HMAC_SHA1_fail_tag_corrupt),
 
 		TEST_CASES_END() /**< NULL terminate unit test array */
-	}
+	})
 };
 
 static struct unit_test_suite cryptodev_ccp_testsuite  = {
 	.suite_name = "Crypto Device CCP Unit Test Suite",
 	.setup = testsuite_setup,
 	.teardown = testsuite_teardown,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE_ST(ut_setup, ut_teardown, test_multi_session),
 		TEST_CASE_ST(ut_setup, ut_teardown,
 				test_multi_session_random_usage),
@@ -14008,7 +14008,7 @@ static struct unit_test_suite cryptodev_ccp_testsuite  = {
 			auth_decryption_AES128CBC_HMAC_SHA1_fail_tag_corrupt),
 
 		TEST_CASES_END() /**< NULL terminate unit test array */
-	}
+	})
 };
 
 static int
diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c
index 85cd076059..4a2c0a310f 100644
--- a/app/test/test_cryptodev_asym.c
+++ b/app/test/test_cryptodev_asym.c
@@ -2288,7 +2288,7 @@ static struct unit_test_suite cryptodev_openssl_asym_testsuite  = {
 	.suite_name = "Crypto Device OPENSSL ASYM Unit Test Suite",
 	.setup = testsuite_setup,
 	.teardown = testsuite_teardown,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE_ST(ut_setup, ut_teardown, test_capability),
 		TEST_CASE_ST(ut_setup, ut_teardown, test_dsa),
 		TEST_CASE_ST(ut_setup, ut_teardown, test_dh_keygenration),
@@ -2300,24 +2300,24 @@ static struct unit_test_suite cryptodev_openssl_asym_testsuite  = {
 		TEST_CASE_ST(ut_setup, ut_teardown, test_mod_exp),
 		TEST_CASE_ST(ut_setup, ut_teardown, test_one_by_one),
 		TEST_CASES_END() /**< NULL terminate unit test array */
-	}
+	})
 };
 
 static struct unit_test_suite cryptodev_qat_asym_testsuite  = {
 	.suite_name = "Crypto Device QAT ASYM Unit Test Suite",
 	.setup = testsuite_setup,
 	.teardown = testsuite_teardown,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE_ST(ut_setup, ut_teardown, test_one_by_one),
 		TEST_CASES_END() /**< NULL terminate unit test array */
-	}
+	})
 };
 
 static struct unit_test_suite cryptodev_octeontx_asym_testsuite  = {
 	.suite_name = "Crypto Device OCTEONTX ASYM Unit Test Suite",
 	.setup = testsuite_setup,
 	.teardown = testsuite_teardown,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE_ST(ut_setup, ut_teardown, test_capability),
 		TEST_CASE_ST(ut_setup, ut_teardown, test_rsa_enc_dec_crt),
 		TEST_CASE_ST(ut_setup, ut_teardown, test_rsa_sign_verify_crt),
@@ -2326,7 +2326,7 @@ static struct unit_test_suite cryptodev_octeontx_asym_testsuite  = {
 			     test_ecdsa_sign_verify_all_curve),
 		TEST_CASE_ST(ut_setup, ut_teardown, test_ecpm_all_curve),
 		TEST_CASES_END() /**< NULL terminate unit test array */
-	}
+	})
 };
 
 static int
diff --git a/app/test/test_ethdev_link.c b/app/test/test_ethdev_link.c
index ee11987bae..1f3ac34b5f 100644
--- a/app/test/test_ethdev_link.c
+++ b/app/test/test_ethdev_link.c
@@ -148,13 +148,13 @@ static struct unit_test_suite link_status_testsuite = {
 	.suite_name = "link status formatting",
 	.setup = NULL,
 	.teardown = NULL,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE(test_link_status_up_default),
 		TEST_CASE(test_link_status_down_default),
 		TEST_CASE(test_link_speed_all_values),
 		TEST_CASE(test_link_status_invalid),
 		TEST_CASES_END() /**< NULL terminate unit test array */
-	}
+	})
 };
 
 static int
diff --git a/app/test/test_event_crypto_adapter.c b/app/test/test_event_crypto_adapter.c
index 335211cd8c..722e2f1b7c 100644
--- a/app/test/test_event_crypto_adapter.c
+++ b/app/test/test_event_crypto_adapter.c
@@ -959,7 +959,7 @@ static struct unit_test_suite functional_testsuite = {
 	.suite_name = "Event crypto adapter test suite",
 	.setup = testsuite_setup,
 	.teardown = testsuite_teardown,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 
 		TEST_CASE_ST(NULL, test_crypto_adapter_free,
 				test_crypto_adapter_create),
@@ -989,7 +989,7 @@ static struct unit_test_suite functional_testsuite = {
 				test_sessionless_with_op_new_mode),
 
 		TEST_CASES_END() /**< NULL terminate unit test array */
-	}
+	})
 };
 
 static int
diff --git a/app/test/test_event_eth_rx_adapter.c b/app/test/test_event_eth_rx_adapter.c
index 9198767b41..735d5766d6 100644
--- a/app/test/test_event_eth_rx_adapter.c
+++ b/app/test/test_event_eth_rx_adapter.c
@@ -754,7 +754,7 @@ static struct unit_test_suite event_eth_rx_tests = {
 	.suite_name = "rx event eth adapter test suite",
 	.setup = testsuite_setup,
 	.teardown = testsuite_teardown,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE_ST(NULL, NULL, adapter_create_free),
 		TEST_CASE_ST(adapter_create, adapter_free,
 					adapter_queue_add_del),
@@ -763,18 +763,18 @@ static struct unit_test_suite event_eth_rx_tests = {
 		TEST_CASE_ST(adapter_create, adapter_free, adapter_start_stop),
 		TEST_CASE_ST(adapter_create, adapter_free, adapter_stats),
 		TEST_CASES_END() /**< NULL terminate unit test array */
-	}
+	})
 };
 
 static struct unit_test_suite event_eth_rx_intr_tests = {
 	.suite_name = "rx event eth adapter test suite",
 	.setup = testsuite_setup_rx_intr,
 	.teardown = testsuite_teardown_rx_intr,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE_ST(adapter_create, adapter_free,
 			adapter_intr_queue_add_del),
 		TEST_CASES_END() /**< NULL terminate unit test array */
-	}
+	})
 };
 
 static int
diff --git a/app/test/test_event_eth_tx_adapter.c b/app/test/test_event_eth_tx_adapter.c
index 7073030902..bf67afcc69 100644
--- a/app/test/test_event_eth_tx_adapter.c
+++ b/app/test/test_event_eth_tx_adapter.c
@@ -680,7 +680,7 @@ static struct unit_test_suite event_eth_tx_tests = {
 	.setup = testsuite_setup,
 	.teardown = testsuite_teardown,
 	.suite_name = "tx event eth adapter test suite",
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE_ST(NULL, NULL, tx_adapter_create_free),
 		TEST_CASE_ST(tx_adapter_create, tx_adapter_free,
 					tx_adapter_queue_add_del),
@@ -690,7 +690,7 @@ static struct unit_test_suite event_eth_tx_tests = {
 					tx_adapter_service),
 		TEST_CASE_ST(NULL, NULL, tx_adapter_dynamic_device),
 		TEST_CASES_END() /**< NULL terminate unit test array */
-	}
+	})
 };
 
 static int
diff --git a/app/test/test_event_timer_adapter.c b/app/test/test_event_timer_adapter.c
index ad3f4dcc20..08c3035c7c 100644
--- a/app/test/test_event_timer_adapter.c
+++ b/app/test/test_event_timer_adapter.c
@@ -1779,7 +1779,7 @@ static struct unit_test_suite event_timer_adptr_functional_testsuite  = {
 	.suite_name = "event timer functional test suite",
 	.setup = testsuite_setup,
 	.teardown = testsuite_teardown,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE_ST(timdev_setup_usec, timdev_teardown,
 				test_timer_state),
 		TEST_CASE_ST(timdev_setup_usec, timdev_teardown,
@@ -1832,7 +1832,7 @@ static struct unit_test_suite event_timer_adptr_functional_testsuite  = {
 				adapter_tick_resolution),
 		TEST_CASE(adapter_create_max),
 		TEST_CASES_END() /**< NULL terminate unit test array */
-	}
+	})
 };
 
 static int
diff --git a/app/test/test_eventdev.c b/app/test/test_eventdev.c
index 27ca5a6494..b4b55117b4 100644
--- a/app/test/test_eventdev.c
+++ b/app/test/test_eventdev.c
@@ -934,7 +934,7 @@ static struct unit_test_suite eventdev_common_testsuite  = {
 	.suite_name = "eventdev common code unit test suite",
 	.setup = testsuite_setup,
 	.teardown = testsuite_teardown,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE_ST(NULL, NULL,
 			test_eventdev_count),
 		TEST_CASE_ST(NULL, NULL,
@@ -984,7 +984,7 @@ static struct unit_test_suite eventdev_common_testsuite  = {
 		TEST_CASE_ST(eventdev_setup_device, NULL,
 			test_eventdev_close),
 		TEST_CASES_END() /**< NULL terminate unit test array */
-	}
+	})
 };
 
 static int
diff --git a/app/test/test_fbarray.c b/app/test/test_fbarray.c
index a691bf4458..ff6896d1bc 100644
--- a/app/test/test_fbarray.c
+++ b/app/test/test_fbarray.c
@@ -714,7 +714,7 @@ static struct unit_test_suite fbarray_test_suite = {
 	.suite_name = "fbarray autotest",
 	.setup = autotest_setup,
 	.teardown = autotest_teardown,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE(test_invalid),
 		TEST_CASE(test_basic),
 		TEST_CASE_ST(first_msk_test_setup, reset_array, test_find),
@@ -724,7 +724,7 @@ static struct unit_test_suite fbarray_test_suite = {
 		TEST_CASE_ST(full_msk_test_setup, reset_array, test_find),
 		TEST_CASE_ST(empty_msk_test_setup, reset_array, test_empty),
 		TEST_CASES_END()
-	}
+	})
 };
 
 static int
diff --git a/app/test/test_fib.c b/app/test/test_fib.c
index e46b9934fe..fc574bdf0b 100644
--- a/app/test/test_fib.c
+++ b/app/test/test_fib.c
@@ -375,24 +375,24 @@ static struct unit_test_suite fib_fast_tests = {
 	.suite_name = "fib autotest",
 	.setup = NULL,
 	.teardown = NULL,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 	TEST_CASE(test_create_invalid),
 	TEST_CASE(test_free_null),
 	TEST_CASE(test_add_del_invalid),
 	TEST_CASE(test_get_invalid),
 	TEST_CASE(test_lookup),
 	TEST_CASES_END()
-	}
+	})
 };
 
 static struct unit_test_suite fib_slow_tests = {
 	.suite_name = "fib slow autotest",
 	.setup = NULL,
 	.teardown = NULL,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 	TEST_CASE(test_multiple_create),
 	TEST_CASES_END()
-	}
+	})
 };
 
 /*
diff --git a/app/test/test_fib6.c b/app/test/test_fib6.c
index 74abfc7a5d..4e36ab795e 100644
--- a/app/test/test_fib6.c
+++ b/app/test/test_fib6.c
@@ -384,24 +384,24 @@ static struct unit_test_suite fib6_fast_tests = {
 	.suite_name = "fib6 autotest",
 	.setup = NULL,
 	.teardown = NULL,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 	TEST_CASE(test_create_invalid),
 	TEST_CASE(test_free_null),
 	TEST_CASE(test_add_del_invalid),
 	TEST_CASE(test_get_invalid),
 	TEST_CASE(test_lookup),
 	TEST_CASES_END()
-	}
+	})
 };
 
 static struct unit_test_suite fib6_slow_tests = {
 	.suite_name = "fib6 slow autotest",
 	.setup = NULL,
 	.teardown = NULL,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 	TEST_CASE(test_multiple_create),
 	TEST_CASES_END()
-	}
+	})
 };
 
 /*
diff --git a/app/test/test_graph.c b/app/test/test_graph.c
index 81bdcb9bea..81eef73900 100644
--- a/app/test/test_graph.c
+++ b/app/test/test_graph.c
@@ -815,7 +815,7 @@ static struct unit_test_suite graph_testsuite = {
 	.suite_name = "Graph library test suite",
 	.setup = graph_setup,
 	.teardown = graph_teardown,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE(test_update_edges),
 		TEST_CASE(test_lookup_functions),
 		TEST_CASE(test_create_graph),
@@ -823,7 +823,7 @@ static struct unit_test_suite graph_testsuite = {
 		TEST_CASE(test_graph_walk),
 		TEST_CASE(test_print_stats),
 		TEST_CASES_END(), /**< NULL terminate unit test array */
-	},
+	}),
 };
 
 static int
diff --git a/app/test/test_graph_perf.c b/app/test/test_graph_perf.c
index 296d99a9d3..ae30ab3c41 100644
--- a/app/test/test_graph_perf.c
+++ b/app/test/test_graph_perf.c
@@ -1035,7 +1035,7 @@ static struct unit_test_suite graph_perf_testsuite = {
 	.suite_name = "Graph library performance test suite",
 	.setup = graph_perf_setup,
 	.teardown = graph_perf_teardown,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE_ST(graph_init_hr, graph_fini,
 			     graph_hr_4s_1n_1src_1snk),
 		TEST_CASE_ST(graph_init_hr_brst_one, graph_fini,
@@ -1051,7 +1051,7 @@ static struct unit_test_suite graph_perf_testsuite = {
 		TEST_CASE_ST(graph_init_parallel_tree, graph_fini,
 			     graph_parallel_tree_5s_4n_4src_4snk),
 		TEST_CASES_END(), /**< NULL terminate unit test array */
-	},
+	}),
 };
 
 static int
diff --git a/app/test/test_ipfrag.c b/app/test/test_ipfrag.c
index da8c212f92..b0ac54e422 100644
--- a/app/test/test_ipfrag.c
+++ b/app/test/test_ipfrag.c
@@ -242,12 +242,12 @@ static struct unit_test_suite ipfrag_testsuite  = {
 	.suite_name = "IP Frag Unit Test Suite",
 	.setup = testsuite_setup,
 	.teardown = testsuite_teardown,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			     test_ip_frag),
 
 		TEST_CASES_END() /**< NULL terminate unit test array */
-	}
+	})
 };
 
 static int
diff --git a/app/test/test_ipsec.c b/app/test/test_ipsec.c
index d18220a885..bd9fc3f999 100644
--- a/app/test/test_ipsec.c
+++ b/app/test/test_ipsec.c
@@ -2498,7 +2498,7 @@ static struct unit_test_suite ipsec_testsuite  = {
 	.suite_name = "IPsec NULL Unit Test Suite",
 	.setup = testsuite_setup,
 	.teardown = testsuite_teardown,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_ipsec_crypto_inb_burst_null_null_wrapper),
 		TEST_CASE_ST(ut_setup, ut_teardown,
@@ -2528,7 +2528,7 @@ static struct unit_test_suite ipsec_testsuite  = {
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_ipsec_crypto_inb_burst_2sa_4grp_null_null_wrapper),
 		TEST_CASES_END() /**< NULL terminate unit test array */
-	}
+	})
 };
 
 static int
diff --git a/app/test/test_ipsec_sad.c b/app/test/test_ipsec_sad.c
index 491164689e..874b19a286 100644
--- a/app/test/test_ipsec_sad.c
+++ b/app/test/test_ipsec_sad.c
@@ -864,7 +864,7 @@ static struct unit_test_suite ipsec_sad_tests = {
 	.suite_name = "ipsec sad autotest",
 	.setup = NULL,
 	.teardown = NULL,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE(test_create_invalid),
 		TEST_CASE(test_find_existing),
 		TEST_CASE(test_multiple_create),
@@ -875,7 +875,7 @@ static struct unit_test_suite ipsec_sad_tests = {
 		TEST_CASE(test_lookup_adv),
 		TEST_CASE(test_lookup_order),
 		TEST_CASES_END()
-	}
+	})
 };
 
 static int
diff --git a/app/test/test_latencystats.c b/app/test/test_latencystats.c
index 427339904d..f72eee98cc 100644
--- a/app/test/test_latencystats.c
+++ b/app/test/test_latencystats.c
@@ -171,7 +171,7 @@ unit_test_suite latencystats_testsuite = {
 	.suite_name = "Latency Stats Unit Test Suite",
 	.setup = test_latency_ring_setup,
 	.teardown = test_latency_ring_free,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 
 		/* Test Case 1: To check latency init with
 		 * metrics init
@@ -198,7 +198,7 @@ unit_test_suite latencystats_testsuite = {
 		TEST_CASE_ST(NULL, NULL, test_latency_uninit),
 
 		TEST_CASES_END()
-	}
+	})
 };
 
 static int test_latencystats(void)
diff --git a/app/test/test_link_bonding.c b/app/test/test_link_bonding.c
index 8a5c8310a8..4fa1e0525c 100644
--- a/app/test/test_link_bonding.c
+++ b/app/test/test_link_bonding.c
@@ -5094,7 +5094,7 @@ static struct unit_test_suite link_bonding_test_suite  = {
 	.suite_name = "Link Bonding Unit Test Suite",
 	.setup = test_setup,
 	.teardown = testsuite_teardown,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE(test_create_bonded_device),
 		TEST_CASE(test_create_bonded_device_with_invalid_params),
 		TEST_CASE(test_add_slave_to_bonded_device),
@@ -5162,7 +5162,7 @@ static struct unit_test_suite link_bonding_test_suite  = {
 		TEST_CASE(test_close_bonded_device),
 
 		TEST_CASES_END() /**< NULL terminate unit test array */
-	}
+	})
 };
 
 
diff --git a/app/test/test_link_bonding_mode4.c b/app/test/test_link_bonding_mode4.c
index 2c835fa7ad..aafa2236ce 100644
--- a/app/test/test_link_bonding_mode4.c
+++ b/app/test/test_link_bonding_mode4.c
@@ -1653,7 +1653,7 @@ static struct unit_test_suite link_bonding_mode4_test_suite  = {
 	.suite_name = "Link Bonding mode 4 Unit Test Suite",
 	.setup = test_setup,
 	.teardown = testsuite_teardown,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE_NAMED("test_mode4_agg_mode_selection",
 				test_mode4_agg_mode_selection_wrapper),
 		TEST_CASE_NAMED("test_mode4_lacp", test_mode4_lacp_wrapper),
@@ -1667,7 +1667,7 @@ static struct unit_test_suite link_bonding_mode4_test_suite  = {
 				test_mode4_ext_lacp_wrapper),
 
 		TEST_CASES_END() /**< NULL terminate unit test array */
-	}
+	})
 };
 
 static int
diff --git a/app/test/test_link_bonding_rssconf.c b/app/test/test_link_bonding_rssconf.c
index 5dac60ca1e..58ff4a8971 100644
--- a/app/test/test_link_bonding_rssconf.c
+++ b/app/test/test_link_bonding_rssconf.c
@@ -645,13 +645,13 @@ test_rss_lazy_wrapper(void)
 static struct unit_test_suite link_bonding_rssconf_test_suite  = {
 	.suite_name = "RSS Dynamic Configuration for Bonding Unit Test Suite",
 	.teardown = testsuite_teardown,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE_NAMED("test_setup", test_setup_wrapper),
 		TEST_CASE_NAMED("test_rss", test_rss_wrapper),
 		TEST_CASE_NAMED("test_rss_lazy", test_rss_lazy_wrapper),
 
 		TEST_CASES_END()
-	}
+	})
 };
 
 static int
diff --git a/app/test/test_metrics.c b/app/test/test_metrics.c
index e736019ae4..d80be0e5b4 100644
--- a/app/test/test_metrics.c
+++ b/app/test/test_metrics.c
@@ -275,7 +275,7 @@ static struct unit_test_suite metrics_testsuite  = {
 	.suite_name = "Metrics Unit Test Suite",
 	.setup = NULL,
 	.teardown = NULL,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 		/* Test Case 1: Test to check all metric APIs without
 		 * metrics init
 		 */
@@ -317,7 +317,7 @@ static struct unit_test_suite metrics_testsuite  = {
 		TEST_CASE(test_metrics_deinitialize),
 
 		TEST_CASES_END()
-	}
+	})
 };
 
 static int
diff --git a/app/test/test_pmd_ring.c b/app/test/test_pmd_ring.c
index 86b1db2c1f..9ef667aed7 100644
--- a/app/test/test_pmd_ring.c
+++ b/app/test/test_pmd_ring.c
@@ -576,7 +576,7 @@ unit_test_suite test_pmd_ring_suite  = {
 	.setup = test_pmd_ringcreate_setup,
 	.teardown = test_cleanup_resources,
 	.suite_name = "Test Pmd Ring Unit Test Suite",
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE(test_ethdev_configure_ports),
 		TEST_CASE(test_send_basic_packets),
 		TEST_CASE(test_get_stats_for_port),
@@ -584,7 +584,7 @@ unit_test_suite test_pmd_ring_suite  = {
 		TEST_CASE(test_pmd_ring_pair_create_attach),
 		TEST_CASE(test_command_line_ring_port),
 		TEST_CASES_END()
-	}
+	})
 };
 
 static int
diff --git a/app/test/test_reorder.c b/app/test/test_reorder.c
index 1c4226da65..04bdf4a2d1 100644
--- a/app/test/test_reorder.c
+++ b/app/test/test_reorder.c
@@ -373,7 +373,7 @@ static struct unit_test_suite reorder_test_suite  = {
 	.setup = test_setup,
 	.teardown = test_teardown,
 	.suite_name = "Reorder Unit Test Suite",
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE(test_reorder_create),
 		TEST_CASE(test_reorder_init),
 		TEST_CASE(test_reorder_find_existing),
@@ -381,7 +381,7 @@ static struct unit_test_suite reorder_test_suite  = {
 		TEST_CASE(test_reorder_insert),
 		TEST_CASE(test_reorder_drain),
 		TEST_CASES_END()
-	}
+	})
 };
 
 static int
diff --git a/app/test/test_rib.c b/app/test/test_rib.c
index 3dc48fe1f2..8a2a7d68aa 100644
--- a/app/test/test_rib.c
+++ b/app/test/test_rib.c
@@ -327,7 +327,7 @@ static struct unit_test_suite rib_tests = {
 	.suite_name = "rib autotest",
 	.setup = NULL,
 	.teardown = NULL,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE(test_create_invalid),
 		TEST_CASE(test_free_null),
 		TEST_CASE(test_insert_invalid),
@@ -335,17 +335,17 @@ static struct unit_test_suite rib_tests = {
 		TEST_CASE(test_basic),
 		TEST_CASE(test_tree_traversal),
 		TEST_CASES_END()
-	}
+	})
 };
 
 static struct unit_test_suite rib_slow_tests = {
 	.suite_name = "rib slow autotest",
 	.setup = NULL,
 	.teardown = NULL,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE(test_multiple_create),
 		TEST_CASES_END()
-	}
+	})
 };
 
 /*
diff --git a/app/test/test_rib6.c b/app/test/test_rib6.c
index c77df11298..c381c68ce6 100644
--- a/app/test/test_rib6.c
+++ b/app/test/test_rib6.c
@@ -332,7 +332,7 @@ static struct unit_test_suite rib6_tests = {
 	.suite_name = "rib6 autotest",
 	.setup = NULL,
 	.teardown = NULL,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE(test_create_invalid),
 		TEST_CASE(test_free_null),
 		TEST_CASE(test_insert_invalid),
@@ -340,17 +340,17 @@ static struct unit_test_suite rib6_tests = {
 		TEST_CASE(test_basic),
 		TEST_CASE(test_tree_traversal),
 		TEST_CASES_END()
-	}
+	})
 };
 
 static struct unit_test_suite rib6_slow_tests = {
 	.suite_name = "rib6 slow autotest",
 	.setup = NULL,
 	.teardown = NULL,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE(test_multiple_create),
 		TEST_CASES_END()
-	}
+	})
 };
 
 /*
diff --git a/app/test/test_security.c b/app/test/test_security.c
index 060cf1ffa8..583a229c0e 100644
--- a/app/test/test_security.c
+++ b/app/test/test_security.c
@@ -2484,7 +2484,7 @@ static struct unit_test_suite security_testsuite  = {
 	.suite_name = "generic security",
 	.setup = testsuite_setup,
 	.teardown = testsuite_teardown,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE_ST(ut_setup, ut_teardown,
 				test_session_create_inv_context),
 		TEST_CASE_ST(ut_setup, ut_teardown,
@@ -2627,7 +2627,7 @@ static struct unit_test_suite security_testsuite  = {
 				test_capability_get_docsis_match),
 
 		TEST_CASES_END() /**< NULL terminate unit test array */
-	}
+	})
 };
 
 static int
diff --git a/app/test/test_service_cores.c b/app/test/test_service_cores.c
index 37d7172d53..ff4d3aa95a 100644
--- a/app/test/test_service_cores.c
+++ b/app/test/test_service_cores.c
@@ -996,7 +996,7 @@ static struct unit_test_suite service_tests  = {
 	.suite_name = "service core test suite",
 	.setup = testsuite_setup,
 	.teardown = testsuite_teardown,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE_ST(dummy_register, NULL, unregister_all),
 		TEST_CASE_ST(dummy_register, NULL, service_name),
 		TEST_CASE_ST(dummy_register, NULL, service_get_by_name),
@@ -1015,7 +1015,7 @@ static struct unit_test_suite service_tests  = {
 		TEST_CASE_ST(dummy_register, NULL, service_may_be_active),
 		TEST_CASE_ST(dummy_register, NULL, service_active_two_cores),
 		TEST_CASES_END() /**< NULL terminate unit test array */
-	}
+	})
 };
 
 static int
diff --git a/app/test/test_trace.c b/app/test/test_trace.c
index 0f9df83c40..d704ceb8c2 100644
--- a/app/test/test_trace.c
+++ b/app/test/test_trace.c
@@ -176,7 +176,7 @@ static struct unit_test_suite trace_tests = {
 	.suite_name = "trace autotest",
 	.setup = NULL,
 	.teardown = NULL,
-	.unit_test_cases = {
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE(test_trace_mode),
 		TEST_CASE(test_generic_trace_points),
 		TEST_CASE(test_fp_trace_points),
@@ -185,7 +185,7 @@ static struct unit_test_suite trace_tests = {
 		TEST_CASE(test_trace_point_regex),
 		TEST_CASE(test_trace_points_lookup),
 		TEST_CASES_END()
-	}
+	})
 };
 
 static int
-- 
2.25.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [dpdk-dev] [PATCH 3/6] test/crypto: refactor to use sub-testsuites
  2021-03-16 14:32 [dpdk-dev] [PATCH 0/6] test: refactor crypto unit test framework Ciara Power
  2021-03-16 14:32 ` [dpdk-dev] [PATCH 1/6] app/test: refactor of unit test suite runner Ciara Power
  2021-03-16 14:32 ` [dpdk-dev] [PATCH 2/6] test: introduce parent testsuite format Ciara Power
@ 2021-03-16 14:32 ` Ciara Power
  2021-03-16 14:32 ` [dpdk-dev] [PATCH 4/6] test/crypto: move testsuite params to header file Ciara Power
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Ciara Power @ 2021-03-16 14:32 UTC (permalink / raw)
  To: dev; +Cc: declan.doherty, Ciara Power

The existing implementation runs a giant cryptodev testsuite for most
autotests, which in turns runs one setup function regardless of device.

This is now broken down into multiple testsuites,
that are used as sub-testsuites. Each autotest has a parent test suite
for that device, to which the sub-testsuites are added.

For example, the AESNI_MB test has a parent "AESNI_MB Unit Test Suite",
with a setup function specifically for setting up an AESNI_MB device.
This autotest previously just ran the cryptodev_testsuite,
but now has the smaller sub-testsuites added to the parent suite instead.
The same test cases are being run as before.

The scheduler autotest no longer requires the extra test cases to
attach/set mode/detach when running the blockcipher test cases for
each mode. The attach/set mode/detach functionality is now tested in a
sub-testsuite. When running the sub-testsuites for each mode,
the attach/set mode/detach happens in the setup and teardown functions
for that sub-testsuite.

Signed-off-by: Ciara Power <ciara.power@intel.com>
---
 app/test/test_cryptodev.c | 1663 +++++++++++++++++++++++++++++--------
 1 file changed, 1306 insertions(+), 357 deletions(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index bdfb2727dd..638b3845d4 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -112,6 +112,10 @@ struct crypto_unittest_params {
 #define ALIGN_POW2_ROUNDUP(num, align) \
 	(((num) + (align) - 1) & ~((align) - 1))
 
+#define ADD_STATIC_TESTSUITE(index, parent_ts, child_ts, num_child_ts)	\
+	for (j = 0; j < num_child_ts; index++, j++)			\
+		parent_ts.unit_test_suites[index] = child_ts[j]		\
+
 /*
  * Forward declarations.
  */
@@ -491,12 +495,11 @@ static struct crypto_testsuite_params testsuite_params = { NULL };
 static struct crypto_unittest_params unittest_params;
 
 static int
-testsuite_setup(void)
+testsuite_params_setup(void)
 {
 	struct crypto_testsuite_params *ts_params = &testsuite_params;
 	struct rte_cryptodev_info info;
 	uint32_t i = 0, nb_devs, dev_id;
-	int ret;
 	uint16_t qp_id;
 
 	memset(ts_params, 0, sizeof(*ts_params));
@@ -542,217 +545,6 @@ testsuite_setup(void)
 		return TEST_FAILED;
 	}
 
-	/* Create an AESNI MB device if required */
-	if (gbl_driver_id == rte_cryptodev_driver_id_get(
-			RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD))) {
-		nb_devs = rte_cryptodev_device_count_by_driver(
-				rte_cryptodev_driver_id_get(
-				RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD)));
-		if (nb_devs < 1) {
-			ret = rte_vdev_init(
-				RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD), NULL);
-
-			TEST_ASSERT(ret == 0,
-				"Failed to create instance of"
-				" pmd : %s",
-				RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD));
-		}
-	}
-
-	/* Create an AESNI GCM device if required */
-	if (gbl_driver_id == rte_cryptodev_driver_id_get(
-			RTE_STR(CRYPTODEV_NAME_AESNI_GCM_PMD))) {
-		nb_devs = rte_cryptodev_device_count_by_driver(
-				rte_cryptodev_driver_id_get(
-				RTE_STR(CRYPTODEV_NAME_AESNI_GCM_PMD)));
-		if (nb_devs < 1) {
-			TEST_ASSERT_SUCCESS(rte_vdev_init(
-				RTE_STR(CRYPTODEV_NAME_AESNI_GCM_PMD), NULL),
-				"Failed to create instance of"
-				" pmd : %s",
-				RTE_STR(CRYPTODEV_NAME_AESNI_GCM_PMD));
-		}
-	}
-
-	/* Create a SNOW 3G device if required */
-	if (gbl_driver_id == rte_cryptodev_driver_id_get(
-			RTE_STR(CRYPTODEV_NAME_SNOW3G_PMD))) {
-		nb_devs = rte_cryptodev_device_count_by_driver(
-				rte_cryptodev_driver_id_get(
-				RTE_STR(CRYPTODEV_NAME_SNOW3G_PMD)));
-		if (nb_devs < 1) {
-			TEST_ASSERT_SUCCESS(rte_vdev_init(
-				RTE_STR(CRYPTODEV_NAME_SNOW3G_PMD), NULL),
-				"Failed to create instance of"
-				" pmd : %s",
-				RTE_STR(CRYPTODEV_NAME_SNOW3G_PMD));
-		}
-	}
-
-	/* Create a KASUMI device if required */
-	if (gbl_driver_id == rte_cryptodev_driver_id_get(
-			RTE_STR(CRYPTODEV_NAME_KASUMI_PMD))) {
-		nb_devs = rte_cryptodev_device_count_by_driver(
-				rte_cryptodev_driver_id_get(
-				RTE_STR(CRYPTODEV_NAME_KASUMI_PMD)));
-		if (nb_devs < 1) {
-			TEST_ASSERT_SUCCESS(rte_vdev_init(
-				RTE_STR(CRYPTODEV_NAME_KASUMI_PMD), NULL),
-				"Failed to create instance of"
-				" pmd : %s",
-				RTE_STR(CRYPTODEV_NAME_KASUMI_PMD));
-		}
-	}
-
-	/* Create a ZUC device if required */
-	if (gbl_driver_id == rte_cryptodev_driver_id_get(
-			RTE_STR(CRYPTODEV_NAME_ZUC_PMD))) {
-		nb_devs = rte_cryptodev_device_count_by_driver(
-				rte_cryptodev_driver_id_get(
-				RTE_STR(CRYPTODEV_NAME_ZUC_PMD)));
-		if (nb_devs < 1) {
-			TEST_ASSERT_SUCCESS(rte_vdev_init(
-				RTE_STR(CRYPTODEV_NAME_ZUC_PMD), NULL),
-				"Failed to create instance of"
-				" pmd : %s",
-				RTE_STR(CRYPTODEV_NAME_ZUC_PMD));
-		}
-	}
-
-	/* Create a NULL device if required */
-	if (gbl_driver_id == rte_cryptodev_driver_id_get(
-			RTE_STR(CRYPTODEV_NAME_NULL_PMD))) {
-		nb_devs = rte_cryptodev_device_count_by_driver(
-				rte_cryptodev_driver_id_get(
-				RTE_STR(CRYPTODEV_NAME_NULL_PMD)));
-		if (nb_devs < 1) {
-			ret = rte_vdev_init(
-				RTE_STR(CRYPTODEV_NAME_NULL_PMD), NULL);
-
-			TEST_ASSERT(ret == 0,
-				"Failed to create instance of"
-				" pmd : %s",
-				RTE_STR(CRYPTODEV_NAME_NULL_PMD));
-		}
-	}
-
-	/* Create an OPENSSL device if required */
-	if (gbl_driver_id == rte_cryptodev_driver_id_get(
-			RTE_STR(CRYPTODEV_NAME_OPENSSL_PMD))) {
-		nb_devs = rte_cryptodev_device_count_by_driver(
-				rte_cryptodev_driver_id_get(
-				RTE_STR(CRYPTODEV_NAME_OPENSSL_PMD)));
-		if (nb_devs < 1) {
-			ret = rte_vdev_init(
-				RTE_STR(CRYPTODEV_NAME_OPENSSL_PMD),
-				NULL);
-
-			TEST_ASSERT(ret == 0, "Failed to create "
-				"instance of pmd : %s",
-				RTE_STR(CRYPTODEV_NAME_OPENSSL_PMD));
-		}
-	}
-
-	/* Create a ARMv8 device if required */
-	if (gbl_driver_id == rte_cryptodev_driver_id_get(
-			RTE_STR(CRYPTODEV_NAME_ARMV8_PMD))) {
-		nb_devs = rte_cryptodev_device_count_by_driver(
-				rte_cryptodev_driver_id_get(
-				RTE_STR(CRYPTODEV_NAME_ARMV8_PMD)));
-		if (nb_devs < 1) {
-			ret = rte_vdev_init(
-				RTE_STR(CRYPTODEV_NAME_ARMV8_PMD),
-				NULL);
-
-			TEST_ASSERT(ret == 0, "Failed to create "
-				"instance of pmd : %s",
-				RTE_STR(CRYPTODEV_NAME_ARMV8_PMD));
-		}
-	}
-
-	/* Create a MVSAM device if required */
-	if (gbl_driver_id == rte_cryptodev_driver_id_get(
-			RTE_STR(CRYPTODEV_NAME_MVSAM_PMD))) {
-		nb_devs = rte_cryptodev_device_count_by_driver(
-				rte_cryptodev_driver_id_get(
-				RTE_STR(CRYPTODEV_NAME_MVSAM_PMD)));
-		if (nb_devs < 1) {
-			ret = rte_vdev_init(
-				RTE_STR(CRYPTODEV_NAME_MVSAM_PMD),
-				NULL);
-
-			TEST_ASSERT(ret == 0, "Failed to create "
-				"instance of pmd : %s",
-				RTE_STR(CRYPTODEV_NAME_MVSAM_PMD));
-		}
-	}
-
-	/* Create an CCP device if required */
-	if (gbl_driver_id == rte_cryptodev_driver_id_get(
-			RTE_STR(CRYPTODEV_NAME_CCP_PMD))) {
-		nb_devs = rte_cryptodev_device_count_by_driver(
-				rte_cryptodev_driver_id_get(
-				RTE_STR(CRYPTODEV_NAME_CCP_PMD)));
-		if (nb_devs < 1) {
-			ret = rte_vdev_init(
-				RTE_STR(CRYPTODEV_NAME_CCP_PMD),
-				NULL);
-
-			TEST_ASSERT(ret == 0, "Failed to create "
-				"instance of pmd : %s",
-				RTE_STR(CRYPTODEV_NAME_CCP_PMD));
-		}
-	}
-
-#ifdef RTE_CRYPTO_SCHEDULER
-	char vdev_args[VDEV_ARGS_SIZE] = {""};
-	char temp_str[VDEV_ARGS_SIZE] = {"mode=multi-core,"
-		"ordering=enable,name=cryptodev_test_scheduler,corelist="};
-	uint16_t worker_core_count = 0;
-	uint16_t socket_id = 0;
-
-	if (gbl_driver_id == rte_cryptodev_driver_id_get(
-			RTE_STR(CRYPTODEV_NAME_SCHEDULER_PMD))) {
-
-		/* Identify the Worker Cores
-		 * Use 2 worker cores for the device args
-		 */
-		RTE_LCORE_FOREACH_WORKER(i) {
-			if (worker_core_count > 1)
-				break;
-			snprintf(vdev_args, sizeof(vdev_args),
-					"%s%d", temp_str, i);
-			strcpy(temp_str, vdev_args);
-			strlcat(temp_str, ";", sizeof(temp_str));
-			worker_core_count++;
-			socket_id = rte_lcore_to_socket_id(i);
-		}
-		if (worker_core_count != 2) {
-			RTE_LOG(ERR, USER1,
-				"Cryptodev scheduler test require at least "
-				"two worker cores to run. "
-				"Please use the correct coremask.\n");
-			return TEST_FAILED;
-		}
-		strcpy(temp_str, vdev_args);
-		snprintf(vdev_args, sizeof(vdev_args), "%s,socket_id=%d",
-				temp_str, socket_id);
-		RTE_LOG(DEBUG, USER1, "vdev_args: %s\n", vdev_args);
-		nb_devs = rte_cryptodev_device_count_by_driver(
-				rte_cryptodev_driver_id_get(
-				RTE_STR(CRYPTODEV_NAME_SCHEDULER_PMD)));
-		if (nb_devs < 1) {
-			ret = rte_vdev_init(
-				RTE_STR(CRYPTODEV_NAME_SCHEDULER_PMD),
-					vdev_args);
-			TEST_ASSERT(ret == 0,
-				"Failed to create instance %u of"
-				" pmd : %s",
-				i, RTE_STR(CRYPTODEV_NAME_SCHEDULER_PMD));
-		}
-	}
-#endif /* RTE_CRYPTO_SCHEDULER */
-
 	nb_devs = rte_cryptodev_count();
 	if (nb_devs < 1) {
 		RTE_LOG(WARNING, USER1, "No crypto devices found?\n");
@@ -838,6 +630,228 @@ testsuite_setup(void)
 	return TEST_SUCCESS;
 }
 
+static int
+qat_testsuite_setup(void)
+{
+	return testsuite_params_setup();
+}
+
+static int
+aesni_mb_testsuite_setup(void)
+{
+	int32_t nb_devs, ret;
+	nb_devs = rte_cryptodev_device_count_by_driver(
+			rte_cryptodev_driver_id_get(
+			RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD)));
+	if (nb_devs < 1) {
+		ret = rte_vdev_init(RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD), NULL);
+
+		TEST_ASSERT(ret == 0,
+			"Failed to create instance of pmd : %s",
+			RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD));
+	}
+	return testsuite_params_setup();
+}
+
+static int
+virtio_testsuite_setup(void)
+{
+	return testsuite_params_setup();
+}
+
+static int
+openssl_testsuite_setup(void)
+{
+	int32_t nb_devs, ret;
+	nb_devs = rte_cryptodev_device_count_by_driver(
+			rte_cryptodev_driver_id_get(
+			RTE_STR(CRYPTODEV_NAME_OPENSSL_PMD)));
+	if (nb_devs < 1) {
+		ret = rte_vdev_init(RTE_STR(CRYPTODEV_NAME_OPENSSL_PMD), NULL);
+
+		TEST_ASSERT(ret == 0, "Failed to create instance of pmd : %s",
+			RTE_STR(CRYPTODEV_NAME_OPENSSL_PMD));
+	}
+	return testsuite_params_setup();
+}
+
+static int
+aesni_gcm_testsuite_setup(void)
+{
+	int32_t nb_devs;
+	nb_devs = rte_cryptodev_device_count_by_driver(
+			rte_cryptodev_driver_id_get(
+			RTE_STR(CRYPTODEV_NAME_AESNI_GCM_PMD)));
+	if (nb_devs < 1) {
+		TEST_ASSERT_SUCCESS(rte_vdev_init(
+			RTE_STR(CRYPTODEV_NAME_AESNI_GCM_PMD), NULL),
+			"Failed to create instance of pmd : %s",
+			RTE_STR(CRYPTODEV_NAME_AESNI_GCM_PMD));
+	}
+	return testsuite_params_setup();
+}
+
+static int
+null_testsuite_setup(void)
+{
+	int32_t nb_devs, ret;
+	nb_devs = rte_cryptodev_device_count_by_driver(
+			rte_cryptodev_driver_id_get(
+			RTE_STR(CRYPTODEV_NAME_NULL_PMD)));
+	if (nb_devs < 1) {
+		ret = rte_vdev_init(RTE_STR(CRYPTODEV_NAME_NULL_PMD), NULL);
+
+		TEST_ASSERT(ret == 0,
+			"Failed to create instance of pmd : %s",
+			RTE_STR(CRYPTODEV_NAME_NULL_PMD));
+	}
+	return testsuite_params_setup();
+}
+
+static int
+sw_snow3g_testsuite_setup(void)
+{
+	int32_t nb_devs;
+	nb_devs = rte_cryptodev_device_count_by_driver(
+			rte_cryptodev_driver_id_get(
+			RTE_STR(CRYPTODEV_NAME_SNOW3G_PMD)));
+	if (nb_devs < 1) {
+		TEST_ASSERT_SUCCESS(rte_vdev_init(
+			RTE_STR(CRYPTODEV_NAME_SNOW3G_PMD), NULL),
+			"Failed to create instance of pmd : %s",
+			RTE_STR(CRYPTODEV_NAME_SNOW3G_PMD));
+	}
+	return testsuite_params_setup();
+}
+
+static int
+sw_kasumi_testsuite_setup(void)
+{
+	int32_t nb_devs;
+	nb_devs = rte_cryptodev_device_count_by_driver(
+			rte_cryptodev_driver_id_get(
+			RTE_STR(CRYPTODEV_NAME_KASUMI_PMD)));
+	if (nb_devs < 1) {
+		TEST_ASSERT_SUCCESS(rte_vdev_init(
+			RTE_STR(CRYPTODEV_NAME_KASUMI_PMD), NULL),
+			"Failed to create instance of pmd : %s",
+			RTE_STR(CRYPTODEV_NAME_KASUMI_PMD));
+	}
+	return testsuite_params_setup();
+}
+
+static int
+sw_zuc_testsuite_setup(void)
+{
+	int32_t nb_devs;
+	nb_devs = rte_cryptodev_device_count_by_driver(
+			rte_cryptodev_driver_id_get(
+			RTE_STR(CRYPTODEV_NAME_ZUC_PMD)));
+	if (nb_devs < 1) {
+		TEST_ASSERT_SUCCESS(rte_vdev_init(
+			RTE_STR(CRYPTODEV_NAME_ZUC_PMD), NULL),
+			"Failed to create instance of pmd : %s",
+			RTE_STR(CRYPTODEV_NAME_ZUC_PMD));
+	}
+	return testsuite_params_setup();
+}
+
+static int
+armv8_testsuite_setup(void)
+{
+	int32_t nb_devs, ret;
+	nb_devs = rte_cryptodev_device_count_by_driver(
+			rte_cryptodev_driver_id_get(
+			RTE_STR(CRYPTODEV_NAME_ARMV8_PMD)));
+	if (nb_devs < 1) {
+		ret = rte_vdev_init(RTE_STR(CRYPTODEV_NAME_ARMV8_PMD), NULL);
+
+		TEST_ASSERT(ret == 0, "Failed to create instance of pmd : %s",
+			RTE_STR(CRYPTODEV_NAME_ARMV8_PMD));
+	}
+	return testsuite_params_setup();
+}
+
+static int
+mrvl_testsuite_setup(void)
+{
+	int32_t nb_devs, ret;
+	nb_devs = rte_cryptodev_device_count_by_driver(
+			rte_cryptodev_driver_id_get(
+			RTE_STR(CRYPTODEV_NAME_MVSAM_PMD)));
+	if (nb_devs < 1) {
+		ret = rte_vdev_init(RTE_STR(CRYPTODEV_NAME_MVSAM_PMD), NULL);
+
+		TEST_ASSERT(ret == 0, "Failed to create instance of pmd : %s",
+			RTE_STR(CRYPTODEV_NAME_MVSAM_PMD));
+	}
+	return testsuite_params_setup();
+}
+
+static int
+dpaa_sec_testsuite_setup(void)
+{
+	return testsuite_params_setup();
+}
+
+static int
+dpaa2_sec_testsuite_setup(void)
+{
+	return testsuite_params_setup();
+}
+
+static int
+ccp_testsuite_setup(void)
+{
+	int32_t nb_devs, ret;
+	nb_devs = rte_cryptodev_device_count_by_driver(
+			rte_cryptodev_driver_id_get(
+			RTE_STR(CRYPTODEV_NAME_CCP_PMD)));
+	if (nb_devs < 1) {
+		ret = rte_vdev_init(RTE_STR(CRYPTODEV_NAME_CCP_PMD), NULL);
+
+		TEST_ASSERT(ret == 0, "Failed to create instance of pmd : %s",
+			RTE_STR(CRYPTODEV_NAME_CCP_PMD));
+	}
+	return testsuite_params_setup();
+}
+
+static int
+octeontx_testsuite_setup(void)
+{
+	return testsuite_params_setup();
+}
+
+static int
+octeontx2_testsuite_setup(void)
+{
+	return testsuite_params_setup();
+}
+
+static int
+caam_jr_testsuite_setup(void)
+{
+	return testsuite_params_setup();
+}
+
+static int
+nitrox_testsuite_setup(void)
+{
+	return testsuite_params_setup();
+}
+
+static int
+bcmfs_testsuite_setup(void)
+{
+	return testsuite_params_setup();
+}
+
+static int
+qat_raw_testsuite_setup(void)
+{
+	return testsuite_params_setup();
+}
+
 static void
 testsuite_teardown(void)
 {
@@ -13069,6 +13083,59 @@ test_chacha20_poly1305_decrypt_test_case_rfc8439(void)
 /* global AESNI worker IDs for the scheduler test */
 uint8_t aesni_ids[2];
 
+static int
+scheduler_testsuite_setup(void)
+{
+	uint32_t i = 0;
+	int32_t nb_devs, ret;
+	char vdev_args[VDEV_ARGS_SIZE] = {""};
+	char temp_str[VDEV_ARGS_SIZE] = {"mode=multi-core,"
+		"ordering=enable,name=cryptodev_test_scheduler,corelist="};
+	uint16_t worker_core_count = 0;
+	uint16_t socket_id = 0;
+
+	if (gbl_driver_id == rte_cryptodev_driver_id_get(
+			RTE_STR(CRYPTODEV_NAME_SCHEDULER_PMD))) {
+
+		/* Identify the Worker Cores
+		 * Use 2 worker cores for the device args
+		 */
+		RTE_LCORE_FOREACH_WORKER(i) {
+			if (worker_core_count > 1)
+				break;
+			snprintf(vdev_args, sizeof(vdev_args),
+					"%s%d", temp_str, i);
+			strcpy(temp_str, vdev_args);
+			strlcat(temp_str, ";", sizeof(temp_str));
+			worker_core_count++;
+			socket_id = rte_lcore_to_socket_id(i);
+		}
+		if (worker_core_count != 2) {
+			RTE_LOG(ERR, USER1,
+				"Cryptodev scheduler test require at least "
+				"two worker cores to run. "
+				"Please use the correct coremask.\n");
+			return TEST_FAILED;
+		}
+		strcpy(temp_str, vdev_args);
+		snprintf(vdev_args, sizeof(vdev_args), "%s,socket_id=%d",
+				temp_str, socket_id);
+		RTE_LOG(DEBUG, USER1, "vdev_args: %s\n", vdev_args);
+		nb_devs = rte_cryptodev_device_count_by_driver(
+				rte_cryptodev_driver_id_get(
+				RTE_STR(CRYPTODEV_NAME_SCHEDULER_PMD)));
+		if (nb_devs < 1) {
+			ret = rte_vdev_init(
+				RTE_STR(CRYPTODEV_NAME_SCHEDULER_PMD),
+					vdev_args);
+			TEST_ASSERT(ret == 0,
+				"Failed to create instance %u of pmd : %s",
+				i, RTE_STR(CRYPTODEV_NAME_SCHEDULER_PMD));
+		}
+	}
+	return testsuite_params_setup();
+}
+
 static int
 test_scheduler_attach_slave_op(void)
 {
@@ -13243,53 +13310,65 @@ test_scheduler_mode_pkt_size_distr_op(void)
 	return 0;
 }
 
-static struct unit_test_suite cryptodev_scheduler_testsuite  = {
-	.suite_name = "Crypto Device Scheduler Unit Test Suite",
-	.setup = testsuite_setup,
-	.teardown = testsuite_teardown,
-	.unit_test_cases = ((struct unit_test_case []) {
-		/* Multi Core */
-		TEST_CASE_ST(NULL, NULL, test_scheduler_attach_slave_op),
-		TEST_CASE_ST(NULL, NULL, test_scheduler_mode_multicore_op),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_chain_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_cipheronly_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_authonly_all),
-		TEST_CASE_ST(NULL, NULL, test_scheduler_detach_slave_op),
+static int
+scheduler_multicore_testsuite_setup(void)
+{
+	if (test_scheduler_attach_slave_op() < 0)
+		return -1;
+	if (test_scheduler_mode_op(CDEV_SCHED_MODE_MULTICORE) < 0)
+		return -1;
+	return 0;
+}
 
-		/* Round Robin */
-		TEST_CASE_ST(NULL, NULL, test_scheduler_attach_slave_op),
-		TEST_CASE_ST(NULL, NULL, test_scheduler_mode_roundrobin_op),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_chain_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_cipheronly_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_authonly_all),
-		TEST_CASE_ST(NULL, NULL, test_scheduler_detach_slave_op),
+static int
+scheduler_roundrobin_testsuite_setup(void)
+{
+	if (test_scheduler_attach_slave_op() < 0)
+		return -1;
+	if (test_scheduler_mode_op(CDEV_SCHED_MODE_ROUNDROBIN) < 0)
+		return -1;
+	return 0;
+}
 
-		/* Fail over */
-		TEST_CASE_ST(NULL, NULL, test_scheduler_attach_slave_op),
-		TEST_CASE_ST(NULL, NULL, test_scheduler_mode_failover_op),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_chain_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_cipheronly_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_authonly_all),
-		TEST_CASE_ST(NULL, NULL, test_scheduler_detach_slave_op),
+static int
+scheduler_failover_testsuite_setup(void)
+{
+	if (test_scheduler_attach_slave_op() < 0)
+		return -1;
+	if (test_scheduler_mode_op(CDEV_SCHED_MODE_FAILOVER) < 0)
+		return -1;
+	return 0;
+}
 
-		/* PKT SIZE */
-		TEST_CASE_ST(NULL, NULL, test_scheduler_attach_slave_op),
-		TEST_CASE_ST(NULL, NULL, test_scheduler_mode_pkt_size_distr_op),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_chain_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_cipheronly_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_authonly_all),
-		TEST_CASE_ST(NULL, NULL, test_scheduler_detach_slave_op),
+static int
+scheduler_pkt_size_distr_testsuite_setup(void)
+{
+	if (test_scheduler_attach_slave_op() < 0)
+		return -1;
+	if (test_scheduler_mode_op(CDEV_SCHED_MODE_PKT_SIZE_DISTR) < 0)
+		return -1;
+	return 0;
+}
 
-		TEST_CASES_END() /**< NULL terminate unit test array */
-	})
-};
+static void
+scheduler_mode_testsuite_teardown(void)
+{
+	test_scheduler_detach_slave_op();
+}
 
 #endif /* RTE_CRYPTO_SCHEDULER */
 
-static struct unit_test_suite cryptodev_testsuite  = {
-	.suite_name = "Crypto Unit Test Suite",
-	.setup = testsuite_setup,
-	.teardown = testsuite_teardown,
+static const struct unit_test_suite end_testsuite = {
+	.suite_name = NULL,
+	.setup = NULL,
+	.teardown = NULL,
+	.parent_testsuite = NULL,
+	.unit_test_cases = NULL
+};
+
+static const struct unit_test_suite cryptodev_testsuite  = {
+	.suite_name = "Crypto General Unit Test Suite",
+	.parent_testsuite = false,
 	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE_ST(ut_setup, ut_teardown,
 				test_device_configure_invalid_dev_id),
@@ -13297,25 +13376,73 @@ static struct unit_test_suite cryptodev_testsuite  = {
 				test_queue_pair_descriptor_setup),
 		TEST_CASE_ST(ut_setup, ut_teardown,
 				test_device_configure_invalid_queue_pair_ids),
+		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_chain_all),
+		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_cipheronly_all),
+		TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_chain_all),
+		TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_cipheronly_all),
+		TEST_CASE_ST(ut_setup, ut_teardown, test_DES_cipheronly_all),
+		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_docsis_all),
+		TEST_CASE_ST(ut_setup, ut_teardown, test_DES_docsis_all),
+		TEST_CASE_ST(ut_setup, ut_teardown, test_authonly_all),
+		TEST_CASE_ST(ut_setup, ut_teardown, test_stats),
+#ifdef RTE_LIB_SECURITY
+		TEST_CASE_ST(ut_setup_security, ut_teardown,
+			test_PDCP_PROTO_all),
+		TEST_CASE_ST(ut_setup_security, ut_teardown,
+			test_DOCSIS_PROTO_all),
+#endif
+		TEST_CASE_ST(ut_setup, ut_teardown, test_enq_callback_setup),
+		TEST_CASE_ST(ut_setup, ut_teardown, test_deq_callback_setup),
+		TEST_CASES_END() /**< NULL terminate unit test array */
+	})
+};
+
+static struct unit_test_suite cryptodev_negative_hmac_sha1_testsuite = {
+	.suite_name = "Negative HMAC SHA1 Unit Test Suite",
+	.parent_testsuite = false,
+	.unit_test_cases = ((struct unit_test_case []) {
+		/** Negative tests */
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			authentication_verify_HMAC_SHA1_fail_data_corrupt),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			authentication_verify_HMAC_SHA1_fail_tag_corrupt),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			auth_decryption_AES128CBC_HMAC_SHA1_fail_data_corrupt),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-				test_multi_session),
+			auth_decryption_AES128CBC_HMAC_SHA1_fail_tag_corrupt),
+
+		TEST_CASES_END() /**< NULL terminate unit test array */
+	})
+};
+
+static struct unit_test_suite cryptodev_multi_session_testsuite = {
+	.suite_name = "Multi Session Unit Test Suite",
+	.parent_testsuite = false,
+	.unit_test_cases = ((struct unit_test_case []) {
+		TEST_CASE_ST(ut_setup, ut_teardown, test_multi_session),
 		TEST_CASE_ST(ut_setup, ut_teardown,
 				test_multi_session_random_usage),
 
+		TEST_CASES_END() /**< NULL terminate unit test array */
+	})
+};
+
+static const struct unit_test_suite cryptodev_null_testsuite  = {
+	.suite_name = "NULL Test Suite",
+	.parent_testsuite = false,
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_null_invalid_operation),
 		TEST_CASE_ST(ut_setup, ut_teardown, test_null_burst_operation),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_chain_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_cipheronly_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_chain_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_cipheronly_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_DES_cipheronly_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_docsis_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_DES_docsis_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_authonly_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_stats),
+		TEST_CASES_END()
+	})
+};
 
-		/** AES CCM Authenticated Encryption 128 bits key */
+static const struct unit_test_suite cryptodev_aes_ccm_auth_testsuite  = {
+	.suite_name = "AES CCM Authenticated Test Suite",
+	.parent_testsuite = false,
+	.unit_test_cases = ((struct unit_test_case []) {
+		/** AES CCM Authenticated Encryption 128 bits key*/
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_AES_CCM_authenticated_encryption_test_case_128_1),
 		TEST_CASE_ST(ut_setup, ut_teardown,
@@ -13362,7 +13489,14 @@ static struct unit_test_suite cryptodev_testsuite  = {
 			test_AES_CCM_authenticated_decryption_test_case_256_2),
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_AES_CCM_authenticated_decryption_test_case_256_3),
+		TEST_CASES_END()
+	})
+};
 
+static const struct unit_test_suite cryptodev_aes_gcm_auth_testsuite  = {
+	.suite_name = "AES GCM Authenticated Test Suite",
+	.parent_testsuite = false,
+	.unit_test_cases = ((struct unit_test_case []) {
 		/** AES GCM Authenticated Encryption */
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_AES_GCM_auth_encrypt_SGL_in_place_1500B),
@@ -13499,7 +13633,14 @@ static struct unit_test_suite cryptodev_testsuite  = {
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_AES_GCM_authenticated_decryption_sessionless_test_case_1),
 
-		/** AES GMAC Authentication */
+		TEST_CASES_END()
+	})
+};
+
+static const struct unit_test_suite cryptodev_aes_gmac_auth_testsuite  = {
+	.suite_name = "AES GMAC Authentication Test Suite",
+	.parent_testsuite = false,
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_AES_GMAC_authentication_test_case_1),
 		TEST_CASE_ST(ut_setup, ut_teardown,
@@ -13525,11 +13666,26 @@ static struct unit_test_suite cryptodev_testsuite  = {
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_AES_GMAC_authentication_SGL_2047B),
 
-		/** Chacha20-Poly1305 */
+		TEST_CASES_END()
+	})
+};
+
+static const struct unit_test_suite cryptodev_chacha20_poly1305_testsuite  = {
+	.suite_name = "Chacha20-Poly1305 Test Suite",
+	.parent_testsuite = false,
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_chacha20_poly1305_encrypt_test_case_rfc8439),
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_chacha20_poly1305_decrypt_test_case_rfc8439),
+		TEST_CASES_END()
+	})
+};
+
+static const struct unit_test_suite cryptodev_snow3g_testsuite  = {
+	.suite_name = "SNOW 3G Test Suite",
+	.parent_testsuite = false,
+	.unit_test_cases = ((struct unit_test_case []) {
 		/** SNOW 3G encrypt only (UEA2) */
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_snow3g_encryption_test_case_1),
@@ -13610,6 +13766,7 @@ static struct unit_test_suite cryptodev_testsuite  = {
 			test_snow3g_hash_generate_test_case_2),
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_snow3g_hash_generate_test_case_3),
+
 		/* Tests with buffers which length is not byte-aligned */
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_snow3g_hash_generate_test_case_4),
@@ -13623,6 +13780,7 @@ static struct unit_test_suite cryptodev_testsuite  = {
 			test_snow3g_hash_verify_test_case_2),
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_snow3g_hash_verify_test_case_3),
+
 		/* Tests with buffers which length is not byte-aligned */
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_snow3g_hash_verify_test_case_4),
@@ -13634,7 +13792,14 @@ static struct unit_test_suite cryptodev_testsuite  = {
 			test_snow3g_cipher_auth_test_case_1),
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_snow3g_auth_cipher_with_digest_test_case_1),
+		TEST_CASES_END()
+	})
+};
 
+static const struct unit_test_suite cryptodev_zuc_testsuite  = {
+	.suite_name = "ZUC Test Suite",
+	.parent_testsuite = false,
+	.unit_test_cases = ((struct unit_test_case []) {
 		/** ZUC encrypt only (EEA3) */
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_zuc_encryption_test_case_1),
@@ -13692,8 +13857,14 @@ static struct unit_test_suite cryptodev_testsuite  = {
 			test_zuc_auth_cipher_verify_test_case_1_sgl),
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_zuc_auth_cipher_verify_test_case_1_oop_sgl),
+		TEST_CASES_END()
+	})
+};
 
-		/** HMAC_MD5 Authentication */
+static const struct unit_test_suite cryptodev_hmac_md5_auth_testsuite  = {
+	.suite_name = "HMAC_MD5 Authentication Test Suite",
+	.parent_testsuite = false,
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_MD5_HMAC_generate_case_1),
 		TEST_CASE_ST(ut_setup, ut_teardown,
@@ -13702,7 +13873,14 @@ static struct unit_test_suite cryptodev_testsuite  = {
 			test_MD5_HMAC_generate_case_2),
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_MD5_HMAC_verify_case_2),
+		TEST_CASES_END()
+	})
+};
 
+static const struct unit_test_suite cryptodev_kasumi_testsuite  = {
+	.suite_name = "Kasumi Test Suite",
+	.parent_testsuite = false,
+	.unit_test_cases = ((struct unit_test_case []) {
 		/** KASUMI hash only (UIA1) */
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_kasumi_hash_generate_test_case_1),
@@ -13787,17 +13965,26 @@ static struct unit_test_suite cryptodev_testsuite  = {
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_kasumi_auth_cipher_verify_test_case_2_oop_sgl),
 
-		/** ESN Testcase */
+		TEST_CASES_END()
+	})
+};
+
+static const struct unit_test_suite cryptodev_esn_testsuite  = {
+	.suite_name = "ESN Test Suite",
+	.parent_testsuite = false,
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			auth_encrypt_AES128CBC_HMAC_SHA1_esn_check),
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			auth_decrypt_AES128CBC_HMAC_SHA1_esn_check),
+		TEST_CASES_END()
+	})
+};
 
-		/** Negative tests */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			authentication_verify_HMAC_SHA1_fail_data_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			authentication_verify_HMAC_SHA1_fail_tag_corrupt),
+static const struct unit_test_suite cryptodev_negative_aes_gcm_testsuite  = {
+	.suite_name = "Negative AES GCM Test Suite",
+	.parent_testsuite = false,
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_AES_GCM_auth_encryption_fail_iv_corrupt),
 		TEST_CASE_ST(ut_setup, ut_teardown,
@@ -13822,16 +14009,28 @@ static struct unit_test_suite cryptodev_testsuite  = {
 			test_AES_GCM_auth_decryption_fail_aad_corrupt),
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_AES_GCM_auth_decryption_fail_tag_corrupt),
+
+		TEST_CASES_END()
+	})
+};
+
+static const struct unit_test_suite cryptodev_negative_aes_gmac_testsuite  = {
+	.suite_name = "Negative AES GMAC Test Suite",
+	.parent_testsuite = false,
+	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			authentication_verify_AES128_GMAC_fail_data_corrupt),
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			authentication_verify_AES128_GMAC_fail_tag_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			auth_decryption_AES128CBC_HMAC_SHA1_fail_data_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			auth_decryption_AES128CBC_HMAC_SHA1_fail_tag_corrupt),
 
-		/** Mixed CIPHER + HASH algorithms */
+		TEST_CASES_END()
+	})
+};
+
+static const struct unit_test_suite cryptodev_mixed_cipher_hash_testsuite  = {
+	.suite_name = "Mixed CIPHER + HASH algorithms Test Suite",
+	.parent_testsuite = false,
+	.unit_test_cases = ((struct unit_test_case []) {
 		/** AUTH AES CMAC + CIPHER AES CTR */
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_aes_cmac_aes_ctr_digest_enc_test_case_1),
@@ -13844,11 +14043,11 @@ static struct unit_test_suite cryptodev_testsuite  = {
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_verify_aes_cmac_aes_ctr_digest_enc_test_case_1),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-		       test_verify_aes_cmac_aes_ctr_digest_enc_test_case_1_oop),
+			test_verify_aes_cmac_aes_ctr_digest_enc_test_case_1_oop),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-		       test_verify_aes_cmac_aes_ctr_digest_enc_test_case_1_sgl),
+			test_verify_aes_cmac_aes_ctr_digest_enc_test_case_1_sgl),
 		TEST_CASE_ST(ut_setup, ut_teardown,
-		   test_verify_aes_cmac_aes_ctr_digest_enc_test_case_1_oop_sgl),
+			test_verify_aes_cmac_aes_ctr_digest_enc_test_case_1_oop_sgl),
 
 		/** AUTH ZUC + CIPHER SNOW3G */
 		TEST_CASE_ST(ut_setup, ut_teardown,
@@ -13911,23 +14110,12 @@ static struct unit_test_suite cryptodev_testsuite  = {
 			test_auth_aes_cmac_cipher_null_test_case_1),
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_verify_auth_aes_cmac_cipher_null_test_case_1),
-
-#ifdef RTE_LIB_SECURITY
-		TEST_CASE_ST(ut_setup_security, ut_teardown,
-			test_PDCP_PROTO_all),
-		TEST_CASE_ST(ut_setup_security, ut_teardown,
-			test_DOCSIS_PROTO_all),
-#endif
-		TEST_CASE_ST(ut_setup, ut_teardown, test_enq_callback_setup),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_deq_callback_setup),
-		TEST_CASES_END() /**< NULL terminate unit test array */
+		TEST_CASES_END()
 	})
 };
 
-static struct unit_test_suite cryptodev_virtio_testsuite = {
+static struct unit_test_suite cryptodev_virtio_sub_testsuite = {
 	.suite_name = "Crypto VIRTIO Unit Test Suite",
-	.setup = testsuite_setup,
-	.teardown = testsuite_teardown,
 	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_cipheronly_all),
 
@@ -13935,15 +14123,13 @@ static struct unit_test_suite cryptodev_virtio_testsuite = {
 	})
 };
 
-static struct unit_test_suite cryptodev_caam_jr_testsuite  = {
-	.suite_name = "Crypto CAAM JR Unit Test Suite",
-	.setup = testsuite_setup,
-	.teardown = testsuite_teardown,
+static struct unit_test_suite cryptodev_caam_jr_sub_testsuite = {
+	.suite_name = "Crypto CAAM JR Sub Unit Test Suite",
+	.parent_testsuite = false,
 	.unit_test_cases = ((struct unit_test_case []) {
 		TEST_CASE_ST(ut_setup, ut_teardown,
-			     test_device_configure_invalid_dev_id),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			     test_multi_session),
+				test_device_configure_invalid_dev_id),
+		TEST_CASE_ST(ut_setup, ut_teardown, test_multi_session),
 
 		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_chain_all),
 		TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_chain_all),
@@ -13955,58 +14141,28 @@ static struct unit_test_suite cryptodev_caam_jr_testsuite  = {
 	})
 };
 
-static struct unit_test_suite cryptodev_mrvl_testsuite  = {
+static struct unit_test_suite cryptodev_mrvl_sub_testsuite  = {
 	.suite_name = "Crypto Device Marvell Component Test Suite",
-	.setup = testsuite_setup,
-	.teardown = testsuite_teardown,
 	.unit_test_cases = ((struct unit_test_case []) {
-		TEST_CASE_ST(ut_setup, ut_teardown, test_multi_session),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-				test_multi_session_random_usage),
 		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_chain_all),
 		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_cipheronly_all),
 		TEST_CASE_ST(ut_setup, ut_teardown, test_authonly_all),
 		TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_chain_all),
 		TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_cipheronly_all),
 
-		/** Negative tests */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			authentication_verify_HMAC_SHA1_fail_data_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			authentication_verify_HMAC_SHA1_fail_tag_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			auth_decryption_AES128CBC_HMAC_SHA1_fail_data_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			auth_decryption_AES128CBC_HMAC_SHA1_fail_tag_corrupt),
-
 		TEST_CASES_END() /**< NULL terminate unit test array */
 	})
 };
 
-static struct unit_test_suite cryptodev_ccp_testsuite  = {
+static struct unit_test_suite cryptodev_ccp_sub_testsuite  = {
 	.suite_name = "Crypto Device CCP Unit Test Suite",
-	.setup = testsuite_setup,
-	.teardown = testsuite_teardown,
 	.unit_test_cases = ((struct unit_test_case []) {
-		TEST_CASE_ST(ut_setup, ut_teardown, test_multi_session),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-				test_multi_session_random_usage),
 		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_chain_all),
 		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_cipheronly_all),
 		TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_chain_all),
 		TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_cipheronly_all),
 		TEST_CASE_ST(ut_setup, ut_teardown, test_authonly_all),
 
-		/** Negative tests */
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			authentication_verify_HMAC_SHA1_fail_data_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			authentication_verify_HMAC_SHA1_fail_tag_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			auth_decryption_AES128CBC_HMAC_SHA1_fail_data_corrupt),
-		TEST_CASE_ST(ut_setup, ut_teardown,
-			auth_decryption_AES128CBC_HMAC_SHA1_fail_tag_corrupt),
-
 		TEST_CASES_END() /**< NULL terminate unit test array */
 	})
 };
@@ -14014,6 +14170,33 @@ static struct unit_test_suite cryptodev_ccp_testsuite  = {
 static int
 test_cryptodev_qat(void /*argv __rte_unused, int argc __rte_unused*/)
 {
+	uint8_t ret, j, i = 0;
+	struct unit_test_suite static_suites[] = {
+		cryptodev_multi_session_testsuite,
+		cryptodev_null_testsuite,
+		cryptodev_aes_ccm_auth_testsuite,
+		cryptodev_aes_gcm_auth_testsuite,
+		cryptodev_aes_gmac_auth_testsuite,
+		cryptodev_snow3g_testsuite,
+		cryptodev_chacha20_poly1305_testsuite,
+		cryptodev_zuc_testsuite,
+		cryptodev_hmac_md5_auth_testsuite,
+		cryptodev_kasumi_testsuite,
+		cryptodev_esn_testsuite,
+		cryptodev_negative_aes_gcm_testsuite,
+		cryptodev_negative_aes_gmac_testsuite,
+		cryptodev_mixed_cipher_hash_testsuite,
+		cryptodev_negative_hmac_sha1_testsuite,
+		cryptodev_testsuite,
+		end_testsuite
+	};
+	struct unit_test_suite ts = {
+		.suite_name = "QAT Unit Test Suite",
+		.setup = qat_testsuite_setup,
+		.teardown = testsuite_teardown,
+		.parent_testsuite = true
+	};
+
 	gbl_driver_id =	rte_cryptodev_driver_id_get(
 			RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD));
 
@@ -14021,13 +14204,31 @@ test_cryptodev_qat(void /*argv __rte_unused, int argc __rte_unused*/)
 		RTE_LOG(ERR, USER1, "QAT PMD must be loaded.\n");
 		return TEST_SKIPPED;
 	}
+	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
+			RTE_DIM(static_suites));
+
+	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
+	ret = unit_test_suite_runner(&ts);
 
-	return unit_test_suite_runner(&cryptodev_testsuite);
+	free(ts.unit_test_suites);
+	return ret;
 }
 
 static int
 test_cryptodev_virtio(void /*argv __rte_unused, int argc __rte_unused*/)
 {
+	uint8_t ret, j, i = 0;
+	struct unit_test_suite static_suites[] = {
+		cryptodev_virtio_sub_testsuite,
+		end_testsuite
+	};
+	struct unit_test_suite ts = {
+		.suite_name = "Virtio Unit Test Suite",
+		.setup = virtio_testsuite_setup,
+		.teardown = testsuite_teardown,
+		.parent_testsuite = true
+	};
+
 	gbl_driver_id =	rte_cryptodev_driver_id_get(
 			RTE_STR(CRYPTODEV_NAME_VIRTIO_PMD));
 
@@ -14035,13 +14236,46 @@ test_cryptodev_virtio(void /*argv __rte_unused, int argc __rte_unused*/)
 		RTE_LOG(ERR, USER1, "VIRTIO PMD must be loaded.\n");
 		return TEST_FAILED;
 	}
+	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
+			RTE_DIM(static_suites));
 
-	return unit_test_suite_runner(&cryptodev_virtio_testsuite);
+	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
+	ret = unit_test_suite_runner(&ts);
+
+	free(ts.unit_test_suites);
+	return ret;
 }
 
 static int
 test_cryptodev_aesni_mb(void /*argv __rte_unused, int argc __rte_unused*/)
 {
+	uint8_t ret, j, i = 0;
+	struct unit_test_suite static_suites[] = {
+		cryptodev_multi_session_testsuite,
+		cryptodev_null_testsuite,
+		cryptodev_aes_ccm_auth_testsuite,
+		cryptodev_aes_gcm_auth_testsuite,
+		cryptodev_aes_gmac_auth_testsuite,
+		cryptodev_snow3g_testsuite,
+		cryptodev_chacha20_poly1305_testsuite,
+		cryptodev_zuc_testsuite,
+		cryptodev_hmac_md5_auth_testsuite,
+		cryptodev_kasumi_testsuite,
+		cryptodev_esn_testsuite,
+		cryptodev_negative_aes_gcm_testsuite,
+		cryptodev_negative_aes_gmac_testsuite,
+		cryptodev_mixed_cipher_hash_testsuite,
+		cryptodev_negative_hmac_sha1_testsuite,
+		cryptodev_testsuite,
+		end_testsuite
+	};
+	struct unit_test_suite ts = {
+		.suite_name = "AESNI_MB Unit Test Suite",
+		.setup = aesni_mb_testsuite_setup,
+		.teardown = testsuite_teardown,
+		.parent_testsuite = true
+	};
+
 	gbl_driver_id =	rte_cryptodev_driver_id_get(
 			RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD));
 
@@ -14050,14 +14284,47 @@ test_cryptodev_aesni_mb(void /*argv __rte_unused, int argc __rte_unused*/)
 		return TEST_SKIPPED;
 	}
 
-	return unit_test_suite_runner(&cryptodev_testsuite);
+	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
+			RTE_DIM(static_suites));
+
+	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
+	ret = unit_test_suite_runner(&ts);
+
+	free(ts.unit_test_suites);
+	return ret;
 }
 
 static int
 test_cryptodev_cpu_aesni_mb(void)
 {
 	int32_t rc;
+	uint8_t j, i = 0;
 	enum rte_security_session_action_type at;
+	struct unit_test_suite static_suites[] = {
+		cryptodev_multi_session_testsuite,
+		cryptodev_null_testsuite,
+		cryptodev_aes_ccm_auth_testsuite,
+		cryptodev_aes_gcm_auth_testsuite,
+		cryptodev_aes_gmac_auth_testsuite,
+		cryptodev_snow3g_testsuite,
+		cryptodev_chacha20_poly1305_testsuite,
+		cryptodev_zuc_testsuite,
+		cryptodev_hmac_md5_auth_testsuite,
+		cryptodev_kasumi_testsuite,
+		cryptodev_esn_testsuite,
+		cryptodev_negative_aes_gcm_testsuite,
+		cryptodev_negative_aes_gmac_testsuite,
+		cryptodev_mixed_cipher_hash_testsuite,
+		cryptodev_negative_hmac_sha1_testsuite,
+		cryptodev_testsuite,
+		end_testsuite
+	};
+	struct unit_test_suite ts = {
+		.suite_name = "AESNI_MB CPU Unit Test Suite",
+		.setup = aesni_mb_testsuite_setup,
+		.teardown = testsuite_teardown,
+		.parent_testsuite = true
+	};
 
 	gbl_driver_id =	rte_cryptodev_driver_id_get(
 			RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD));
@@ -14067,9 +14334,15 @@ test_cryptodev_cpu_aesni_mb(void)
 		return TEST_SKIPPED;
 	}
 
+	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
+			RTE_DIM(static_suites));
+
+	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
+
 	at = gbl_action_type;
 	gbl_action_type = RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO;
-	rc = unit_test_suite_runner(&cryptodev_testsuite);
+	rc = unit_test_suite_runner(&ts);
+	free(ts.unit_test_suites);
 	gbl_action_type = at;
 	return rc;
 }
@@ -14077,6 +14350,33 @@ test_cryptodev_cpu_aesni_mb(void)
 static int
 test_cryptodev_openssl(void)
 {
+	uint8_t ret, j, i = 0;
+	struct unit_test_suite static_suites[] = {
+		cryptodev_multi_session_testsuite,
+		cryptodev_null_testsuite,
+		cryptodev_aes_ccm_auth_testsuite,
+		cryptodev_aes_gcm_auth_testsuite,
+		cryptodev_aes_gmac_auth_testsuite,
+		cryptodev_chacha20_poly1305_testsuite,
+		cryptodev_snow3g_testsuite,
+		cryptodev_zuc_testsuite,
+		cryptodev_hmac_md5_auth_testsuite,
+		cryptodev_kasumi_testsuite,
+		cryptodev_esn_testsuite,
+		cryptodev_negative_aes_gcm_testsuite,
+		cryptodev_negative_aes_gmac_testsuite,
+		cryptodev_mixed_cipher_hash_testsuite,
+		cryptodev_negative_hmac_sha1_testsuite,
+		cryptodev_testsuite,
+		end_testsuite
+	};
+	struct unit_test_suite ts = {
+		.suite_name = "OpenSSL Unit Test Suite",
+		.setup = openssl_testsuite_setup,
+		.teardown = testsuite_teardown,
+		.parent_testsuite = true
+	};
+
 	gbl_driver_id = rte_cryptodev_driver_id_get(
 			RTE_STR(CRYPTODEV_NAME_OPENSSL_PMD));
 
@@ -14085,12 +14385,46 @@ test_cryptodev_openssl(void)
 		return TEST_SKIPPED;
 	}
 
-	return unit_test_suite_runner(&cryptodev_testsuite);
+	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
+			RTE_DIM(static_suites));
+
+	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
+	ret = unit_test_suite_runner(&ts);
+
+	free(ts.unit_test_suites);
+	return ret;
 }
 
 static int
 test_cryptodev_aesni_gcm(void)
 {
+	uint8_t ret, j, i = 0;
+	struct unit_test_suite static_suites[] = {
+		cryptodev_multi_session_testsuite,
+		cryptodev_null_testsuite,
+		cryptodev_aes_ccm_auth_testsuite,
+		cryptodev_aes_gcm_auth_testsuite,
+		cryptodev_aes_gmac_auth_testsuite,
+		cryptodev_chacha20_poly1305_testsuite,
+		cryptodev_snow3g_testsuite,
+		cryptodev_zuc_testsuite,
+		cryptodev_hmac_md5_auth_testsuite,
+		cryptodev_kasumi_testsuite,
+		cryptodev_esn_testsuite,
+		cryptodev_negative_aes_gcm_testsuite,
+		cryptodev_negative_aes_gmac_testsuite,
+		cryptodev_mixed_cipher_hash_testsuite,
+		cryptodev_negative_hmac_sha1_testsuite,
+		cryptodev_testsuite,
+		end_testsuite
+	};
+	struct unit_test_suite ts = {
+		.suite_name = "AESNI_GCM Unit Test Suite",
+		.setup = aesni_gcm_testsuite_setup,
+		.teardown = testsuite_teardown,
+		.parent_testsuite = true
+	};
+
 	gbl_driver_id = rte_cryptodev_driver_id_get(
 			RTE_STR(CRYPTODEV_NAME_AESNI_GCM_PMD));
 
@@ -14099,14 +14433,47 @@ test_cryptodev_aesni_gcm(void)
 		return TEST_SKIPPED;
 	}
 
-	return unit_test_suite_runner(&cryptodev_testsuite);
+	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
+			RTE_DIM(static_suites));
+
+	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
+	ret = unit_test_suite_runner(&ts);
+
+	free(ts.unit_test_suites);
+	return ret;
 }
 
 static int
 test_cryptodev_cpu_aesni_gcm(void)
 {
 	int32_t rc;
+	uint8_t j, i = 0;
 	enum rte_security_session_action_type at;
+	struct unit_test_suite static_suites[] = {
+		cryptodev_multi_session_testsuite,
+		cryptodev_null_testsuite,
+		cryptodev_aes_ccm_auth_testsuite,
+		cryptodev_aes_gcm_auth_testsuite,
+		cryptodev_aes_gmac_auth_testsuite,
+		cryptodev_chacha20_poly1305_testsuite,
+		cryptodev_snow3g_testsuite,
+		cryptodev_zuc_testsuite,
+		cryptodev_hmac_md5_auth_testsuite,
+		cryptodev_kasumi_testsuite,
+		cryptodev_esn_testsuite,
+		cryptodev_negative_aes_gcm_testsuite,
+		cryptodev_negative_aes_gmac_testsuite,
+		cryptodev_mixed_cipher_hash_testsuite,
+		cryptodev_negative_hmac_sha1_testsuite,
+		cryptodev_testsuite,
+		end_testsuite
+	};
+	struct unit_test_suite ts = {
+		.suite_name = "AESNI_GCM CPU Unit Test Suite",
+		.setup = aesni_gcm_testsuite_setup,
+		.teardown = testsuite_teardown,
+		.parent_testsuite = true
+	};
 
 	gbl_driver_id = rte_cryptodev_driver_id_get(
 			RTE_STR(CRYPTODEV_NAME_AESNI_GCM_PMD));
@@ -14116,9 +14483,15 @@ test_cryptodev_cpu_aesni_gcm(void)
 		return TEST_SKIPPED;
 	}
 
+	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
+			RTE_DIM(static_suites));
+
+	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
+
 	at = gbl_action_type;
 	gbl_action_type = RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO;
-	rc = unit_test_suite_runner(&cryptodev_testsuite);
+	rc  = unit_test_suite_runner(&ts);
+	free(ts.unit_test_suites);
 	gbl_action_type = at;
 	return rc;
 }
@@ -14126,6 +14499,33 @@ test_cryptodev_cpu_aesni_gcm(void)
 static int
 test_cryptodev_null(void)
 {
+	uint8_t ret, j, i = 0;
+	struct unit_test_suite static_suites[] = {
+		cryptodev_multi_session_testsuite,
+		cryptodev_null_testsuite,
+		cryptodev_aes_ccm_auth_testsuite,
+		cryptodev_aes_gcm_auth_testsuite,
+		cryptodev_aes_gmac_auth_testsuite,
+		cryptodev_chacha20_poly1305_testsuite,
+		cryptodev_snow3g_testsuite,
+		cryptodev_zuc_testsuite,
+		cryptodev_hmac_md5_auth_testsuite,
+		cryptodev_kasumi_testsuite,
+		cryptodev_esn_testsuite,
+		cryptodev_negative_aes_gcm_testsuite,
+		cryptodev_negative_aes_gmac_testsuite,
+		cryptodev_mixed_cipher_hash_testsuite,
+		cryptodev_negative_hmac_sha1_testsuite,
+		cryptodev_testsuite,
+		end_testsuite
+	};
+	struct unit_test_suite ts = {
+		.suite_name = "Null Unit Test Suite",
+		.setup = null_testsuite_setup,
+		.teardown = testsuite_teardown,
+		.parent_testsuite = true
+	};
+
 	gbl_driver_id = rte_cryptodev_driver_id_get(
 			RTE_STR(CRYPTODEV_NAME_NULL_PMD));
 
@@ -14134,12 +14534,46 @@ test_cryptodev_null(void)
 		return TEST_SKIPPED;
 	}
 
-	return unit_test_suite_runner(&cryptodev_testsuite);
+	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
+			RTE_DIM(static_suites));
+
+	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
+	ret = unit_test_suite_runner(&ts);
+
+	free(ts.unit_test_suites);
+	return ret;
 }
 
 static int
 test_cryptodev_sw_snow3g(void /*argv __rte_unused, int argc __rte_unused*/)
 {
+	uint8_t ret, j, i = 0;
+	struct unit_test_suite static_suites[] = {
+		cryptodev_multi_session_testsuite,
+		cryptodev_null_testsuite,
+		cryptodev_aes_ccm_auth_testsuite,
+		cryptodev_aes_gcm_auth_testsuite,
+		cryptodev_aes_gmac_auth_testsuite,
+		cryptodev_snow3g_testsuite,
+		cryptodev_chacha20_poly1305_testsuite,
+		cryptodev_zuc_testsuite,
+		cryptodev_hmac_md5_auth_testsuite,
+		cryptodev_kasumi_testsuite,
+		cryptodev_esn_testsuite,
+		cryptodev_negative_aes_gcm_testsuite,
+		cryptodev_negative_aes_gmac_testsuite,
+		cryptodev_mixed_cipher_hash_testsuite,
+		cryptodev_negative_hmac_sha1_testsuite,
+		cryptodev_testsuite,
+		end_testsuite
+	};
+	struct unit_test_suite ts = {
+		.suite_name = "SW Snow3g Unit Test Suite",
+		.setup = sw_snow3g_testsuite_setup,
+		.teardown = testsuite_teardown,
+		.parent_testsuite = true
+	};
+
 	gbl_driver_id = rte_cryptodev_driver_id_get(
 			RTE_STR(CRYPTODEV_NAME_SNOW3G_PMD));
 
@@ -14148,12 +14582,46 @@ test_cryptodev_sw_snow3g(void /*argv __rte_unused, int argc __rte_unused*/)
 		return TEST_SKIPPED;
 	}
 
-	return unit_test_suite_runner(&cryptodev_testsuite);
+	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
+			RTE_DIM(static_suites));
+
+	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
+	ret = unit_test_suite_runner(&ts);
+
+	free(ts.unit_test_suites);
+	return ret;
 }
 
 static int
 test_cryptodev_sw_kasumi(void /*argv __rte_unused, int argc __rte_unused*/)
 {
+	uint8_t ret, j, i = 0;
+	struct unit_test_suite static_suites[] = {
+		cryptodev_multi_session_testsuite,
+		cryptodev_null_testsuite,
+		cryptodev_aes_ccm_auth_testsuite,
+		cryptodev_aes_gcm_auth_testsuite,
+		cryptodev_aes_gmac_auth_testsuite,
+		cryptodev_snow3g_testsuite,
+		cryptodev_chacha20_poly1305_testsuite,
+		cryptodev_zuc_testsuite,
+		cryptodev_hmac_md5_auth_testsuite,
+		cryptodev_kasumi_testsuite,
+		cryptodev_esn_testsuite,
+		cryptodev_negative_aes_gcm_testsuite,
+		cryptodev_negative_aes_gmac_testsuite,
+		cryptodev_mixed_cipher_hash_testsuite,
+		cryptodev_negative_hmac_sha1_testsuite,
+		cryptodev_testsuite,
+		end_testsuite
+	};
+	struct unit_test_suite ts = {
+		.suite_name = "SW Kasumi Unit Test Suite",
+		.setup = sw_kasumi_testsuite_setup,
+		.teardown = testsuite_teardown,
+		.parent_testsuite = true
+	};
+
 	gbl_driver_id = rte_cryptodev_driver_id_get(
 			RTE_STR(CRYPTODEV_NAME_KASUMI_PMD));
 
@@ -14162,12 +14630,46 @@ test_cryptodev_sw_kasumi(void /*argv __rte_unused, int argc __rte_unused*/)
 		return TEST_SKIPPED;
 	}
 
-	return unit_test_suite_runner(&cryptodev_testsuite);
+	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
+			RTE_DIM(static_suites));
+
+	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
+	ret = unit_test_suite_runner(&ts);
+
+	free(ts.unit_test_suites);
+	return ret;
 }
 
 static int
 test_cryptodev_sw_zuc(void /*argv __rte_unused, int argc __rte_unused*/)
 {
+	uint8_t ret, j, i = 0;
+	struct unit_test_suite static_suites[] = {
+		cryptodev_multi_session_testsuite,
+		cryptodev_null_testsuite,
+		cryptodev_aes_ccm_auth_testsuite,
+		cryptodev_aes_gcm_auth_testsuite,
+		cryptodev_aes_gmac_auth_testsuite,
+		cryptodev_snow3g_testsuite,
+		cryptodev_chacha20_poly1305_testsuite,
+		cryptodev_zuc_testsuite,
+		cryptodev_hmac_md5_auth_testsuite,
+		cryptodev_kasumi_testsuite,
+		cryptodev_esn_testsuite,
+		cryptodev_negative_aes_gcm_testsuite,
+		cryptodev_negative_aes_gmac_testsuite,
+		cryptodev_mixed_cipher_hash_testsuite,
+		cryptodev_negative_hmac_sha1_testsuite,
+		cryptodev_testsuite,
+		end_testsuite
+	};
+	struct unit_test_suite ts = {
+		.suite_name = "SW ZUC Unit Test Suite",
+		.setup = sw_zuc_testsuite_setup,
+		.teardown = testsuite_teardown,
+		.parent_testsuite = true
+	};
+
 	gbl_driver_id = rte_cryptodev_driver_id_get(
 			RTE_STR(CRYPTODEV_NAME_ZUC_PMD));
 
@@ -14176,12 +14678,46 @@ test_cryptodev_sw_zuc(void /*argv __rte_unused, int argc __rte_unused*/)
 		return TEST_SKIPPED;
 	}
 
-	return unit_test_suite_runner(&cryptodev_testsuite);
+	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
+			RTE_DIM(static_suites));
+
+	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
+	ret = unit_test_suite_runner(&ts);
+
+	free(ts.unit_test_suites);
+	return ret;
 }
 
 static int
 test_cryptodev_armv8(void)
 {
+	uint8_t ret, j, i = 0;
+	struct unit_test_suite static_suites[] = {
+		cryptodev_multi_session_testsuite,
+		cryptodev_null_testsuite,
+		cryptodev_aes_ccm_auth_testsuite,
+		cryptodev_aes_gcm_auth_testsuite,
+		cryptodev_aes_gmac_auth_testsuite,
+		cryptodev_snow3g_testsuite,
+		cryptodev_chacha20_poly1305_testsuite,
+		cryptodev_zuc_testsuite,
+		cryptodev_hmac_md5_auth_testsuite,
+		cryptodev_kasumi_testsuite,
+		cryptodev_esn_testsuite,
+		cryptodev_negative_aes_gcm_testsuite,
+		cryptodev_negative_aes_gmac_testsuite,
+		cryptodev_mixed_cipher_hash_testsuite,
+		cryptodev_negative_hmac_sha1_testsuite,
+		cryptodev_testsuite,
+		end_testsuite
+	};
+	struct unit_test_suite ts = {
+		.suite_name = "Armv8 Unit Test Suite",
+		.setup = armv8_testsuite_setup,
+		.teardown = testsuite_teardown,
+		.parent_testsuite = true
+	};
+
 	gbl_driver_id = rte_cryptodev_driver_id_get(
 			RTE_STR(CRYPTODEV_NAME_ARMV8_PMD));
 
@@ -14190,12 +14726,47 @@ test_cryptodev_armv8(void)
 		return TEST_SKIPPED;
 	}
 
-	return unit_test_suite_runner(&cryptodev_testsuite);
+	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
+			RTE_DIM(static_suites));
+
+	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
+	ret = unit_test_suite_runner(&ts);
+
+	free(ts.unit_test_suites);
+	return ret;
 }
 
 static int
 test_cryptodev_mrvl(void)
 {
+	uint8_t ret, j, i = 0;
+	const struct unit_test_suite static_suites[] = {
+		cryptodev_multi_session_testsuite,
+		cryptodev_null_testsuite,
+		cryptodev_aes_ccm_auth_testsuite,
+		cryptodev_aes_gcm_auth_testsuite,
+		cryptodev_aes_gmac_auth_testsuite,
+		cryptodev_snow3g_testsuite,
+		cryptodev_chacha20_poly1305_testsuite,
+		cryptodev_zuc_testsuite,
+		cryptodev_hmac_md5_auth_testsuite,
+		cryptodev_kasumi_testsuite,
+		cryptodev_esn_testsuite,
+		cryptodev_negative_aes_gcm_testsuite,
+		cryptodev_negative_aes_gmac_testsuite,
+		cryptodev_mixed_cipher_hash_testsuite,
+		cryptodev_negative_hmac_sha1_testsuite,
+		cryptodev_testsuite,
+		cryptodev_mrvl_sub_testsuite,
+		end_testsuite
+	};
+	struct unit_test_suite ts = {
+		.suite_name = "Crypto Device Marvell Component Test Suite",
+		.setup = mrvl_testsuite_setup,
+		.teardown = testsuite_teardown,
+		.parent_testsuite = true
+	};
+
 	gbl_driver_id = rte_cryptodev_driver_id_get(
 			RTE_STR(CRYPTODEV_NAME_MVSAM_PMD));
 
@@ -14204,7 +14775,14 @@ test_cryptodev_mrvl(void)
 		return TEST_SKIPPED;
 	}
 
-	return unit_test_suite_runner(&cryptodev_mrvl_testsuite);
+	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
+			RTE_DIM(static_suites));
+
+	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
+	ret = unit_test_suite_runner(&ts);
+
+	free(ts.unit_test_suites);
+	return ret;
 }
 
 #ifdef RTE_CRYPTO_SCHEDULER
@@ -14212,6 +14790,89 @@ test_cryptodev_mrvl(void)
 static int
 test_cryptodev_scheduler(void /*argv __rte_unused, int argc __rte_unused*/)
 {
+	uint8_t ret, j, i = 0;
+	struct unit_test_suite sched_mode_suites[] = {
+		{
+			.suite_name = "Scheduler Multicore Unit Test Suite",
+			.setup = scheduler_multicore_testsuite_setup,
+			.teardown = scheduler_mode_testsuite_teardown,
+			.unit_test_cases = ((struct unit_test_case []) {
+				TEST_CASE_ST(ut_setup, ut_teardown,
+						test_AES_chain_all),
+				TEST_CASE_ST(ut_setup, ut_teardown,
+						test_AES_cipheronly_all),
+				TEST_CASE_ST(ut_setup, ut_teardown,
+						test_authonly_all),
+				TEST_CASES_END()
+			})
+		},
+		{
+			.suite_name = "Scheduler Round Robin Unit Test Suite",
+			.setup = scheduler_roundrobin_testsuite_setup,
+			.teardown = scheduler_mode_testsuite_teardown,
+			.unit_test_cases = ((struct unit_test_case []) {
+				TEST_CASE_ST(ut_setup, ut_teardown,
+						test_AES_chain_all),
+				TEST_CASE_ST(ut_setup, ut_teardown,
+						test_AES_cipheronly_all),
+				TEST_CASE_ST(ut_setup, ut_teardown,
+						test_authonly_all),
+				TEST_CASES_END()
+			})
+		},
+		{
+			.suite_name = "Scheduler Failover Unit Test Suite",
+			.setup = scheduler_failover_testsuite_setup,
+			.teardown = scheduler_mode_testsuite_teardown,
+			.unit_test_cases = ((struct unit_test_case []) {
+				TEST_CASE_ST(ut_setup, ut_teardown,
+						test_AES_chain_all),
+				TEST_CASE_ST(ut_setup, ut_teardown,
+						test_AES_cipheronly_all),
+				TEST_CASE_ST(ut_setup, ut_teardown,
+						test_authonly_all),
+				TEST_CASES_END()
+			})
+		},
+		{
+			.suite_name = "Scheduler Pkt Size Distr Unit Test Suite",
+			.setup = scheduler_pkt_size_distr_testsuite_setup,
+			.teardown = scheduler_mode_testsuite_teardown,
+			.unit_test_cases = ((struct unit_test_case []) {
+				TEST_CASE_ST(ut_setup, ut_teardown,
+						test_AES_chain_all),
+				TEST_CASE_ST(ut_setup, ut_teardown,
+						test_AES_cipheronly_all),
+				TEST_CASE_ST(ut_setup, ut_teardown,
+						test_authonly_all),
+				TEST_CASES_END()
+			})
+		}
+	};
+	struct unit_test_suite static_suites[] = {
+		{
+			.suite_name = "Crypto Device Scheduler Config Unit Test Suite",
+			.parent_testsuite = false,
+			.unit_test_cases = ((struct unit_test_case []) {
+				TEST_CASE(test_scheduler_attach_slave_op),
+				TEST_CASE(test_scheduler_mode_multicore_op),
+				TEST_CASE(test_scheduler_mode_roundrobin_op),
+				TEST_CASE(test_scheduler_mode_failover_op),
+				TEST_CASE(test_scheduler_mode_pkt_size_distr_op),
+				TEST_CASE(test_scheduler_detach_slave_op),
+
+				TEST_CASES_END() /**< NULL terminate array */
+			})
+		},
+		end_testsuite
+	};
+	struct unit_test_suite ts = {
+		.suite_name = "Scheduler Unit Test Suite",
+		.setup = scheduler_testsuite_setup,
+		.teardown = testsuite_teardown,
+		.parent_testsuite = true
+	};
+
 	gbl_driver_id =	rte_cryptodev_driver_id_get(
 			RTE_STR(CRYPTODEV_NAME_SCHEDULER_PMD));
 
@@ -14224,8 +14885,17 @@ test_cryptodev_scheduler(void /*argv __rte_unused, int argc __rte_unused*/)
 				RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD)) == -1) {
 		RTE_LOG(ERR, USER1, "AESNI MB PMD must be loaded.\n");
 		return TEST_SKIPPED;
-}
-	return unit_test_suite_runner(&cryptodev_scheduler_testsuite);
+	}
+
+	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
+			(RTE_DIM(static_suites) + RTE_DIM(sched_mode_suites)));
+	ADD_STATIC_TESTSUITE(i, ts, sched_mode_suites,
+			RTE_DIM(sched_mode_suites));
+	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
+	ret = unit_test_suite_runner(&ts);
+
+	free(ts.unit_test_suites);
+	return ret;
 }
 
 REGISTER_TEST_COMMAND(cryptodev_scheduler_autotest, test_cryptodev_scheduler);
@@ -14235,6 +14905,33 @@ REGISTER_TEST_COMMAND(cryptodev_scheduler_autotest, test_cryptodev_scheduler);
 static int
 test_cryptodev_dpaa2_sec(void /*argv __rte_unused, int argc __rte_unused*/)
 {
+	uint8_t ret, j, i = 0;
+	struct unit_test_suite static_suites[] = {
+		cryptodev_multi_session_testsuite,
+		cryptodev_null_testsuite,
+		cryptodev_aes_ccm_auth_testsuite,
+		cryptodev_aes_gcm_auth_testsuite,
+		cryptodev_aes_gmac_auth_testsuite,
+		cryptodev_chacha20_poly1305_testsuite,
+		cryptodev_snow3g_testsuite,
+		cryptodev_zuc_testsuite,
+		cryptodev_hmac_md5_auth_testsuite,
+		cryptodev_kasumi_testsuite,
+		cryptodev_esn_testsuite,
+		cryptodev_negative_aes_gcm_testsuite,
+		cryptodev_negative_aes_gmac_testsuite,
+		cryptodev_mixed_cipher_hash_testsuite,
+		cryptodev_negative_hmac_sha1_testsuite,
+		cryptodev_testsuite,
+		end_testsuite
+	};
+	struct unit_test_suite ts = {
+		.suite_name = "DPAA2 Sec Test Suite",
+		.setup = dpaa2_sec_testsuite_setup,
+		.teardown = testsuite_teardown,
+		.parent_testsuite = true
+	};
+
 	gbl_driver_id =	rte_cryptodev_driver_id_get(
 			RTE_STR(CRYPTODEV_NAME_DPAA2_SEC_PMD));
 
@@ -14243,12 +14940,46 @@ test_cryptodev_dpaa2_sec(void /*argv __rte_unused, int argc __rte_unused*/)
 		return TEST_SKIPPED;
 	}
 
-	return unit_test_suite_runner(&cryptodev_testsuite);
+	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
+			RTE_DIM(static_suites));
+
+	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
+	ret = unit_test_suite_runner(&ts);
+
+	free(ts.unit_test_suites);
+	return ret;
 }
 
 static int
 test_cryptodev_dpaa_sec(void /*argv __rte_unused, int argc __rte_unused*/)
 {
+	uint8_t ret, j, i = 0;
+	struct unit_test_suite static_suites[] = {
+		cryptodev_multi_session_testsuite,
+		cryptodev_null_testsuite,
+		cryptodev_aes_ccm_auth_testsuite,
+		cryptodev_aes_gcm_auth_testsuite,
+		cryptodev_aes_gmac_auth_testsuite,
+		cryptodev_snow3g_testsuite,
+		cryptodev_chacha20_poly1305_testsuite,
+		cryptodev_zuc_testsuite,
+		cryptodev_hmac_md5_auth_testsuite,
+		cryptodev_kasumi_testsuite,
+		cryptodev_esn_testsuite,
+		cryptodev_negative_aes_gcm_testsuite,
+		cryptodev_negative_aes_gmac_testsuite,
+		cryptodev_mixed_cipher_hash_testsuite,
+		cryptodev_negative_hmac_sha1_testsuite,
+		cryptodev_testsuite,
+		end_testsuite
+	};
+	struct unit_test_suite ts = {
+		.suite_name = "DPAA Sec Test Suite",
+		.setup = dpaa_sec_testsuite_setup,
+		.teardown = testsuite_teardown,
+		.parent_testsuite = true
+	};
+
 	gbl_driver_id =	rte_cryptodev_driver_id_get(
 			RTE_STR(CRYPTODEV_NAME_DPAA_SEC_PMD));
 
@@ -14257,12 +14988,33 @@ test_cryptodev_dpaa_sec(void /*argv __rte_unused, int argc __rte_unused*/)
 		return TEST_SKIPPED;
 	}
 
-	return unit_test_suite_runner(&cryptodev_testsuite);
+	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
+			RTE_DIM(static_suites));
+
+	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
+	ret = unit_test_suite_runner(&ts);
+
+	free(ts.unit_test_suites);
+	return ret;
 }
 
 static int
 test_cryptodev_ccp(void)
 {
+	uint8_t ret, j, i = 0;
+	struct unit_test_suite static_suites[] = {
+		cryptodev_multi_session_testsuite,
+		cryptodev_negative_hmac_sha1_testsuite,
+		cryptodev_ccp_sub_testsuite,
+		end_testsuite
+	};
+	struct unit_test_suite ts = {
+		.suite_name = "Crypto Device CCP Unit Test Suite",
+		.setup = ccp_testsuite_setup,
+		.teardown = testsuite_teardown,
+		.parent_testsuite = true
+	};
+
 	gbl_driver_id = rte_cryptodev_driver_id_get(
 			RTE_STR(CRYPTODEV_NAME_CCP_PMD));
 
@@ -14271,36 +15023,127 @@ test_cryptodev_ccp(void)
 		return TEST_FAILED;
 	}
 
-	return unit_test_suite_runner(&cryptodev_ccp_testsuite);
+	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
+			RTE_DIM(static_suites));
+
+	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
+	ret = unit_test_suite_runner(&ts);
+
+	free(ts.unit_test_suites);
+	return ret;
 }
 
 static int
 test_cryptodev_octeontx(void)
 {
+	uint8_t ret, j, i = 0;
+	struct unit_test_suite static_suites[] = {
+		cryptodev_multi_session_testsuite,
+		cryptodev_null_testsuite,
+		cryptodev_aes_ccm_auth_testsuite,
+		cryptodev_aes_gcm_auth_testsuite,
+		cryptodev_aes_gmac_auth_testsuite,
+		cryptodev_chacha20_poly1305_testsuite,
+		cryptodev_snow3g_testsuite,
+		cryptodev_zuc_testsuite,
+		cryptodev_hmac_md5_auth_testsuite,
+		cryptodev_kasumi_testsuite,
+		cryptodev_esn_testsuite,
+		cryptodev_negative_aes_gcm_testsuite,
+		cryptodev_negative_aes_gmac_testsuite,
+		cryptodev_mixed_cipher_hash_testsuite,
+		cryptodev_negative_hmac_sha1_testsuite,
+		cryptodev_testsuite,
+		end_testsuite
+	};
+	struct unit_test_suite ts = {
+		.suite_name = "OcteonTX Unit Test Suite",
+		.setup = octeontx_testsuite_setup,
+		.teardown = testsuite_teardown,
+		.parent_testsuite = true
+	};
+
 	gbl_driver_id =	rte_cryptodev_driver_id_get(
 			RTE_STR(CRYPTODEV_NAME_OCTEONTX_SYM_PMD));
+
 	if (gbl_driver_id == -1) {
 		RTE_LOG(ERR, USER1, "OCTEONTX PMD must be loaded.\n");
 		return TEST_FAILED;
 	}
-	return unit_test_suite_runner(&cryptodev_testsuite);
+
+	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
+			RTE_DIM(static_suites));
+
+	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
+	ret = unit_test_suite_runner(&ts);
+
+	free(ts.unit_test_suites);
+	return ret;
 }
 
 static int
 test_cryptodev_octeontx2(void)
 {
+	uint8_t ret, j, i = 0;
+	struct unit_test_suite static_suites[] = {
+		cryptodev_multi_session_testsuite,
+		cryptodev_null_testsuite,
+		cryptodev_aes_ccm_auth_testsuite,
+		cryptodev_aes_gcm_auth_testsuite,
+		cryptodev_aes_gmac_auth_testsuite,
+		cryptodev_snow3g_testsuite,
+		cryptodev_chacha20_poly1305_testsuite,
+		cryptodev_zuc_testsuite,
+		cryptodev_hmac_md5_auth_testsuite,
+		cryptodev_kasumi_testsuite,
+		cryptodev_esn_testsuite,
+		cryptodev_negative_aes_gcm_testsuite,
+		cryptodev_negative_aes_gmac_testsuite,
+		cryptodev_mixed_cipher_hash_testsuite,
+		cryptodev_negative_hmac_sha1_testsuite,
+		cryptodev_testsuite,
+		end_testsuite
+	};
+	struct unit_test_suite ts = {
+		.suite_name = "OcteonTX2 Unit Test Suite",
+		.setup = octeontx2_testsuite_setup,
+		.teardown = testsuite_teardown,
+		.parent_testsuite = true
+	};
+
 	gbl_driver_id =	rte_cryptodev_driver_id_get(
 			RTE_STR(CRYPTODEV_NAME_OCTEONTX2_PMD));
+
 	if (gbl_driver_id == -1) {
 		RTE_LOG(ERR, USER1, "OCTEON TX2 PMD must be loaded.\n");
 		return TEST_FAILED;
 	}
-	return unit_test_suite_runner(&cryptodev_testsuite);
+
+	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
+			RTE_DIM(static_suites));
+
+	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
+	ret = unit_test_suite_runner(&ts);
+
+	free(ts.unit_test_suites);
+	return ret;
 }
 
 static int
 test_cryptodev_caam_jr(void /*argv __rte_unused, int argc __rte_unused*/)
 {
+	uint8_t ret, j, i = 0;
+	struct unit_test_suite static_suites[] = {
+		cryptodev_caam_jr_sub_testsuite,
+		end_testsuite
+	};
+	struct unit_test_suite ts = {
+		.suite_name = "Crypto CAAM JR Unit Test Suite",
+		.setup = caam_jr_testsuite_setup,
+		.teardown = testsuite_teardown,
+		.parent_testsuite = true
+	};
+
 	gbl_driver_id =	rte_cryptodev_driver_id_get(
 			RTE_STR(CRYPTODEV_NAME_CAAM_JR_PMD));
 
@@ -14309,12 +15152,46 @@ test_cryptodev_caam_jr(void /*argv __rte_unused, int argc __rte_unused*/)
 		return TEST_FAILED;
 	}
 
-	return unit_test_suite_runner(&cryptodev_caam_jr_testsuite);
+	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
+			RTE_DIM(static_suites));
+
+	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
+	ret = unit_test_suite_runner(&ts);
+
+	free(ts.unit_test_suites);
+	return ret;
 }
 
 static int
 test_cryptodev_nitrox(void)
 {
+	uint8_t ret, j, i = 0;
+	struct unit_test_suite static_suites[] = {
+		cryptodev_multi_session_testsuite,
+		cryptodev_null_testsuite,
+		cryptodev_aes_ccm_auth_testsuite,
+		cryptodev_aes_gcm_auth_testsuite,
+		cryptodev_aes_gmac_auth_testsuite,
+		cryptodev_snow3g_testsuite,
+		cryptodev_chacha20_poly1305_testsuite,
+		cryptodev_zuc_testsuite,
+		cryptodev_hmac_md5_auth_testsuite,
+		cryptodev_kasumi_testsuite,
+		cryptodev_esn_testsuite,
+		cryptodev_negative_aes_gcm_testsuite,
+		cryptodev_negative_aes_gmac_testsuite,
+		cryptodev_mixed_cipher_hash_testsuite,
+		cryptodev_negative_hmac_sha1_testsuite,
+		cryptodev_testsuite,
+		end_testsuite
+	};
+	struct unit_test_suite ts = {
+		.suite_name = "Nitrox Unit Test Suite",
+		.setup = nitrox_testsuite_setup,
+		.teardown = testsuite_teardown,
+		.parent_testsuite = true
+	};
+
 	gbl_driver_id =	rte_cryptodev_driver_id_get(
 			RTE_STR(CRYPTODEV_NAME_NITROX_PMD));
 
@@ -14323,12 +15200,46 @@ test_cryptodev_nitrox(void)
 		return TEST_FAILED;
 	}
 
-	return unit_test_suite_runner(&cryptodev_testsuite);
+	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
+			RTE_DIM(static_suites));
+
+	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
+	ret = unit_test_suite_runner(&ts);
+
+	free(ts.unit_test_suites);
+	return ret;
 }
 
 static int
 test_cryptodev_bcmfs(void)
 {
+	uint8_t ret, j, i = 0;
+	struct unit_test_suite static_suites[] = {
+		cryptodev_multi_session_testsuite,
+		cryptodev_null_testsuite,
+		cryptodev_aes_ccm_auth_testsuite,
+		cryptodev_aes_gcm_auth_testsuite,
+		cryptodev_aes_gmac_auth_testsuite,
+		cryptodev_snow3g_testsuite,
+		cryptodev_chacha20_poly1305_testsuite,
+		cryptodev_zuc_testsuite,
+		cryptodev_hmac_md5_auth_testsuite,
+		cryptodev_kasumi_testsuite,
+		cryptodev_esn_testsuite,
+		cryptodev_negative_aes_gcm_testsuite,
+		cryptodev_negative_aes_gmac_testsuite,
+		cryptodev_mixed_cipher_hash_testsuite,
+		cryptodev_negative_hmac_sha1_testsuite,
+		cryptodev_testsuite,
+		end_testsuite
+	};
+	struct unit_test_suite ts = {
+		.suite_name = "BCMFS Unit Test Suite",
+		.setup = bcmfs_testsuite_setup,
+		.teardown = testsuite_teardown,
+		.parent_testsuite = true
+	};
+
 	gbl_driver_id =	rte_cryptodev_driver_id_get(
 			RTE_STR(CRYPTODEV_NAME_BCMFS_PMD));
 
@@ -14337,13 +15248,46 @@ test_cryptodev_bcmfs(void)
 		return TEST_FAILED;
 	}
 
-	return unit_test_suite_runner(&cryptodev_testsuite);
+	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
+			RTE_DIM(static_suites));
+
+	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
+	ret = unit_test_suite_runner(&ts);
+
+	free(ts.unit_test_suites);
+	return ret;
 }
 
 static int
 test_cryptodev_qat_raw_api(void /*argv __rte_unused, int argc __rte_unused*/)
 {
 	int ret;
+	uint8_t j, i = 0;
+	struct unit_test_suite static_suites[] = {
+		cryptodev_multi_session_testsuite,
+		cryptodev_null_testsuite,
+		cryptodev_aes_ccm_auth_testsuite,
+		cryptodev_aes_gcm_auth_testsuite,
+		cryptodev_aes_gmac_auth_testsuite,
+		cryptodev_snow3g_testsuite,
+		cryptodev_chacha20_poly1305_testsuite,
+		cryptodev_zuc_testsuite,
+		cryptodev_hmac_md5_auth_testsuite,
+		cryptodev_kasumi_testsuite,
+		cryptodev_esn_testsuite,
+		cryptodev_negative_aes_gcm_testsuite,
+		cryptodev_negative_aes_gmac_testsuite,
+		cryptodev_mixed_cipher_hash_testsuite,
+		cryptodev_negative_hmac_sha1_testsuite,
+		cryptodev_testsuite,
+		end_testsuite
+	};
+	struct unit_test_suite ts = {
+		.suite_name = "QAT Raw Unit Test Suite",
+		.setup = qat_raw_testsuite_setup,
+		.teardown = testsuite_teardown,
+		.parent_testsuite = true
+	};
 
 	gbl_driver_id =	rte_cryptodev_driver_id_get(
 			RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD));
@@ -14353,8 +15297,13 @@ test_cryptodev_qat_raw_api(void /*argv __rte_unused, int argc __rte_unused*/)
 		return TEST_SKIPPED;
 	}
 
+	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
+			RTE_DIM(static_suites));
+
+	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
 	global_api_test_type = CRYPTODEV_RAW_API_TEST;
-	ret = unit_test_suite_runner(&cryptodev_testsuite);
+	ret = unit_test_suite_runner(&ts);
+	free(ts.unit_test_suites);
 	global_api_test_type = CRYPTODEV_API_TEST;
 
 	return ret;
-- 
2.25.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [dpdk-dev] [PATCH 4/6] test/crypto: move testsuite params to header file
  2021-03-16 14:32 [dpdk-dev] [PATCH 0/6] test: refactor crypto unit test framework Ciara Power
                   ` (2 preceding siblings ...)
  2021-03-16 14:32 ` [dpdk-dev] [PATCH 3/6] test/crypto: refactor to use sub-testsuites Ciara Power
@ 2021-03-16 14:32 ` Ciara Power
  2021-03-16 14:32 ` [dpdk-dev] [PATCH 5/6] test/crypto: dynamically build blockcipher suite Ciara Power
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Ciara Power @ 2021-03-16 14:32 UTC (permalink / raw)
  To: dev
  Cc: declan.doherty, Ciara Power, Konstantin Ananyev,
	Bernard Iremonger, Vladimir Medvedkin

The testsuite params struct and ut functions are now in the cryptodev
test header file. This will allow them be used outside of the
cryptodev_test.c file. They will be used in a subsequent patch by the
blockcipher test.

As a result of this change, slight renaming changes were necessary
for ipsec and asym tests, to avoid a clash in names.

Signed-off-by: Ciara Power <ciara.power@intel.com>
---
 app/test/test_cryptodev.c      | 18 ++-----
 app/test/test_cryptodev.h      | 20 ++++++++
 app/test/test_cryptodev_asym.c | 93 ++++++++++++++++++----------------
 app/test/test_ipsec.c          | 32 ++++++------
 4 files changed, 89 insertions(+), 74 deletions(-)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 638b3845d4..6cfd866f2f 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -72,19 +72,6 @@ static enum rte_security_session_action_type gbl_action_type =
 
 enum cryptodev_api_test_type global_api_test_type = CRYPTODEV_API_TEST;
 
-struct crypto_testsuite_params {
-	struct rte_mempool *mbuf_pool;
-	struct rte_mempool *large_mbuf_pool;
-	struct rte_mempool *op_mpool;
-	struct rte_mempool *session_mpool;
-	struct rte_mempool *session_priv_mpool;
-	struct rte_cryptodev_config conf;
-	struct rte_cryptodev_qp_conf qp_conf;
-
-	uint8_t valid_devs[RTE_CRYPTO_MAX_DEVS];
-	uint8_t valid_dev_count;
-};
-
 struct crypto_unittest_params {
 	struct rte_crypto_sym_xform cipher_xform;
 	struct rte_crypto_sym_xform auth_xform;
@@ -492,6 +479,7 @@ process_crypto_request(uint8_t dev_id, struct rte_crypto_op *op)
 }
 
 static struct crypto_testsuite_params testsuite_params = { NULL };
+struct crypto_testsuite_params *p_testsuite_params = &testsuite_params;
 static struct crypto_unittest_params unittest_params;
 
 static int
@@ -922,7 +910,7 @@ dev_configure_and_start(uint64_t ff_disable)
 	return TEST_SUCCESS;
 }
 
-static int
+int
 ut_setup(void)
 {
 	/* Configure and start the device with security feature disabled */
@@ -936,7 +924,7 @@ ut_setup_security(void)
 	return dev_configure_and_start(0);
 }
 
-static void
+void
 ut_teardown(void)
 {
 	struct crypto_testsuite_params *ts_params = &testsuite_params;
diff --git a/app/test/test_cryptodev.h b/app/test/test_cryptodev.h
index bf4f6c8d62..5b97f716a0 100644
--- a/app/test/test_cryptodev.h
+++ b/app/test/test_cryptodev.h
@@ -79,6 +79,20 @@ enum cryptodev_api_test_type {
 
 extern enum cryptodev_api_test_type global_api_test_type;
 
+extern struct crypto_testsuite_params *p_testsuite_params;
+struct crypto_testsuite_params {
+	struct rte_mempool *mbuf_pool;
+	struct rte_mempool *large_mbuf_pool;
+	struct rte_mempool *op_mpool;
+	struct rte_mempool *session_mpool;
+	struct rte_mempool *session_priv_mpool;
+	struct rte_cryptodev_config conf;
+	struct rte_cryptodev_qp_conf qp_conf;
+
+	uint8_t valid_devs[RTE_CRYPTO_MAX_DEVS];
+	uint8_t valid_dev_count;
+};
+
 /**
  * Write (spread) data from buffer to mbuf data
  *
@@ -222,4 +236,10 @@ process_sym_raw_dp_op(uint8_t dev_id, uint16_t qp_id,
 		struct rte_crypto_op *op, uint8_t is_cipher, uint8_t is_auth,
 		uint8_t len_in_bits, uint8_t cipher_iv_len);
 
+int
+ut_setup(void);
+
+void
+ut_teardown(void);
+
 #endif /* TEST_CRYPTODEV_H_ */
diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c
index 4a2c0a310f..e0133f31cb 100644
--- a/app/test/test_cryptodev_asym.c
+++ b/app/test/test_cryptodev_asym.c
@@ -35,7 +35,7 @@
 #define TEST_VECTOR_SIZE 256
 
 static int gbl_driver_id;
-struct crypto_testsuite_params {
+struct crypto_testsuite_params_asym {
 	struct rte_mempool *op_mpool;
 	struct rte_mempool *session_mpool;
 	struct rte_cryptodev_config conf;
@@ -63,12 +63,12 @@ static struct test_cases_array test_vector = {0, { NULL } };
 
 static uint32_t test_index;
 
-static struct crypto_testsuite_params testsuite_params = { NULL };
+static struct crypto_testsuite_params_asym testsuite_params = { NULL };
 
 static int
 queue_ops_rsa_sign_verify(struct rte_cryptodev_asym_session *sess)
 {
-	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
 	struct rte_mempool *op_mpool = ts_params->op_mpool;
 	uint8_t dev_id = ts_params->valid_devs[0];
 	struct rte_crypto_op *op, *result_op;
@@ -159,7 +159,7 @@ queue_ops_rsa_sign_verify(struct rte_cryptodev_asym_session *sess)
 static int
 queue_ops_rsa_enc_dec(struct rte_cryptodev_asym_session *sess)
 {
-	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
 	struct rte_mempool *op_mpool = ts_params->op_mpool;
 	uint8_t dev_id = ts_params->valid_devs[0];
 	struct rte_crypto_op *op, *result_op;
@@ -300,7 +300,7 @@ test_cryptodev_asym_ver(struct rte_crypto_op *op,
 }
 
 static int
-test_cryptodev_asym_op(struct crypto_testsuite_params *ts_params,
+test_cryptodev_asym_op(struct crypto_testsuite_params_asym *ts_params,
 	union test_case_structure *data_tc,
 	char *test_msg, int sessionless, enum rte_crypto_asym_op_type type,
 	enum rte_crypto_rsa_priv_key_type key_type)
@@ -617,7 +617,7 @@ static int
 test_one_by_one(void)
 {
 	int status = TEST_SUCCESS;
-	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
 	uint32_t i = 0;
 	uint8_t dev_id = ts_params->valid_devs[0];
 	struct rte_cryptodev_info dev_info;
@@ -650,7 +650,7 @@ test_one_by_one(void)
 static int
 test_rsa_sign_verify(void)
 {
-	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
 	struct rte_mempool *sess_mpool = ts_params->session_mpool;
 	uint8_t dev_id = ts_params->valid_devs[0];
 	struct rte_cryptodev_asym_session *sess;
@@ -699,7 +699,7 @@ test_rsa_sign_verify(void)
 static int
 test_rsa_enc_dec(void)
 {
-	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
 	struct rte_mempool *sess_mpool = ts_params->session_mpool;
 	uint8_t dev_id = ts_params->valid_devs[0];
 	struct rte_cryptodev_asym_session *sess;
@@ -747,7 +747,7 @@ test_rsa_enc_dec(void)
 static int
 test_rsa_sign_verify_crt(void)
 {
-	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
 	struct rte_mempool *sess_mpool = ts_params->session_mpool;
 	uint8_t dev_id = ts_params->valid_devs[0];
 	struct rte_cryptodev_asym_session *sess;
@@ -795,7 +795,7 @@ test_rsa_sign_verify_crt(void)
 static int
 test_rsa_enc_dec_crt(void)
 {
-	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
 	struct rte_mempool *sess_mpool = ts_params->session_mpool;
 	uint8_t dev_id = ts_params->valid_devs[0];
 	struct rte_cryptodev_asym_session *sess;
@@ -842,7 +842,7 @@ test_rsa_enc_dec_crt(void)
 static int
 testsuite_setup(void)
 {
-	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
 	uint8_t valid_devs[RTE_CRYPTO_MAX_DEVS];
 	struct rte_cryptodev_info info;
 	int ret, dev_id = -1;
@@ -959,7 +959,7 @@ testsuite_setup(void)
 static void
 testsuite_teardown(void)
 {
-	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
 
 	if (ts_params->op_mpool != NULL) {
 		RTE_LOG(DEBUG, USER1, "CRYPTO_OP_POOL count %u\n",
@@ -974,9 +974,9 @@ testsuite_teardown(void)
 }
 
 static int
-ut_setup(void)
+ut_setup_asym(void)
 {
-	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
 
 	uint16_t qp_id;
 
@@ -1008,9 +1008,9 @@ ut_setup(void)
 }
 
 static void
-ut_teardown(void)
+ut_teardown_asym(void)
 {
-	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
 	struct rte_cryptodev_stats stats;
 
 	rte_cryptodev_stats_get(ts_params->valid_devs[0], &stats);
@@ -1056,7 +1056,7 @@ static inline void print_asym_capa(
 static int
 test_capability(void)
 {
-	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
 	uint8_t dev_id = ts_params->valid_devs[0];
 	struct rte_cryptodev_info dev_info;
 	const struct rte_cryptodev_capabilities *dev_capa;
@@ -1093,7 +1093,7 @@ test_capability(void)
 static int
 test_dh_gen_shared_sec(struct rte_crypto_asym_xform *xfrm)
 {
-	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
 	struct rte_mempool *op_mpool = ts_params->op_mpool;
 	struct rte_mempool *sess_mpool = ts_params->session_mpool;
 	uint8_t dev_id = ts_params->valid_devs[0];
@@ -1186,7 +1186,7 @@ test_dh_gen_shared_sec(struct rte_crypto_asym_xform *xfrm)
 static int
 test_dh_gen_priv_key(struct rte_crypto_asym_xform *xfrm)
 {
-	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
 	struct rte_mempool *op_mpool = ts_params->op_mpool;
 	struct rte_mempool *sess_mpool = ts_params->session_mpool;
 	uint8_t dev_id = ts_params->valid_devs[0];
@@ -1277,7 +1277,7 @@ test_dh_gen_priv_key(struct rte_crypto_asym_xform *xfrm)
 static int
 test_dh_gen_pub_key(struct rte_crypto_asym_xform *xfrm)
 {
-	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
 	struct rte_mempool *op_mpool = ts_params->op_mpool;
 	struct rte_mempool *sess_mpool = ts_params->session_mpool;
 	uint8_t dev_id = ts_params->valid_devs[0];
@@ -1376,7 +1376,7 @@ test_dh_gen_pub_key(struct rte_crypto_asym_xform *xfrm)
 static int
 test_dh_gen_kp(struct rte_crypto_asym_xform *xfrm)
 {
-	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
 	struct rte_mempool *op_mpool = ts_params->op_mpool;
 	struct rte_mempool *sess_mpool = ts_params->session_mpool;
 	uint8_t dev_id = ts_params->valid_devs[0];
@@ -1473,7 +1473,7 @@ test_dh_gen_kp(struct rte_crypto_asym_xform *xfrm)
 static int
 test_mod_inv(void)
 {
-	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
 	struct rte_mempool *op_mpool = ts_params->op_mpool;
 	struct rte_mempool *sess_mpool = ts_params->session_mpool;
 	uint8_t dev_id = ts_params->valid_devs[0];
@@ -1597,7 +1597,7 @@ test_mod_inv(void)
 static int
 test_mod_exp(void)
 {
-	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
 	struct rte_mempool *op_mpool = ts_params->op_mpool;
 	struct rte_mempool *sess_mpool = ts_params->session_mpool;
 	uint8_t dev_id = ts_params->valid_devs[0];
@@ -1757,7 +1757,7 @@ test_dh_keygenration(void)
 static int
 test_dsa_sign(void)
 {
-	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
 	struct rte_mempool *op_mpool = ts_params->op_mpool;
 	struct rte_mempool *sess_mpool = ts_params->session_mpool;
 	uint8_t dev_id = ts_params->valid_devs[0];
@@ -1901,7 +1901,7 @@ test_dsa(void)
 static int
 test_ecdsa_sign_verify(enum curve curve_id)
 {
-	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
 	struct rte_mempool *sess_mpool = ts_params->session_mpool;
 	struct rte_mempool *op_mpool = ts_params->op_mpool;
 	struct crypto_testsuite_ecdsa_params input_params;
@@ -2114,7 +2114,7 @@ test_ecdsa_sign_verify_all_curve(void)
 static int
 test_ecpm(enum curve curve_id)
 {
-	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	struct crypto_testsuite_params_asym *ts_params = &testsuite_params;
 	struct rte_mempool *sess_mpool = ts_params->session_mpool;
 	struct rte_mempool *op_mpool = ts_params->op_mpool;
 	struct crypto_testsuite_ecpm_params input_params;
@@ -2289,16 +2289,20 @@ static struct unit_test_suite cryptodev_openssl_asym_testsuite  = {
 	.setup = testsuite_setup,
 	.teardown = testsuite_teardown,
 	.unit_test_cases = ((struct unit_test_case []) {
-		TEST_CASE_ST(ut_setup, ut_teardown, test_capability),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_dsa),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_dh_keygenration),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_rsa_enc_dec),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_rsa_sign_verify),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_rsa_enc_dec_crt),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_rsa_sign_verify_crt),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_mod_inv),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_mod_exp),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_one_by_one),
+		TEST_CASE_ST(ut_setup_asym, ut_teardown_asym, test_capability),
+		TEST_CASE_ST(ut_setup_asym, ut_teardown_asym, test_dsa),
+		TEST_CASE_ST(ut_setup_asym, ut_teardown_asym,
+				test_dh_keygenration),
+		TEST_CASE_ST(ut_setup_asym, ut_teardown_asym, test_rsa_enc_dec),
+		TEST_CASE_ST(ut_setup_asym, ut_teardown_asym,
+				test_rsa_sign_verify),
+		TEST_CASE_ST(ut_setup_asym, ut_teardown_asym,
+				test_rsa_enc_dec_crt),
+		TEST_CASE_ST(ut_setup_asym, ut_teardown_asym,
+				test_rsa_sign_verify_crt),
+		TEST_CASE_ST(ut_setup_asym, ut_teardown_asym, test_mod_inv),
+		TEST_CASE_ST(ut_setup_asym, ut_teardown_asym, test_mod_exp),
+		TEST_CASE_ST(ut_setup_asym, ut_teardown_asym, test_one_by_one),
 		TEST_CASES_END() /**< NULL terminate unit test array */
 	})
 };
@@ -2308,7 +2312,7 @@ static struct unit_test_suite cryptodev_qat_asym_testsuite  = {
 	.setup = testsuite_setup,
 	.teardown = testsuite_teardown,
 	.unit_test_cases = ((struct unit_test_case []) {
-		TEST_CASE_ST(ut_setup, ut_teardown, test_one_by_one),
+		TEST_CASE_ST(ut_setup_asym, ut_teardown_asym, test_one_by_one),
 		TEST_CASES_END() /**< NULL terminate unit test array */
 	})
 };
@@ -2318,13 +2322,16 @@ static struct unit_test_suite cryptodev_octeontx_asym_testsuite  = {
 	.setup = testsuite_setup,
 	.teardown = testsuite_teardown,
 	.unit_test_cases = ((struct unit_test_case []) {
-		TEST_CASE_ST(ut_setup, ut_teardown, test_capability),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_rsa_enc_dec_crt),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_rsa_sign_verify_crt),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_mod_exp),
-		TEST_CASE_ST(ut_setup, ut_teardown,
+		TEST_CASE_ST(ut_setup_asym, ut_teardown_asym, test_capability),
+		TEST_CASE_ST(ut_setup_asym, ut_teardown_asym,
+				test_rsa_enc_dec_crt),
+		TEST_CASE_ST(ut_setup_asym, ut_teardown_asym,
+				test_rsa_sign_verify_crt),
+		TEST_CASE_ST(ut_setup_asym, ut_teardown_asym, test_mod_exp),
+		TEST_CASE_ST(ut_setup_asym, ut_teardown_asym,
 			     test_ecdsa_sign_verify_all_curve),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_ecpm_all_curve),
+		TEST_CASE_ST(ut_setup_asym, ut_teardown_asym,
+				test_ecpm_all_curve),
 		TEST_CASES_END() /**< NULL terminate unit test array */
 	})
 };
diff --git a/app/test/test_ipsec.c b/app/test/test_ipsec.c
index bd9fc3f999..d78f2c57fd 100644
--- a/app/test/test_ipsec.c
+++ b/app/test/test_ipsec.c
@@ -424,7 +424,7 @@ testsuite_teardown(void)
 }
 
 static int
-ut_setup(void)
+ut_setup_ipsec(void)
 {
 	struct ipsec_testsuite_params *ts_params = &testsuite_params;
 	struct ipsec_unitest_params *ut_params = &unittest_params;
@@ -444,7 +444,7 @@ ut_setup(void)
 }
 
 static void
-ut_teardown(void)
+ut_teardown_ipsec(void)
 {
 	struct ipsec_testsuite_params *ts_params = &testsuite_params;
 	struct ipsec_unitest_params *ut_params = &unittest_params;
@@ -2499,33 +2499,33 @@ static struct unit_test_suite ipsec_testsuite  = {
 	.setup = testsuite_setup,
 	.teardown = testsuite_teardown,
 	.unit_test_cases = ((struct unit_test_case []) {
-		TEST_CASE_ST(ut_setup, ut_teardown,
+		TEST_CASE_ST(ut_setup_ipsec, ut_teardown_ipsec,
 			test_ipsec_crypto_inb_burst_null_null_wrapper),
-		TEST_CASE_ST(ut_setup, ut_teardown,
+		TEST_CASE_ST(ut_setup_ipsec, ut_teardown_ipsec,
 			test_ipsec_crypto_outb_burst_null_null_wrapper),
-		TEST_CASE_ST(ut_setup, ut_teardown,
+		TEST_CASE_ST(ut_setup_ipsec, ut_teardown_ipsec,
 			test_ipsec_inline_crypto_inb_burst_null_null_wrapper),
-		TEST_CASE_ST(ut_setup, ut_teardown,
+		TEST_CASE_ST(ut_setup_ipsec, ut_teardown_ipsec,
 			test_ipsec_inline_crypto_outb_burst_null_null_wrapper),
-		TEST_CASE_ST(ut_setup, ut_teardown,
+		TEST_CASE_ST(ut_setup_ipsec, ut_teardown_ipsec,
 			test_ipsec_inline_proto_inb_burst_null_null_wrapper),
-		TEST_CASE_ST(ut_setup, ut_teardown,
+		TEST_CASE_ST(ut_setup_ipsec, ut_teardown_ipsec,
 			test_ipsec_inline_proto_outb_burst_null_null_wrapper),
-		TEST_CASE_ST(ut_setup, ut_teardown,
+		TEST_CASE_ST(ut_setup_ipsec, ut_teardown_ipsec,
 			test_ipsec_lksd_proto_inb_burst_null_null_wrapper),
-		TEST_CASE_ST(ut_setup, ut_teardown,
+		TEST_CASE_ST(ut_setup_ipsec, ut_teardown_ipsec,
 			test_ipsec_lksd_proto_outb_burst_null_null_wrapper),
-		TEST_CASE_ST(ut_setup, ut_teardown,
+		TEST_CASE_ST(ut_setup_ipsec, ut_teardown_ipsec,
 			test_ipsec_replay_inb_inside_null_null_wrapper),
-		TEST_CASE_ST(ut_setup, ut_teardown,
+		TEST_CASE_ST(ut_setup_ipsec, ut_teardown_ipsec,
 			test_ipsec_replay_inb_outside_null_null_wrapper),
-		TEST_CASE_ST(ut_setup, ut_teardown,
+		TEST_CASE_ST(ut_setup_ipsec, ut_teardown_ipsec,
 			test_ipsec_replay_inb_repeat_null_null_wrapper),
-		TEST_CASE_ST(ut_setup, ut_teardown,
+		TEST_CASE_ST(ut_setup_ipsec, ut_teardown_ipsec,
 			test_ipsec_replay_inb_inside_burst_null_null_wrapper),
-		TEST_CASE_ST(ut_setup, ut_teardown,
+		TEST_CASE_ST(ut_setup_ipsec, ut_teardown_ipsec,
 			test_ipsec_crypto_inb_burst_2sa_null_null_wrapper),
-		TEST_CASE_ST(ut_setup, ut_teardown,
+		TEST_CASE_ST(ut_setup_ipsec, ut_teardown_ipsec,
 			test_ipsec_crypto_inb_burst_2sa_4grp_null_null_wrapper),
 		TEST_CASES_END() /**< NULL terminate unit test array */
 	})
-- 
2.25.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [dpdk-dev] [PATCH 5/6] test/crypto: dynamically build blockcipher suite
  2021-03-16 14:32 [dpdk-dev] [PATCH 0/6] test: refactor crypto unit test framework Ciara Power
                   ` (3 preceding siblings ...)
  2021-03-16 14:32 ` [dpdk-dev] [PATCH 4/6] test/crypto: move testsuite params to header file Ciara Power
@ 2021-03-16 14:32 ` Ciara Power
  2021-03-16 14:32 ` [dpdk-dev] [PATCH 6/6] doc: add unit test suite change to release notes Ciara Power
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Ciara Power @ 2021-03-16 14:32 UTC (permalink / raw)
  To: dev; +Cc: declan.doherty, Ciara Power

In the existing implementation, the blockcipher test cases are being run
and reported as one test case per type, even though multiple test cases
are hidden in each. For example, "test_AES_chain_all" runs 46 test cases.
Each blockcipher type should have a testsuite instead.

The blockcipher testsuite is dynamically built, depending on the
blockcipher type chosen. The testcase struct is modified to allow
running a testcase with data, which is used for data required when
running each blockcipher testcase.

The blockcipher testsuites are added dynamically to parent testsuites
as sub-testsuites where needed.

Signed-off-by: Ciara Power <ciara.power@intel.com>
---
 app/test/test.c                       |  12 +-
 app/test/test.h                       |  16 +-
 app/test/test_cryptodev.c             | 511 +++++++++++++++-----------
 app/test/test_cryptodev_blockcipher.c | 121 +++---
 app/test/test_cryptodev_blockcipher.h |  12 +-
 5 files changed, 398 insertions(+), 274 deletions(-)

diff --git a/app/test/test.c b/app/test/test.c
index fe40a91f97..23ec3a529b 100644
--- a/app/test/test.c
+++ b/app/test/test.c
@@ -223,7 +223,7 @@ unit_test_suite_count_tcs_on_setup_fail(struct unit_test_suite *suite,
 				skipped, failed);
 	} else {
 		tc = suite->unit_test_cases[tc_count];
-		while (tc.testcase) {
+		while (tc.testcase || tc.testcase_with_data) {
 			if (!tc.enabled ||
 			test_success == TEST_SKIPPED)
 				(*skipped)++;
@@ -281,7 +281,7 @@ unit_test_suite_runner(struct unit_test_suite *suite)
 		}
 	} else {
 		tc = suite->unit_test_cases[total];
-		while (tc.testcase) {
+		while (tc.testcase || tc.testcase_with_data) {
 			if (!tc.enabled) {
 				skipped++;
 				total++;
@@ -299,7 +299,13 @@ unit_test_suite_runner(struct unit_test_suite *suite)
 
 			if (test_success == TEST_SUCCESS) {
 				/* run the test case */
-				test_success = tc.testcase();
+				if (tc.testcase)
+					test_success = tc.testcase();
+				else if (tc.testcase_with_data)
+					test_success = tc.testcase_with_data(tc.data);
+				else
+					test_success = -ENOTSUP;
+
 				if (test_success == TEST_SUCCESS)
 					succeeded++;
 				else if (test_success == TEST_SKIPPED)
diff --git a/app/test/test.h b/app/test/test.h
index 3fdac56631..d3b06f4557 100644
--- a/app/test/test.h
+++ b/app/test/test.h
@@ -108,24 +108,28 @@ struct unit_test_case {
 	int (*setup)(void);
 	void (*teardown)(void);
 	int (*testcase)(void);
+	int (*testcase_with_data)(const void *data);
 	const char *name;
 	unsigned enabled;
+	const void *data;
 };
 
-#define TEST_CASE(fn) { NULL, NULL, fn, #fn, 1 }
+#define TEST_CASE(fn) { NULL, NULL, fn, NULL, #fn, 1, NULL }
 
-#define TEST_CASE_NAMED(name, fn) { NULL, NULL, fn, name, 1 }
+#define TEST_CASE_NAMED(name, fn) { NULL, NULL, fn, NULL, name, 1, NULL }
 
 #define TEST_CASE_ST(setup, teardown, testcase) \
-		{ setup, teardown, testcase, #testcase, 1 }
+		{ setup, teardown, testcase, NULL, #testcase, 1, NULL }
 
+#define TEST_CASE_WITH_DATA(setup, teardown, testcase, data) \
+		{ setup, teardown, NULL, testcase, #testcase, 1, data }
 
-#define TEST_CASE_DISABLED(fn) { NULL, NULL, fn, #fn, 0 }
+#define TEST_CASE_DISABLED(fn) { NULL, NULL, fn, NULL, #fn, 0, NULL }
 
 #define TEST_CASE_ST_DISABLED(setup, teardown, testcase) \
-		{ setup, teardown, testcase, #testcase, 0 }
+		{ setup, teardown, testcase, NULL, #testcase, 0, NULL }
 
-#define TEST_CASES_END() { NULL, NULL, NULL, NULL, 0 }
+#define TEST_CASES_END() { NULL, NULL, NULL, NULL, NULL, 0, NULL }
 
 static inline void
 debug_hexdump(FILE *file, const char *title, const void *buf, size_t len)
diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 6cfd866f2f..6a9faf7ec3 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -103,6 +103,15 @@ struct crypto_unittest_params {
 	for (j = 0; j < num_child_ts; index++, j++)			\
 		parent_ts.unit_test_suites[index] = child_ts[j]		\
 
+#define ADD_BLOCKCIPHER_TESTSUITE(index, parent_ts, blk_types, num_blk_types)	\
+	for (j = 0; j < num_blk_types; index++, j++)				\
+		parent_ts.unit_test_suites[index] =				\
+				build_blockcipher_test_suite(blk_types[j])	\
+
+#define FREE_BLOCKCIPHER_TESTSUITE(index, parent_ts, num_blk_types)		\
+	for (j = index; j < index + num_blk_types; j++)				\
+		free_blockcipher_test_suite(&(parent_ts.unit_test_suites[j]))	\
+
 /*
  * Forward declarations.
  */
@@ -1921,80 +1930,6 @@ test_AES_CBC_HMAC_SHA512_decrypt_perform(struct rte_cryptodev_sym_session *sess,
 	return TEST_SUCCESS;
 }
 
-static int
-test_blockcipher(enum blockcipher_test_type test_type)
-{
-	struct crypto_testsuite_params *ts_params = &testsuite_params;
-	int status;
-
-	status = test_blockcipher_all_tests(ts_params->mbuf_pool,
-		ts_params->op_mpool,
-		ts_params->session_mpool, ts_params->session_priv_mpool,
-		ts_params->valid_devs[0],
-		test_type);
-
-	if (status == -ENOTSUP)
-		return status;
-
-	TEST_ASSERT_EQUAL(status, 0, "Test failed");
-
-	return TEST_SUCCESS;
-}
-
-static int
-test_AES_cipheronly_all(void)
-{
-	return test_blockcipher(BLKCIPHER_AES_CIPHERONLY_TYPE);
-}
-
-static int
-test_AES_docsis_all(void)
-{
-	/* Data-path service does not support DOCSIS yet */
-	if (global_api_test_type == CRYPTODEV_RAW_API_TEST)
-		return -ENOTSUP;
-	return test_blockcipher(BLKCIPHER_AES_DOCSIS_TYPE);
-}
-
-static int
-test_DES_docsis_all(void)
-{
-	/* Data-path service does not support DOCSIS yet */
-	if (global_api_test_type == CRYPTODEV_RAW_API_TEST)
-		return -ENOTSUP;
-	return test_blockcipher(BLKCIPHER_DES_DOCSIS_TYPE);
-}
-
-static int
-test_DES_cipheronly_all(void)
-{
-	return test_blockcipher(BLKCIPHER_DES_CIPHERONLY_TYPE);
-}
-
-static int
-test_authonly_all(void)
-{
-	return test_blockcipher(BLKCIPHER_AUTHONLY_TYPE);
-}
-
-static int
-test_AES_chain_all(void)
-{
-	return test_blockcipher(BLKCIPHER_AES_CHAIN_TYPE);
-}
-
-static int
-test_3DES_chain_all(void)
-{
-	return test_blockcipher(BLKCIPHER_3DES_CHAIN_TYPE);
-}
-
-static int
-test_3DES_cipheronly_all(void)
-{
-	return test_blockcipher(BLKCIPHER_3DES_CIPHERONLY_TYPE);
-}
-
 /* ***** SNOW 3G Tests ***** */
 static int
 create_wireless_algo_hash_session(uint8_t dev_id,
@@ -13364,14 +13299,6 @@ static const struct unit_test_suite cryptodev_testsuite  = {
 				test_queue_pair_descriptor_setup),
 		TEST_CASE_ST(ut_setup, ut_teardown,
 				test_device_configure_invalid_queue_pair_ids),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_chain_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_cipheronly_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_chain_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_cipheronly_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_DES_cipheronly_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_docsis_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_DES_docsis_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_authonly_all),
 		TEST_CASE_ST(ut_setup, ut_teardown, test_stats),
 #ifdef RTE_LIB_SECURITY
 		TEST_CASE_ST(ut_setup_security, ut_teardown,
@@ -14102,15 +14029,6 @@ static const struct unit_test_suite cryptodev_mixed_cipher_hash_testsuite  = {
 	})
 };
 
-static struct unit_test_suite cryptodev_virtio_sub_testsuite = {
-	.suite_name = "Crypto VIRTIO Unit Test Suite",
-	.unit_test_cases = ((struct unit_test_case []) {
-		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_cipheronly_all),
-
-		TEST_CASES_END() /**< NULL terminate unit test array */
-	})
-};
-
 static struct unit_test_suite cryptodev_caam_jr_sub_testsuite = {
 	.suite_name = "Crypto CAAM JR Sub Unit Test Suite",
 	.parent_testsuite = false,
@@ -14119,38 +14037,6 @@ static struct unit_test_suite cryptodev_caam_jr_sub_testsuite = {
 				test_device_configure_invalid_dev_id),
 		TEST_CASE_ST(ut_setup, ut_teardown, test_multi_session),
 
-		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_chain_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_chain_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_cipheronly_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_cipheronly_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_authonly_all),
-
-		TEST_CASES_END() /**< NULL terminate unit test array */
-	})
-};
-
-static struct unit_test_suite cryptodev_mrvl_sub_testsuite  = {
-	.suite_name = "Crypto Device Marvell Component Test Suite",
-	.unit_test_cases = ((struct unit_test_case []) {
-		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_chain_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_cipheronly_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_authonly_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_chain_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_cipheronly_all),
-
-		TEST_CASES_END() /**< NULL terminate unit test array */
-	})
-};
-
-static struct unit_test_suite cryptodev_ccp_sub_testsuite  = {
-	.suite_name = "Crypto Device CCP Unit Test Suite",
-	.unit_test_cases = ((struct unit_test_case []) {
-		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_chain_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_cipheronly_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_chain_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_cipheronly_all),
-		TEST_CASE_ST(ut_setup, ut_teardown, test_authonly_all),
-
 		TEST_CASES_END() /**< NULL terminate unit test array */
 	})
 };
@@ -14158,7 +14044,16 @@ static struct unit_test_suite cryptodev_ccp_sub_testsuite  = {
 static int
 test_cryptodev_qat(void /*argv __rte_unused, int argc __rte_unused*/)
 {
-	uint8_t ret, j, i = 0;
+	uint8_t ret, j, i = 0, blk_start_idx = 0;
+	const enum blockcipher_test_type blk_suites[] = {
+		BLKCIPHER_AES_CHAIN_TYPE,
+		BLKCIPHER_AES_CIPHERONLY_TYPE,
+		BLKCIPHER_AES_DOCSIS_TYPE,
+		BLKCIPHER_3DES_CHAIN_TYPE,
+		BLKCIPHER_3DES_CIPHERONLY_TYPE,
+		BLKCIPHER_DES_CIPHERONLY_TYPE,
+		BLKCIPHER_DES_DOCSIS_TYPE,
+		BLKCIPHER_AUTHONLY_TYPE};
 	struct unit_test_suite static_suites[] = {
 		cryptodev_multi_session_testsuite,
 		cryptodev_null_testsuite,
@@ -14193,11 +14088,13 @@ test_cryptodev_qat(void /*argv __rte_unused, int argc __rte_unused*/)
 		return TEST_SKIPPED;
 	}
 	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
-			RTE_DIM(static_suites));
+			(RTE_DIM(blk_suites) + RTE_DIM(static_suites)));
 
+	ADD_BLOCKCIPHER_TESTSUITE(i, ts, blk_suites, RTE_DIM(blk_suites));
 	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
 	ret = unit_test_suite_runner(&ts);
 
+	FREE_BLOCKCIPHER_TESTSUITE(blk_start_idx, ts, RTE_DIM(blk_suites));
 	free(ts.unit_test_suites);
 	return ret;
 }
@@ -14205,9 +14102,11 @@ test_cryptodev_qat(void /*argv __rte_unused, int argc __rte_unused*/)
 static int
 test_cryptodev_virtio(void /*argv __rte_unused, int argc __rte_unused*/)
 {
-	uint8_t ret, j, i = 0;
+	uint8_t ret, j, i = 0, blk_start_idx = 0;
+	const enum blockcipher_test_type blk_suites[] = {
+		BLKCIPHER_AES_CIPHERONLY_TYPE
+	};
 	struct unit_test_suite static_suites[] = {
-		cryptodev_virtio_sub_testsuite,
 		end_testsuite
 	};
 	struct unit_test_suite ts = {
@@ -14225,11 +14124,13 @@ test_cryptodev_virtio(void /*argv __rte_unused, int argc __rte_unused*/)
 		return TEST_FAILED;
 	}
 	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
-			RTE_DIM(static_suites));
+			(RTE_DIM(blk_suites) + RTE_DIM(static_suites)));
 
+	ADD_BLOCKCIPHER_TESTSUITE(i, ts, blk_suites, RTE_DIM(blk_suites));
 	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
 	ret = unit_test_suite_runner(&ts);
 
+	FREE_BLOCKCIPHER_TESTSUITE(blk_start_idx, ts, RTE_DIM(blk_suites));
 	free(ts.unit_test_suites);
 	return ret;
 }
@@ -14237,7 +14138,16 @@ test_cryptodev_virtio(void /*argv __rte_unused, int argc __rte_unused*/)
 static int
 test_cryptodev_aesni_mb(void /*argv __rte_unused, int argc __rte_unused*/)
 {
-	uint8_t ret, j, i = 0;
+	uint8_t ret, j, i = 0, blk_start_idx = 0;
+	const enum blockcipher_test_type blk_suites[] = {
+		BLKCIPHER_AES_CHAIN_TYPE,
+		BLKCIPHER_AES_CIPHERONLY_TYPE,
+		BLKCIPHER_AES_DOCSIS_TYPE,
+		BLKCIPHER_3DES_CHAIN_TYPE,
+		BLKCIPHER_3DES_CIPHERONLY_TYPE,
+		BLKCIPHER_DES_CIPHERONLY_TYPE,
+		BLKCIPHER_DES_DOCSIS_TYPE,
+		BLKCIPHER_AUTHONLY_TYPE};
 	struct unit_test_suite static_suites[] = {
 		cryptodev_multi_session_testsuite,
 		cryptodev_null_testsuite,
@@ -14273,11 +14183,13 @@ test_cryptodev_aesni_mb(void /*argv __rte_unused, int argc __rte_unused*/)
 	}
 
 	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
-			RTE_DIM(static_suites));
+			(RTE_DIM(blk_suites) + RTE_DIM(static_suites)));
 
+	ADD_BLOCKCIPHER_TESTSUITE(i, ts, blk_suites, RTE_DIM(blk_suites));
 	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
 	ret = unit_test_suite_runner(&ts);
 
+	FREE_BLOCKCIPHER_TESTSUITE(blk_start_idx, ts, RTE_DIM(blk_suites));
 	free(ts.unit_test_suites);
 	return ret;
 }
@@ -14286,8 +14198,17 @@ static int
 test_cryptodev_cpu_aesni_mb(void)
 {
 	int32_t rc;
-	uint8_t j, i = 0;
+	uint8_t j, i = 0, blk_start_idx = 0;
 	enum rte_security_session_action_type at;
+	const enum blockcipher_test_type blk_suites[] = {
+		BLKCIPHER_AES_CHAIN_TYPE,
+		BLKCIPHER_AES_CIPHERONLY_TYPE,
+		BLKCIPHER_AES_DOCSIS_TYPE,
+		BLKCIPHER_3DES_CHAIN_TYPE,
+		BLKCIPHER_3DES_CIPHERONLY_TYPE,
+		BLKCIPHER_DES_CIPHERONLY_TYPE,
+		BLKCIPHER_DES_DOCSIS_TYPE,
+		BLKCIPHER_AUTHONLY_TYPE};
 	struct unit_test_suite static_suites[] = {
 		cryptodev_multi_session_testsuite,
 		cryptodev_null_testsuite,
@@ -14323,13 +14244,15 @@ test_cryptodev_cpu_aesni_mb(void)
 	}
 
 	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
-			RTE_DIM(static_suites));
+			(RTE_DIM(blk_suites) + RTE_DIM(static_suites)));
 
+	ADD_BLOCKCIPHER_TESTSUITE(i, ts, blk_suites, RTE_DIM(blk_suites));
 	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
 
 	at = gbl_action_type;
 	gbl_action_type = RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO;
 	rc = unit_test_suite_runner(&ts);
+	FREE_BLOCKCIPHER_TESTSUITE(blk_start_idx, ts, RTE_DIM(blk_suites));
 	free(ts.unit_test_suites);
 	gbl_action_type = at;
 	return rc;
@@ -14338,7 +14261,16 @@ test_cryptodev_cpu_aesni_mb(void)
 static int
 test_cryptodev_openssl(void)
 {
-	uint8_t ret, j, i = 0;
+	uint8_t ret, j, i = 0, blk_start_idx = 0;
+	const enum blockcipher_test_type blk_suites[] = {
+		BLKCIPHER_AES_CHAIN_TYPE,
+		BLKCIPHER_AES_CIPHERONLY_TYPE,
+		BLKCIPHER_AES_DOCSIS_TYPE,
+		BLKCIPHER_3DES_CHAIN_TYPE,
+		BLKCIPHER_3DES_CIPHERONLY_TYPE,
+		BLKCIPHER_DES_CIPHERONLY_TYPE,
+		BLKCIPHER_DES_DOCSIS_TYPE,
+		BLKCIPHER_AUTHONLY_TYPE};
 	struct unit_test_suite static_suites[] = {
 		cryptodev_multi_session_testsuite,
 		cryptodev_null_testsuite,
@@ -14374,11 +14306,13 @@ test_cryptodev_openssl(void)
 	}
 
 	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
-			RTE_DIM(static_suites));
+			(RTE_DIM(blk_suites) + RTE_DIM(static_suites)));
 
+	ADD_BLOCKCIPHER_TESTSUITE(i, ts, blk_suites, RTE_DIM(blk_suites));
 	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
 	ret = unit_test_suite_runner(&ts);
 
+	FREE_BLOCKCIPHER_TESTSUITE(blk_start_idx, ts, RTE_DIM(blk_suites));
 	free(ts.unit_test_suites);
 	return ret;
 }
@@ -14386,7 +14320,16 @@ test_cryptodev_openssl(void)
 static int
 test_cryptodev_aesni_gcm(void)
 {
-	uint8_t ret, j, i = 0;
+	uint8_t ret, j, i = 0, blk_start_idx = 0;
+	const enum blockcipher_test_type blk_suites[] = {
+		BLKCIPHER_AES_CHAIN_TYPE,
+		BLKCIPHER_AES_CIPHERONLY_TYPE,
+		BLKCIPHER_AES_DOCSIS_TYPE,
+		BLKCIPHER_3DES_CHAIN_TYPE,
+		BLKCIPHER_3DES_CIPHERONLY_TYPE,
+		BLKCIPHER_DES_CIPHERONLY_TYPE,
+		BLKCIPHER_DES_DOCSIS_TYPE,
+		BLKCIPHER_AUTHONLY_TYPE};
 	struct unit_test_suite static_suites[] = {
 		cryptodev_multi_session_testsuite,
 		cryptodev_null_testsuite,
@@ -14422,11 +14365,13 @@ test_cryptodev_aesni_gcm(void)
 	}
 
 	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
-			RTE_DIM(static_suites));
+			(RTE_DIM(blk_suites) + RTE_DIM(static_suites)));
 
+	ADD_BLOCKCIPHER_TESTSUITE(i, ts, blk_suites, RTE_DIM(blk_suites));
 	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
 	ret = unit_test_suite_runner(&ts);
 
+	FREE_BLOCKCIPHER_TESTSUITE(blk_start_idx, ts, RTE_DIM(blk_suites));
 	free(ts.unit_test_suites);
 	return ret;
 }
@@ -14435,8 +14380,17 @@ static int
 test_cryptodev_cpu_aesni_gcm(void)
 {
 	int32_t rc;
-	uint8_t j, i = 0;
+	uint8_t j, i = 0, blk_start_idx = 0;
 	enum rte_security_session_action_type at;
+	const enum blockcipher_test_type blk_suites[] = {
+		BLKCIPHER_AES_CHAIN_TYPE,
+		BLKCIPHER_AES_CIPHERONLY_TYPE,
+		BLKCIPHER_AES_DOCSIS_TYPE,
+		BLKCIPHER_3DES_CHAIN_TYPE,
+		BLKCIPHER_3DES_CIPHERONLY_TYPE,
+		BLKCIPHER_DES_CIPHERONLY_TYPE,
+		BLKCIPHER_DES_DOCSIS_TYPE,
+		BLKCIPHER_AUTHONLY_TYPE};
 	struct unit_test_suite static_suites[] = {
 		cryptodev_multi_session_testsuite,
 		cryptodev_null_testsuite,
@@ -14472,13 +14426,15 @@ test_cryptodev_cpu_aesni_gcm(void)
 	}
 
 	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
-			RTE_DIM(static_suites));
+			(RTE_DIM(blk_suites) + RTE_DIM(static_suites)));
 
+	ADD_BLOCKCIPHER_TESTSUITE(i, ts, blk_suites, RTE_DIM(blk_suites));
 	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
 
 	at = gbl_action_type;
 	gbl_action_type = RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO;
 	rc  = unit_test_suite_runner(&ts);
+	FREE_BLOCKCIPHER_TESTSUITE(blk_start_idx, ts, RTE_DIM(blk_suites));
 	free(ts.unit_test_suites);
 	gbl_action_type = at;
 	return rc;
@@ -14487,7 +14443,16 @@ test_cryptodev_cpu_aesni_gcm(void)
 static int
 test_cryptodev_null(void)
 {
-	uint8_t ret, j, i = 0;
+	uint8_t ret, j, i = 0, blk_start_idx = 0;
+	const enum blockcipher_test_type blk_suites[] = {
+		BLKCIPHER_AES_CHAIN_TYPE,
+		BLKCIPHER_AES_CIPHERONLY_TYPE,
+		BLKCIPHER_AES_DOCSIS_TYPE,
+		BLKCIPHER_3DES_CHAIN_TYPE,
+		BLKCIPHER_3DES_CIPHERONLY_TYPE,
+		BLKCIPHER_DES_CIPHERONLY_TYPE,
+		BLKCIPHER_DES_DOCSIS_TYPE,
+		BLKCIPHER_AUTHONLY_TYPE};
 	struct unit_test_suite static_suites[] = {
 		cryptodev_multi_session_testsuite,
 		cryptodev_null_testsuite,
@@ -14523,11 +14488,13 @@ test_cryptodev_null(void)
 	}
 
 	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
-			RTE_DIM(static_suites));
+			(RTE_DIM(blk_suites) + RTE_DIM(static_suites)));
 
+	ADD_BLOCKCIPHER_TESTSUITE(i, ts, blk_suites, RTE_DIM(blk_suites));
 	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
 	ret = unit_test_suite_runner(&ts);
 
+	FREE_BLOCKCIPHER_TESTSUITE(blk_start_idx, ts, RTE_DIM(blk_suites));
 	free(ts.unit_test_suites);
 	return ret;
 }
@@ -14535,7 +14502,16 @@ test_cryptodev_null(void)
 static int
 test_cryptodev_sw_snow3g(void /*argv __rte_unused, int argc __rte_unused*/)
 {
-	uint8_t ret, j, i = 0;
+	uint8_t ret, j, i = 0, blk_start_idx = 0;
+	const enum blockcipher_test_type blk_suites[] = {
+		BLKCIPHER_AES_CHAIN_TYPE,
+		BLKCIPHER_AES_CIPHERONLY_TYPE,
+		BLKCIPHER_AES_DOCSIS_TYPE,
+		BLKCIPHER_3DES_CHAIN_TYPE,
+		BLKCIPHER_3DES_CIPHERONLY_TYPE,
+		BLKCIPHER_DES_CIPHERONLY_TYPE,
+		BLKCIPHER_DES_DOCSIS_TYPE,
+		BLKCIPHER_AUTHONLY_TYPE};
 	struct unit_test_suite static_suites[] = {
 		cryptodev_multi_session_testsuite,
 		cryptodev_null_testsuite,
@@ -14571,11 +14547,13 @@ test_cryptodev_sw_snow3g(void /*argv __rte_unused, int argc __rte_unused*/)
 	}
 
 	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
-			RTE_DIM(static_suites));
+			(RTE_DIM(blk_suites) + RTE_DIM(static_suites)));
 
+	ADD_BLOCKCIPHER_TESTSUITE(i, ts, blk_suites, RTE_DIM(blk_suites));
 	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
 	ret = unit_test_suite_runner(&ts);
 
+	FREE_BLOCKCIPHER_TESTSUITE(blk_start_idx, ts, RTE_DIM(blk_suites));
 	free(ts.unit_test_suites);
 	return ret;
 }
@@ -14583,7 +14561,16 @@ test_cryptodev_sw_snow3g(void /*argv __rte_unused, int argc __rte_unused*/)
 static int
 test_cryptodev_sw_kasumi(void /*argv __rte_unused, int argc __rte_unused*/)
 {
-	uint8_t ret, j, i = 0;
+	uint8_t ret, j, i = 0, blk_start_idx = 0;
+	const enum blockcipher_test_type blk_suites[] = {
+		BLKCIPHER_AES_CHAIN_TYPE,
+		BLKCIPHER_AES_CIPHERONLY_TYPE,
+		BLKCIPHER_AES_DOCSIS_TYPE,
+		BLKCIPHER_3DES_CHAIN_TYPE,
+		BLKCIPHER_3DES_CIPHERONLY_TYPE,
+		BLKCIPHER_DES_CIPHERONLY_TYPE,
+		BLKCIPHER_DES_DOCSIS_TYPE,
+		BLKCIPHER_AUTHONLY_TYPE};
 	struct unit_test_suite static_suites[] = {
 		cryptodev_multi_session_testsuite,
 		cryptodev_null_testsuite,
@@ -14619,11 +14606,13 @@ test_cryptodev_sw_kasumi(void /*argv __rte_unused, int argc __rte_unused*/)
 	}
 
 	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
-			RTE_DIM(static_suites));
+			(RTE_DIM(blk_suites) + RTE_DIM(static_suites)));
 
+	ADD_BLOCKCIPHER_TESTSUITE(i, ts, blk_suites, RTE_DIM(blk_suites));
 	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
 	ret = unit_test_suite_runner(&ts);
 
+	FREE_BLOCKCIPHER_TESTSUITE(blk_start_idx, ts, RTE_DIM(blk_suites));
 	free(ts.unit_test_suites);
 	return ret;
 }
@@ -14631,7 +14620,16 @@ test_cryptodev_sw_kasumi(void /*argv __rte_unused, int argc __rte_unused*/)
 static int
 test_cryptodev_sw_zuc(void /*argv __rte_unused, int argc __rte_unused*/)
 {
-	uint8_t ret, j, i = 0;
+	uint8_t ret, j, i = 0, blk_start_idx = 0;
+	const enum blockcipher_test_type blk_suites[] = {
+		BLKCIPHER_AES_CHAIN_TYPE,
+		BLKCIPHER_AES_CIPHERONLY_TYPE,
+		BLKCIPHER_AES_DOCSIS_TYPE,
+		BLKCIPHER_3DES_CHAIN_TYPE,
+		BLKCIPHER_3DES_CIPHERONLY_TYPE,
+		BLKCIPHER_DES_CIPHERONLY_TYPE,
+		BLKCIPHER_DES_DOCSIS_TYPE,
+		BLKCIPHER_AUTHONLY_TYPE};
 	struct unit_test_suite static_suites[] = {
 		cryptodev_multi_session_testsuite,
 		cryptodev_null_testsuite,
@@ -14667,11 +14665,13 @@ test_cryptodev_sw_zuc(void /*argv __rte_unused, int argc __rte_unused*/)
 	}
 
 	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
-			RTE_DIM(static_suites));
+			(RTE_DIM(blk_suites) + RTE_DIM(static_suites)));
 
+	ADD_BLOCKCIPHER_TESTSUITE(i, ts, blk_suites, RTE_DIM(blk_suites));
 	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
 	ret = unit_test_suite_runner(&ts);
 
+	FREE_BLOCKCIPHER_TESTSUITE(blk_start_idx, ts, RTE_DIM(blk_suites));
 	free(ts.unit_test_suites);
 	return ret;
 }
@@ -14679,7 +14679,16 @@ test_cryptodev_sw_zuc(void /*argv __rte_unused, int argc __rte_unused*/)
 static int
 test_cryptodev_armv8(void)
 {
-	uint8_t ret, j, i = 0;
+	uint8_t ret, j, i = 0, blk_start_idx = 0;
+	const enum blockcipher_test_type blk_suites[] = {
+		BLKCIPHER_AES_CHAIN_TYPE,
+		BLKCIPHER_AES_CIPHERONLY_TYPE,
+		BLKCIPHER_AES_DOCSIS_TYPE,
+		BLKCIPHER_3DES_CHAIN_TYPE,
+		BLKCIPHER_3DES_CIPHERONLY_TYPE,
+		BLKCIPHER_DES_CIPHERONLY_TYPE,
+		BLKCIPHER_DES_DOCSIS_TYPE,
+		BLKCIPHER_AUTHONLY_TYPE};
 	struct unit_test_suite static_suites[] = {
 		cryptodev_multi_session_testsuite,
 		cryptodev_null_testsuite,
@@ -14715,11 +14724,13 @@ test_cryptodev_armv8(void)
 	}
 
 	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
-			RTE_DIM(static_suites));
+			(RTE_DIM(blk_suites) + RTE_DIM(static_suites)));
 
+	ADD_BLOCKCIPHER_TESTSUITE(i, ts, blk_suites, RTE_DIM(blk_suites));
 	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
 	ret = unit_test_suite_runner(&ts);
 
+	FREE_BLOCKCIPHER_TESTSUITE(blk_start_idx, ts, RTE_DIM(blk_suites));
 	free(ts.unit_test_suites);
 	return ret;
 }
@@ -14727,7 +14738,13 @@ test_cryptodev_armv8(void)
 static int
 test_cryptodev_mrvl(void)
 {
-	uint8_t ret, j, i = 0;
+	uint8_t ret, j, i = 0, blk_start_idx = 0;
+	const enum blockcipher_test_type blk_suites[] = {
+		BLKCIPHER_AES_CHAIN_TYPE,
+		BLKCIPHER_AES_CIPHERONLY_TYPE,
+		BLKCIPHER_3DES_CHAIN_TYPE,
+		BLKCIPHER_3DES_CIPHERONLY_TYPE,
+		BLKCIPHER_AUTHONLY_TYPE};
 	const struct unit_test_suite static_suites[] = {
 		cryptodev_multi_session_testsuite,
 		cryptodev_null_testsuite,
@@ -14745,7 +14762,6 @@ test_cryptodev_mrvl(void)
 		cryptodev_mixed_cipher_hash_testsuite,
 		cryptodev_negative_hmac_sha1_testsuite,
 		cryptodev_testsuite,
-		cryptodev_mrvl_sub_testsuite,
 		end_testsuite
 	};
 	struct unit_test_suite ts = {
@@ -14764,11 +14780,13 @@ test_cryptodev_mrvl(void)
 	}
 
 	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
-			RTE_DIM(static_suites));
+			(RTE_DIM(blk_suites) + RTE_DIM(static_suites)));
 
+	ADD_BLOCKCIPHER_TESTSUITE(i, ts, blk_suites, RTE_DIM(blk_suites));
 	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
 	ret = unit_test_suite_runner(&ts);
 
+	FREE_BLOCKCIPHER_TESTSUITE(blk_start_idx, ts, RTE_DIM(blk_suites));
 	free(ts.unit_test_suites);
 	return ret;
 }
@@ -14778,63 +14796,36 @@ test_cryptodev_mrvl(void)
 static int
 test_cryptodev_scheduler(void /*argv __rte_unused, int argc __rte_unused*/)
 {
-	uint8_t ret, j, i = 0;
+	uint8_t ret, sched_i, j, i = 0, blk_start_idx = 0;
+	const enum blockcipher_test_type blk_suites[] = {
+		BLKCIPHER_AES_CHAIN_TYPE,
+		BLKCIPHER_AES_CIPHERONLY_TYPE,
+		BLKCIPHER_AUTHONLY_TYPE
+	};
 	struct unit_test_suite sched_mode_suites[] = {
 		{
 			.suite_name = "Scheduler Multicore Unit Test Suite",
 			.setup = scheduler_multicore_testsuite_setup,
 			.teardown = scheduler_mode_testsuite_teardown,
-			.unit_test_cases = ((struct unit_test_case []) {
-				TEST_CASE_ST(ut_setup, ut_teardown,
-						test_AES_chain_all),
-				TEST_CASE_ST(ut_setup, ut_teardown,
-						test_AES_cipheronly_all),
-				TEST_CASE_ST(ut_setup, ut_teardown,
-						test_authonly_all),
-				TEST_CASES_END()
-			})
+			.parent_testsuite = true
 		},
 		{
 			.suite_name = "Scheduler Round Robin Unit Test Suite",
 			.setup = scheduler_roundrobin_testsuite_setup,
 			.teardown = scheduler_mode_testsuite_teardown,
-			.unit_test_cases = ((struct unit_test_case []) {
-				TEST_CASE_ST(ut_setup, ut_teardown,
-						test_AES_chain_all),
-				TEST_CASE_ST(ut_setup, ut_teardown,
-						test_AES_cipheronly_all),
-				TEST_CASE_ST(ut_setup, ut_teardown,
-						test_authonly_all),
-				TEST_CASES_END()
-			})
+			.parent_testsuite = true
 		},
 		{
 			.suite_name = "Scheduler Failover Unit Test Suite",
 			.setup = scheduler_failover_testsuite_setup,
 			.teardown = scheduler_mode_testsuite_teardown,
-			.unit_test_cases = ((struct unit_test_case []) {
-				TEST_CASE_ST(ut_setup, ut_teardown,
-						test_AES_chain_all),
-				TEST_CASE_ST(ut_setup, ut_teardown,
-						test_AES_cipheronly_all),
-				TEST_CASE_ST(ut_setup, ut_teardown,
-						test_authonly_all),
-				TEST_CASES_END()
-			})
+			.parent_testsuite = true
 		},
 		{
 			.suite_name = "Scheduler Pkt Size Distr Unit Test Suite",
 			.setup = scheduler_pkt_size_distr_testsuite_setup,
 			.teardown = scheduler_mode_testsuite_teardown,
-			.unit_test_cases = ((struct unit_test_case []) {
-				TEST_CASE_ST(ut_setup, ut_teardown,
-						test_AES_chain_all),
-				TEST_CASE_ST(ut_setup, ut_teardown,
-						test_AES_cipheronly_all),
-				TEST_CASE_ST(ut_setup, ut_teardown,
-						test_authonly_all),
-				TEST_CASES_END()
-			})
+			.parent_testsuite = true
 		}
 	};
 	struct unit_test_suite static_suites[] = {
@@ -14875,6 +14866,16 @@ test_cryptodev_scheduler(void /*argv __rte_unused, int argc __rte_unused*/)
 		return TEST_SKIPPED;
 	}
 
+	for (sched_i = 0; sched_i < RTE_DIM(sched_mode_suites); sched_i++) {
+		uint8_t blk_i = 0;
+		sched_mode_suites[sched_i].unit_test_suites = malloc(sizeof
+				(struct unit_test_suite) *
+				(RTE_DIM(blk_suites) + 1));
+		ADD_BLOCKCIPHER_TESTSUITE(blk_i, sched_mode_suites[sched_i],
+				blk_suites, RTE_DIM(blk_suites));
+		sched_mode_suites[sched_i].unit_test_suites[blk_i] = end_testsuite;
+	}
+
 	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
 			(RTE_DIM(static_suites) + RTE_DIM(sched_mode_suites)));
 	ADD_STATIC_TESTSUITE(i, ts, sched_mode_suites,
@@ -14882,6 +14883,12 @@ test_cryptodev_scheduler(void /*argv __rte_unused, int argc __rte_unused*/)
 	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
 	ret = unit_test_suite_runner(&ts);
 
+	for (sched_i = 0; sched_i < RTE_DIM(sched_mode_suites); sched_i++) {
+		FREE_BLOCKCIPHER_TESTSUITE(blk_start_idx,
+				sched_mode_suites[sched_i],
+				RTE_DIM(blk_suites));
+		free(sched_mode_suites[sched_i].unit_test_suites);
+	}
 	free(ts.unit_test_suites);
 	return ret;
 }
@@ -14893,7 +14900,16 @@ REGISTER_TEST_COMMAND(cryptodev_scheduler_autotest, test_cryptodev_scheduler);
 static int
 test_cryptodev_dpaa2_sec(void /*argv __rte_unused, int argc __rte_unused*/)
 {
-	uint8_t ret, j, i = 0;
+	uint8_t ret, j, i = 0, blk_start_idx = 0;
+	const enum blockcipher_test_type blk_suites[] = {
+		BLKCIPHER_AES_CHAIN_TYPE,
+		BLKCIPHER_AES_CIPHERONLY_TYPE,
+		BLKCIPHER_AES_DOCSIS_TYPE,
+		BLKCIPHER_3DES_CHAIN_TYPE,
+		BLKCIPHER_3DES_CIPHERONLY_TYPE,
+		BLKCIPHER_DES_CIPHERONLY_TYPE,
+		BLKCIPHER_DES_DOCSIS_TYPE,
+		BLKCIPHER_AUTHONLY_TYPE};
 	struct unit_test_suite static_suites[] = {
 		cryptodev_multi_session_testsuite,
 		cryptodev_null_testsuite,
@@ -14929,11 +14945,13 @@ test_cryptodev_dpaa2_sec(void /*argv __rte_unused, int argc __rte_unused*/)
 	}
 
 	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
-			RTE_DIM(static_suites));
+			(RTE_DIM(blk_suites) + RTE_DIM(static_suites)));
 
+	ADD_BLOCKCIPHER_TESTSUITE(i, ts, blk_suites, RTE_DIM(blk_suites));
 	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
 	ret = unit_test_suite_runner(&ts);
 
+	FREE_BLOCKCIPHER_TESTSUITE(blk_start_idx, ts, RTE_DIM(blk_suites));
 	free(ts.unit_test_suites);
 	return ret;
 }
@@ -14941,7 +14959,16 @@ test_cryptodev_dpaa2_sec(void /*argv __rte_unused, int argc __rte_unused*/)
 static int
 test_cryptodev_dpaa_sec(void /*argv __rte_unused, int argc __rte_unused*/)
 {
-	uint8_t ret, j, i = 0;
+	uint8_t ret, j, i = 0, blk_start_idx = 0;
+	const enum blockcipher_test_type blk_suites[] = {
+		BLKCIPHER_AES_CHAIN_TYPE,
+		BLKCIPHER_AES_CIPHERONLY_TYPE,
+		BLKCIPHER_AES_DOCSIS_TYPE,
+		BLKCIPHER_3DES_CHAIN_TYPE,
+		BLKCIPHER_3DES_CIPHERONLY_TYPE,
+		BLKCIPHER_DES_CIPHERONLY_TYPE,
+		BLKCIPHER_DES_DOCSIS_TYPE,
+		BLKCIPHER_AUTHONLY_TYPE};
 	struct unit_test_suite static_suites[] = {
 		cryptodev_multi_session_testsuite,
 		cryptodev_null_testsuite,
@@ -14977,11 +15004,13 @@ test_cryptodev_dpaa_sec(void /*argv __rte_unused, int argc __rte_unused*/)
 	}
 
 	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
-			RTE_DIM(static_suites));
+			(RTE_DIM(blk_suites) + RTE_DIM(static_suites)));
 
+	ADD_BLOCKCIPHER_TESTSUITE(i, ts, blk_suites, RTE_DIM(blk_suites));
 	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
 	ret = unit_test_suite_runner(&ts);
 
+	FREE_BLOCKCIPHER_TESTSUITE(blk_start_idx, ts, RTE_DIM(blk_suites));
 	free(ts.unit_test_suites);
 	return ret;
 }
@@ -14989,11 +15018,16 @@ test_cryptodev_dpaa_sec(void /*argv __rte_unused, int argc __rte_unused*/)
 static int
 test_cryptodev_ccp(void)
 {
-	uint8_t ret, j, i = 0;
+	uint8_t ret, j, i = 0, blk_start_idx = 0;
+	const enum blockcipher_test_type blk_suites[] = {
+		BLKCIPHER_AES_CHAIN_TYPE,
+		BLKCIPHER_AES_CIPHERONLY_TYPE,
+		BLKCIPHER_3DES_CHAIN_TYPE,
+		BLKCIPHER_3DES_CIPHERONLY_TYPE,
+		BLKCIPHER_AUTHONLY_TYPE};
 	struct unit_test_suite static_suites[] = {
 		cryptodev_multi_session_testsuite,
 		cryptodev_negative_hmac_sha1_testsuite,
-		cryptodev_ccp_sub_testsuite,
 		end_testsuite
 	};
 	struct unit_test_suite ts = {
@@ -15012,11 +15046,13 @@ test_cryptodev_ccp(void)
 	}
 
 	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
-			RTE_DIM(static_suites));
+			(RTE_DIM(blk_suites) + RTE_DIM(static_suites)));
 
+	ADD_BLOCKCIPHER_TESTSUITE(i, ts, blk_suites, RTE_DIM(blk_suites));
 	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
 	ret = unit_test_suite_runner(&ts);
 
+	FREE_BLOCKCIPHER_TESTSUITE(blk_start_idx, ts, RTE_DIM(blk_suites));
 	free(ts.unit_test_suites);
 	return ret;
 }
@@ -15024,7 +15060,16 @@ test_cryptodev_ccp(void)
 static int
 test_cryptodev_octeontx(void)
 {
-	uint8_t ret, j, i = 0;
+	uint8_t ret, j, i = 0, blk_start_idx = 0;
+	const enum blockcipher_test_type blk_suites[] = {
+		BLKCIPHER_AES_CHAIN_TYPE,
+		BLKCIPHER_AES_CIPHERONLY_TYPE,
+		BLKCIPHER_AES_DOCSIS_TYPE,
+		BLKCIPHER_3DES_CHAIN_TYPE,
+		BLKCIPHER_3DES_CIPHERONLY_TYPE,
+		BLKCIPHER_DES_CIPHERONLY_TYPE,
+		BLKCIPHER_DES_DOCSIS_TYPE,
+		BLKCIPHER_AUTHONLY_TYPE};
 	struct unit_test_suite static_suites[] = {
 		cryptodev_multi_session_testsuite,
 		cryptodev_null_testsuite,
@@ -15060,11 +15105,13 @@ test_cryptodev_octeontx(void)
 	}
 
 	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
-			RTE_DIM(static_suites));
+			(RTE_DIM(blk_suites) + RTE_DIM(static_suites)));
 
+	ADD_BLOCKCIPHER_TESTSUITE(i, ts, blk_suites, RTE_DIM(blk_suites));
 	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
 	ret = unit_test_suite_runner(&ts);
 
+	FREE_BLOCKCIPHER_TESTSUITE(blk_start_idx, ts, RTE_DIM(blk_suites));
 	free(ts.unit_test_suites);
 	return ret;
 }
@@ -15072,7 +15119,16 @@ test_cryptodev_octeontx(void)
 static int
 test_cryptodev_octeontx2(void)
 {
-	uint8_t ret, j, i = 0;
+	uint8_t ret, j, i = 0, blk_start_idx = 0;
+	const enum blockcipher_test_type blk_suites[] = {
+		BLKCIPHER_AES_CHAIN_TYPE,
+		BLKCIPHER_AES_CIPHERONLY_TYPE,
+		BLKCIPHER_AES_DOCSIS_TYPE,
+		BLKCIPHER_3DES_CHAIN_TYPE,
+		BLKCIPHER_3DES_CIPHERONLY_TYPE,
+		BLKCIPHER_DES_CIPHERONLY_TYPE,
+		BLKCIPHER_DES_DOCSIS_TYPE,
+		BLKCIPHER_AUTHONLY_TYPE};
 	struct unit_test_suite static_suites[] = {
 		cryptodev_multi_session_testsuite,
 		cryptodev_null_testsuite,
@@ -15108,11 +15164,13 @@ test_cryptodev_octeontx2(void)
 	}
 
 	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
-			RTE_DIM(static_suites));
+			(RTE_DIM(blk_suites) + RTE_DIM(static_suites)));
 
+	ADD_BLOCKCIPHER_TESTSUITE(i, ts, blk_suites, RTE_DIM(blk_suites));
 	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
 	ret = unit_test_suite_runner(&ts);
 
+	FREE_BLOCKCIPHER_TESTSUITE(blk_start_idx, ts, RTE_DIM(blk_suites));
 	free(ts.unit_test_suites);
 	return ret;
 }
@@ -15120,7 +15178,13 @@ test_cryptodev_octeontx2(void)
 static int
 test_cryptodev_caam_jr(void /*argv __rte_unused, int argc __rte_unused*/)
 {
-	uint8_t ret, j, i = 0;
+	uint8_t ret, j, i = 0, blk_start_idx = 0;
+	const enum blockcipher_test_type blk_suites[] = {
+		BLKCIPHER_AES_CHAIN_TYPE,
+		BLKCIPHER_AES_CIPHERONLY_TYPE,
+		BLKCIPHER_3DES_CHAIN_TYPE,
+		BLKCIPHER_3DES_CIPHERONLY_TYPE,
+		BLKCIPHER_AUTHONLY_TYPE};
 	struct unit_test_suite static_suites[] = {
 		cryptodev_caam_jr_sub_testsuite,
 		end_testsuite
@@ -15141,11 +15205,13 @@ test_cryptodev_caam_jr(void /*argv __rte_unused, int argc __rte_unused*/)
 	}
 
 	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
-			RTE_DIM(static_suites));
+			(RTE_DIM(blk_suites) + RTE_DIM(static_suites)));
 
+	ADD_BLOCKCIPHER_TESTSUITE(i, ts, blk_suites, RTE_DIM(blk_suites));
 	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
 	ret = unit_test_suite_runner(&ts);
 
+	FREE_BLOCKCIPHER_TESTSUITE(blk_start_idx, ts, RTE_DIM(blk_suites));
 	free(ts.unit_test_suites);
 	return ret;
 }
@@ -15153,7 +15219,16 @@ test_cryptodev_caam_jr(void /*argv __rte_unused, int argc __rte_unused*/)
 static int
 test_cryptodev_nitrox(void)
 {
-	uint8_t ret, j, i = 0;
+	uint8_t ret, j, i = 0, blk_start_idx = 0;
+	const enum blockcipher_test_type blk_suites[] = {
+		BLKCIPHER_AES_CHAIN_TYPE,
+		BLKCIPHER_AES_CIPHERONLY_TYPE,
+		BLKCIPHER_AES_DOCSIS_TYPE,
+		BLKCIPHER_3DES_CHAIN_TYPE,
+		BLKCIPHER_3DES_CIPHERONLY_TYPE,
+		BLKCIPHER_DES_CIPHERONLY_TYPE,
+		BLKCIPHER_DES_DOCSIS_TYPE,
+		BLKCIPHER_AUTHONLY_TYPE};
 	struct unit_test_suite static_suites[] = {
 		cryptodev_multi_session_testsuite,
 		cryptodev_null_testsuite,
@@ -15189,11 +15264,13 @@ test_cryptodev_nitrox(void)
 	}
 
 	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
-			RTE_DIM(static_suites));
+			(RTE_DIM(blk_suites) + RTE_DIM(static_suites)));
 
+	ADD_BLOCKCIPHER_TESTSUITE(i, ts, blk_suites, RTE_DIM(blk_suites));
 	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
 	ret = unit_test_suite_runner(&ts);
 
+	FREE_BLOCKCIPHER_TESTSUITE(blk_start_idx, ts, RTE_DIM(blk_suites));
 	free(ts.unit_test_suites);
 	return ret;
 }
@@ -15201,7 +15278,16 @@ test_cryptodev_nitrox(void)
 static int
 test_cryptodev_bcmfs(void)
 {
-	uint8_t ret, j, i = 0;
+	uint8_t ret, j, i = 0, blk_start_idx = 0;
+	const enum blockcipher_test_type blk_suites[] = {
+		BLKCIPHER_AES_CHAIN_TYPE,
+		BLKCIPHER_AES_CIPHERONLY_TYPE,
+		BLKCIPHER_AES_DOCSIS_TYPE,
+		BLKCIPHER_3DES_CHAIN_TYPE,
+		BLKCIPHER_3DES_CIPHERONLY_TYPE,
+		BLKCIPHER_DES_CIPHERONLY_TYPE,
+		BLKCIPHER_DES_DOCSIS_TYPE,
+		BLKCIPHER_AUTHONLY_TYPE};
 	struct unit_test_suite static_suites[] = {
 		cryptodev_multi_session_testsuite,
 		cryptodev_null_testsuite,
@@ -15237,11 +15323,13 @@ test_cryptodev_bcmfs(void)
 	}
 
 	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
-			RTE_DIM(static_suites));
+			(RTE_DIM(blk_suites) + RTE_DIM(static_suites)));
 
+	ADD_BLOCKCIPHER_TESTSUITE(i, ts, blk_suites, RTE_DIM(blk_suites));
 	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
 	ret = unit_test_suite_runner(&ts);
 
+	FREE_BLOCKCIPHER_TESTSUITE(blk_start_idx, ts, RTE_DIM(blk_suites));
 	free(ts.unit_test_suites);
 	return ret;
 }
@@ -15250,7 +15338,14 @@ static int
 test_cryptodev_qat_raw_api(void /*argv __rte_unused, int argc __rte_unused*/)
 {
 	int ret;
-	uint8_t j, i = 0;
+	uint8_t j, i = 0, blk_start_idx = 0;
+	const enum blockcipher_test_type blk_suites[] = {
+		BLKCIPHER_AES_CHAIN_TYPE,
+		BLKCIPHER_AES_CIPHERONLY_TYPE,
+		BLKCIPHER_3DES_CHAIN_TYPE,
+		BLKCIPHER_3DES_CIPHERONLY_TYPE,
+		BLKCIPHER_DES_CIPHERONLY_TYPE,
+		BLKCIPHER_AUTHONLY_TYPE};
 	struct unit_test_suite static_suites[] = {
 		cryptodev_multi_session_testsuite,
 		cryptodev_null_testsuite,
@@ -15286,11 +15381,13 @@ test_cryptodev_qat_raw_api(void /*argv __rte_unused, int argc __rte_unused*/)
 	}
 
 	ts.unit_test_suites = malloc(sizeof(struct unit_test_suite) *
-			RTE_DIM(static_suites));
+			(RTE_DIM(blk_suites) + RTE_DIM(static_suites)));
 
+	ADD_BLOCKCIPHER_TESTSUITE(i, ts, blk_suites, RTE_DIM(blk_suites));
 	ADD_STATIC_TESTSUITE(i, ts, static_suites, RTE_DIM(static_suites));
 	global_api_test_type = CRYPTODEV_RAW_API_TEST;
 	ret = unit_test_suite_runner(&ts);
+	FREE_BLOCKCIPHER_TESTSUITE(blk_start_idx, ts, RTE_DIM(blk_suites));
 	free(ts.unit_test_suites);
 	global_api_test_type = CRYPTODEV_API_TEST;
 
diff --git a/app/test/test_cryptodev_blockcipher.c b/app/test/test_cryptodev_blockcipher.c
index 135e57b9fa..5c32564199 100644
--- a/app/test/test_cryptodev_blockcipher.c
+++ b/app/test/test_cryptodev_blockcipher.c
@@ -738,82 +738,101 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,
 	return status;
 }
 
-int
-test_blockcipher_all_tests(struct rte_mempool *mbuf_pool,
-	struct rte_mempool *op_mpool,
-	struct rte_mempool *sess_mpool,
-	struct rte_mempool *sess_priv_mpool,
-	uint8_t dev_id,
-	enum blockcipher_test_type test_type)
+static int
+blockcipher_test_case_run(const void *data)
 {
-	int status, overall_status = TEST_SUCCESS;
-	uint32_t i, test_index = 0;
+	const struct blockcipher_test_case *tc_data = data;
+	int status;
 	char test_msg[BLOCKCIPHER_TEST_MSG_LEN + 1];
-	uint32_t n_test_cases = 0;
-	const struct blockcipher_test_case *tcs = NULL;
+
+	status = test_blockcipher_one_case(tc_data,
+			p_testsuite_params->mbuf_pool,
+			p_testsuite_params->op_mpool,
+			p_testsuite_params->session_mpool,
+			p_testsuite_params->session_priv_mpool,
+			p_testsuite_params->valid_devs[0],
+			test_msg);
+	return status;
+}
+
+struct unit_test_suite
+build_blockcipher_test_suite(enum blockcipher_test_type test_type)
+{
+	int i, n_test_cases = 0;
+	struct unit_test_suite ts = {0};
+	const struct blockcipher_test_case *blk_tcs;
+	struct unit_test_case *tcs;
 
 	switch (test_type) {
 	case BLKCIPHER_AES_CHAIN_TYPE:
-		n_test_cases = sizeof(aes_chain_test_cases) /
-		sizeof(aes_chain_test_cases[0]);
-		tcs = aes_chain_test_cases;
+		n_test_cases = RTE_DIM(aes_chain_test_cases);
+		blk_tcs = aes_chain_test_cases;
+		ts.suite_name = "AES Chain";
 		break;
 	case BLKCIPHER_AES_CIPHERONLY_TYPE:
-		n_test_cases = sizeof(aes_cipheronly_test_cases) /
-		sizeof(aes_cipheronly_test_cases[0]);
-		tcs = aes_cipheronly_test_cases;
+		n_test_cases = RTE_DIM(aes_cipheronly_test_cases);
+		blk_tcs = aes_cipheronly_test_cases;
+		ts.suite_name = "AES Cipher Only";
 		break;
 	case BLKCIPHER_AES_DOCSIS_TYPE:
-		n_test_cases = sizeof(aes_docsis_test_cases) /
-		sizeof(aes_docsis_test_cases[0]);
-		tcs = aes_docsis_test_cases;
+		n_test_cases = RTE_DIM(aes_docsis_test_cases);
+		blk_tcs = aes_docsis_test_cases;
+		ts.suite_name = "AES Docsis";
 		break;
 	case BLKCIPHER_3DES_CHAIN_TYPE:
-		n_test_cases = sizeof(triple_des_chain_test_cases) /
-		sizeof(triple_des_chain_test_cases[0]);
-		tcs = triple_des_chain_test_cases;
+		n_test_cases = RTE_DIM(triple_des_chain_test_cases);
+		blk_tcs = triple_des_chain_test_cases;
+		ts.suite_name = "3DES Chain";
 		break;
 	case BLKCIPHER_3DES_CIPHERONLY_TYPE:
-		n_test_cases = sizeof(triple_des_cipheronly_test_cases) /
-		sizeof(triple_des_cipheronly_test_cases[0]);
-		tcs = triple_des_cipheronly_test_cases;
+		n_test_cases = RTE_DIM(triple_des_cipheronly_test_cases);
+		blk_tcs = triple_des_cipheronly_test_cases;
+		ts.suite_name = "3DES Cipher Only";
 		break;
 	case BLKCIPHER_DES_CIPHERONLY_TYPE:
-		n_test_cases = sizeof(des_cipheronly_test_cases) /
-		sizeof(des_cipheronly_test_cases[0]);
-		tcs = des_cipheronly_test_cases;
+		n_test_cases = RTE_DIM(des_cipheronly_test_cases);
+		blk_tcs = des_cipheronly_test_cases;
+		ts.suite_name = "DES Cipher Only";
 		break;
 	case BLKCIPHER_DES_DOCSIS_TYPE:
-		n_test_cases = sizeof(des_docsis_test_cases) /
-		sizeof(des_docsis_test_cases[0]);
-		tcs = des_docsis_test_cases;
+		n_test_cases = RTE_DIM(des_docsis_test_cases);
+		blk_tcs = des_docsis_test_cases;
+		ts.suite_name = "DES Docsis";
 		break;
 	case BLKCIPHER_AUTHONLY_TYPE:
-		n_test_cases = sizeof(hash_test_cases) /
-		sizeof(hash_test_cases[0]);
-		tcs = hash_test_cases;
+		n_test_cases = RTE_DIM(hash_test_cases);
+		blk_tcs = hash_test_cases;
+		ts.suite_name = "Auth Only";
 		break;
 	default:
 		break;
 	}
 
-	for (i = 0; i < n_test_cases; i++) {
-		const struct blockcipher_test_case *tc = &tcs[i];
-
-		status = test_blockcipher_one_case(tc, mbuf_pool, op_mpool,
-			sess_mpool, sess_priv_mpool, dev_id,
-			test_msg);
-
-		printf("  %u) TestCase %s %s\n", test_index ++,
-			tc->test_descr, test_msg);
+	tcs = malloc(sizeof(struct unit_test_case) * (n_test_cases + 1));
 
-		if (status == TEST_FAILED) {
-			overall_status = status;
-
-			if (tc->feature_mask & BLOCKCIPHER_TEST_FEATURE_STOPPER)
-				break;
-		}
+	for (i = 0; i < n_test_cases; i++) {
+		tcs[i].name = blk_tcs[i].test_descr;
+		tcs[i].enabled = 1;
+		tcs[i].setup = ut_setup;
+		tcs[i].teardown = ut_teardown;
+		tcs[i].testcase = NULL;
+		tcs[i].testcase_with_data = blockcipher_test_case_run;
+		tcs[i].data = &blk_tcs[i];
 	}
+	tcs[i].name = NULL;
+	tcs[i].enabled = 0;
+	tcs[i].setup = NULL;
+	tcs[i].teardown = NULL;
+	tcs[i].testcase = NULL;
+	tcs[i].testcase_with_data = NULL;
+	tcs[i].data = NULL;
+	ts.unit_test_cases = tcs;
+
+	return ts;
+}
 
-	return overall_status;
+void
+free_blockcipher_test_suite(struct unit_test_suite *ts)
+{
+	free(ts->unit_test_cases);
 }
diff --git a/app/test/test_cryptodev_blockcipher.h b/app/test/test_cryptodev_blockcipher.h
index 8990716844..ebdd806776 100644
--- a/app/test/test_cryptodev_blockcipher.h
+++ b/app/test/test_cryptodev_blockcipher.h
@@ -89,12 +89,10 @@ struct blockcipher_test_data {
 	unsigned int auth_offset;
 };
 
-int
-test_blockcipher_all_tests(struct rte_mempool *mbuf_pool,
-	struct rte_mempool *op_mpool,
-	struct rte_mempool *sess_mpool,
-	struct rte_mempool *sess_priv_mpool,
-	uint8_t dev_id,
-	enum blockcipher_test_type test_type);
+struct unit_test_suite
+build_blockcipher_test_suite(enum blockcipher_test_type test_type);
+
+void
+free_blockcipher_test_suite(struct unit_test_suite *ts);
 
 #endif /* TEST_CRYPTODEV_BLOCKCIPHER_H_ */
-- 
2.25.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [dpdk-dev] [PATCH 6/6] doc: add unit test suite change to release notes
  2021-03-16 14:32 [dpdk-dev] [PATCH 0/6] test: refactor crypto unit test framework Ciara Power
                   ` (4 preceding siblings ...)
  2021-03-16 14:32 ` [dpdk-dev] [PATCH 5/6] test/crypto: dynamically build blockcipher suite Ciara Power
@ 2021-03-16 14:32 ` Ciara Power
  2021-03-30 16:15 ` [dpdk-dev] [PATCH 0/6] test: refactor crypto unit test framework Doherty, Declan
  2021-04-01  3:13 ` Ruifeng Wang
  7 siblings, 0 replies; 14+ messages in thread
From: Ciara Power @ 2021-03-16 14:32 UTC (permalink / raw)
  To: dev; +Cc: declan.doherty, Ciara Power

The unit test suite framework now supports having nested sub-testsuites,
or a list of testcases as before.
This new unit test feature is added to the release notes.

Signed-off-by: Ciara Power <ciara.power@intel.com>
---
 doc/guides/rel_notes/release_21_05.rst | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/doc/guides/rel_notes/release_21_05.rst b/doc/guides/rel_notes/release_21_05.rst
index 23f7f0bff9..4ee390e8d9 100644
--- a/doc/guides/rel_notes/release_21_05.rst
+++ b/doc/guides/rel_notes/release_21_05.rst
@@ -70,6 +70,11 @@ New Features
   * Added command to display Rx queue used descriptor count.
     ``show port (port_id) rxq (queue_id) desc used count``
 
+* **Added sub-testsuite support.**
+
+  * The unit test suite struct now supports having either a nested
+    list of sub-testsuites, or a list of testcases as before.
+
 
 Removed Items
 -------------
-- 
2.25.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [dpdk-dev] [PATCH 0/6] test: refactor crypto unit test framework
  2021-03-16 14:32 [dpdk-dev] [PATCH 0/6] test: refactor crypto unit test framework Ciara Power
                   ` (5 preceding siblings ...)
  2021-03-16 14:32 ` [dpdk-dev] [PATCH 6/6] doc: add unit test suite change to release notes Ciara Power
@ 2021-03-30 16:15 ` Doherty, Declan
  2021-03-31 14:43   ` Aaron Conole
  2021-04-01  3:13 ` Ruifeng Wang
  7 siblings, 1 reply; 14+ messages in thread
From: Doherty, Declan @ 2021-03-30 16:15 UTC (permalink / raw)
  To: Ciara Power, dev, Aaron Conole

Hey Aaron,

based on the work you've been doing on the unit test documentation we 
would appreciate if you could take a look over this patchset and get 
your thoughts. The primary drive here is to make it easier to get a 
clear picture of what is being executed in the cryptodev testsuite, as 
at the moment there are test suites masquerading as unit tests and the 
output doesn't reflect the actual number of unit tests being executed.

Thanks
Declan

On 16/03/2021 2:32 PM, Ciara Power wrote:
> The current crypto unit test framework is not granular enough to
> accurately track unit test results. This is caused by one testcase
> in a suite actually running multiple testcases, but only returning
> one result.
>   
> The approach taken in this patchset allows a test suite have either a
> list of sub-testsuites, or a list of testcases as previously used.
> The unit test suite runner can then recursively iterate and run the
> sub-testsuites, until it reaches a suite with testcases,
> and it then runs each testcase as it had done previously.
>   
> By allowing this further breakdown into sub-testsuites,
> a refactor of the crypto unit tests solves the issue of inaccurate
> reporting, as sub-testsuites can be used in place of the testcases
> that had multiple testcases hidden on a sub level.
> The blockcipher tests previously had these hidden testcases,
> but are now sub-testsuites that are dynamically created and added to a
> parent test suite, allowing for each testcase status to be reported
> directly to the runner.
> The cryptodev test suite is broken down into smaller suites that are
> used as sub-testsuites, which allows for more flexibility choosing which
> sub-testsuites should run for the current device autotest.
> The introduction of sub-testsuites also allows for more precise
> setup/teardown functions, rather than general ones loaded with
> conditions as was seen with the initial setup function used for all
> crypto testsuites.
>   
> For example, when running the cryptodev_aesni_mb_autotest,
> the AESNI MB parent test suite has its own setup function to initialise
> the AESNI MB device.
> Various sub-testsuites are added to the parent test suite, such as some
> of the static suites that were once in the cryptodev_testsuite,
> and blockcipher suites.
> The unit test runner can then run the AESNI MB parent test suite,
> which in turn will run the sub-testsuites.
>   
> Documentation will be added in a later version of the patchset,
> adding to the test document that isn't yet merged. [1]
> 
> ---
> [1] https://patchwork.dpdk.org/project/dpdk/patch/20210309155757.615536-1-aconole@redhat.com/
> 
> Ciara Power (6):
>    app/test: refactor of unit test suite runner
>    test: introduce parent testsuite format
>    test/crypto: refactor to use sub-testsuites
>    test/crypto: move testsuite params to header file
>    test/crypto: dynamically build blockcipher suite
>    doc: add unit test suite change to release notes
> 
>   app/test/test.c                        |  168 +-
>   app/test/test.h                        |   22 +-
>   app/test/test_bitratestats.c           |    4 +-
>   app/test/test_compressdev.c            |    4 +-
>   app/test/test_cryptodev.c              | 2020 ++++++++++++++++++------
>   app/test/test_cryptodev.h              |   20 +
>   app/test/test_cryptodev_asym.c         |  105 +-
>   app/test/test_cryptodev_blockcipher.c  |  121 +-
>   app/test/test_cryptodev_blockcipher.h  |   12 +-
>   app/test/test_ethdev_link.c            |    4 +-
>   app/test/test_event_crypto_adapter.c   |    4 +-
>   app/test/test_event_eth_rx_adapter.c   |    8 +-
>   app/test/test_event_eth_tx_adapter.c   |    4 +-
>   app/test/test_event_timer_adapter.c    |    4 +-
>   app/test/test_eventdev.c               |    4 +-
>   app/test/test_fbarray.c                |    4 +-
>   app/test/test_fib.c                    |    8 +-
>   app/test/test_fib6.c                   |    8 +-
>   app/test/test_graph.c                  |    4 +-
>   app/test/test_graph_perf.c             |    4 +-
>   app/test/test_ipfrag.c                 |    4 +-
>   app/test/test_ipsec.c                  |   36 +-
>   app/test/test_ipsec_sad.c              |    4 +-
>   app/test/test_latencystats.c           |    4 +-
>   app/test/test_link_bonding.c           |    4 +-
>   app/test/test_link_bonding_mode4.c     |    4 +-
>   app/test/test_link_bonding_rssconf.c   |    4 +-
>   app/test/test_metrics.c                |    4 +-
>   app/test/test_pmd_ring.c               |    4 +-
>   app/test/test_reorder.c                |    4 +-
>   app/test/test_rib.c                    |    8 +-
>   app/test/test_rib6.c                   |    8 +-
>   app/test/test_security.c               |    4 +-
>   app/test/test_service_cores.c          |    4 +-
>   app/test/test_trace.c                  |    4 +-
>   doc/guides/rel_notes/release_21_05.rst |    5 +
>   36 files changed, 1898 insertions(+), 739 deletions(-)
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [dpdk-dev] [PATCH 1/6] app/test: refactor of unit test suite runner
  2021-03-16 14:32 ` [dpdk-dev] [PATCH 1/6] app/test: refactor of unit test suite runner Ciara Power
@ 2021-03-31 14:42   ` Aaron Conole
  0 siblings, 0 replies; 14+ messages in thread
From: Aaron Conole @ 2021-03-31 14:42 UTC (permalink / raw)
  To: Ciara Power; +Cc: dev, declan.doherty

Ciara Power <ciara.power@intel.com> writes:

> Some small changes were made to the unit test suite runner for
> readability and to enable reuse of some of the function in a later patch.
>
> On test suite setup skip/fail, the loop to count testcases as
> skipped/failed has been moved to another function.
> This will allow for recursion in a later patch when nested sub-testsuites
> are used.
>
> The unit test suite runner accessed the list of testcases in the suite
> structure every time the testcase was used. This is now replaced by a
> testcase variable which improves readability.
>
> The summary output now prints the suite name, this will be useful later
> when multiple nested sub-testsuites are being run.
>
> Signed-off-by: Ciara Power <ciara.power@intel.com>
> ---

I see lots of open coded loops in here.  Does it make sense to have
something like:

  #define FOR_EACH_SUITE_TESTCASE(iter, suite, case) \
          for (iter = 0, case = suite->unit_test_case[0]; \
               suite->unit_test_cases[iter]; \
               iter++, case = suite->unit_test_cases[iter])

Then in code we can do:

   struct unit_test_case tc;
   size_t total;

   FOR_EACH_SUITE_TESTCASE(total, suite, tc) {
       ... check something ...
   }

It would help reading the patch.

>  app/test/test.c | 51 ++++++++++++++++++++++++++++++++-----------------
>  1 file changed, 33 insertions(+), 18 deletions(-)
>
> diff --git a/app/test/test.c b/app/test/test.c
> index 624dd48042..72768c8854 100644
> --- a/app/test/test.c
> +++ b/app/test/test.c
> @@ -207,6 +207,23 @@ main(int argc, char **argv)
>  	return ret;
>  }
>  
> +static void
> +unit_test_suite_count_tcs_on_setup_fail(struct unit_test_suite *suite,
> +		int test_success, unsigned int *total, unsigned int *skipped,
> +		unsigned int *failed)
> +{
> +	struct unit_test_case tc;
> +
> +	tc = suite->unit_test_cases[*total];
> +	while (tc.testcase) {
> +		if (!tc.enabled || test_success == TEST_SKIPPED)
> +			(*skipped)++;
> +		else
> +			(*failed)++;
> +		(*total)++;
> +		tc = suite->unit_test_cases[*total];
> +	}
> +}
>  
>  int
>  unit_test_suite_runner(struct unit_test_suite *suite)
> @@ -215,6 +232,7 @@ unit_test_suite_runner(struct unit_test_suite *suite)
>  	unsigned int total = 0, executed = 0, skipped = 0;
>  	unsigned int succeeded = 0, failed = 0, unsupported = 0;
>  	const char *status;
> +	struct unit_test_case tc;
>  
>  	if (suite->suite_name) {
>  		printf(" + ------------------------------------------------------- +\n");
> @@ -228,38 +246,35 @@ unit_test_suite_runner(struct unit_test_suite *suite)
>  			 * setup did not pass, so count all enabled tests and
>  			 * mark them as failed/skipped
>  			 */
> -			while (suite->unit_test_cases[total].testcase) {
> -				if (!suite->unit_test_cases[total].enabled ||
> -				    test_success == TEST_SKIPPED)
> -					skipped++;
> -				else
> -					failed++;
> -				total++;
> -			}
> +			unit_test_suite_count_tcs_on_setup_fail(suite,
> +					test_success, &total,
> +					&skipped, &failed);
>  			goto suite_summary;
>  		}
>  	}
>  
>  	printf(" + ------------------------------------------------------- +\n");
>  
> -	while (suite->unit_test_cases[total].testcase) {
> -		if (!suite->unit_test_cases[total].enabled) {
> +	tc = suite->unit_test_cases[total];
> +	while (tc.testcase) {
> +		if (!tc.enabled) {
>  			skipped++;
>  			total++;
> +			tc = suite->unit_test_cases[total];
>  			continue;
>  		} else {
>  			executed++;
>  		}
>  
>  		/* run test case setup */
> -		if (suite->unit_test_cases[total].setup)
> -			test_success = suite->unit_test_cases[total].setup();
> +		if (tc.setup)
> +			test_success = tc.setup();
>  		else
>  			test_success = TEST_SUCCESS;
>  
>  		if (test_success == TEST_SUCCESS) {
>  			/* run the test case */
> -			test_success = suite->unit_test_cases[total].testcase();
> +			test_success = tc.testcase();
>  			if (test_success == TEST_SUCCESS)
>  				succeeded++;
>  			else if (test_success == TEST_SKIPPED)
> @@ -275,8 +290,8 @@ unit_test_suite_runner(struct unit_test_suite *suite)
>  		}
>  
>  		/* run the test case teardown */
> -		if (suite->unit_test_cases[total].teardown)
> -			suite->unit_test_cases[total].teardown();
> +		if (tc.teardown)
> +			tc.teardown();
>  
>  		if (test_success == TEST_SUCCESS)
>  			status = "succeeded";
> @@ -287,10 +302,10 @@ unit_test_suite_runner(struct unit_test_suite *suite)
>  		else
>  			status = "failed";
>  
> -		printf(" + TestCase [%2d] : %s %s\n", total,
> -				suite->unit_test_cases[total].name, status);
> +		printf(" + TestCase [%2d] : %s %s\n", total, tc.name, status);
>  
>  		total++;
> +		tc = suite->unit_test_cases[total];
>  	}
>  
>  	/* Run test suite teardown */
> @@ -301,7 +316,7 @@ unit_test_suite_runner(struct unit_test_suite *suite)
>  
>  suite_summary:
>  	printf(" + ------------------------------------------------------- +\n");
> -	printf(" + Test Suite Summary \n");
> +	printf(" + Test Suite Summary : %s\n", suite->suite_name);
>  	printf(" + Tests Total :       %2d\n", total);
>  	printf(" + Tests Skipped :     %2d\n", skipped);
>  	printf(" + Tests Executed :    %2d\n", executed);


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [dpdk-dev] [PATCH 2/6] test: introduce parent testsuite format
  2021-03-16 14:32 ` [dpdk-dev] [PATCH 2/6] test: introduce parent testsuite format Ciara Power
@ 2021-03-31 14:42   ` Aaron Conole
  0 siblings, 0 replies; 14+ messages in thread
From: Aaron Conole @ 2021-03-31 14:42 UTC (permalink / raw)
  To: Ciara Power
  Cc: dev, declan.doherty, Fiona Trahe, Ashish Gupta, Thomas Monjalon,
	Ferruh Yigit, Andrew Rybchenko, Abhinandan Gujjar,
	Jay Jayatheerthan, Erik Gabriel Carrillo, Jerin Jacob,
	Anatoly Burakov, Vladimir Medvedkin, Kiran Kumar K,
	Nithin Dabilpuram, Konstantin Ananyev, Bernard Iremonger,
	Reshma Pattan, Chas Williams, Min Hu \(Connor\),
	Bruce Richardson, Akhil Goyal, Harry van Haaren,
	Sunil Kumar Kori

Ciara Power <ciara.power@intel.com> writes:

> The current structure for unit testing only allows for running a
> test suite with nested test cases. This means all test cases for an
> autotest must be in one suite, which is not ideal.
> For example, in some cases we may want to run multiple lists of test
> cases that each require different setup, so should be in separate suites.
>
> The unit test suite struct is modified to hold either a pointer to a
> list of test cases, or a pointer to a list of sub-testsuites.
> A bool value is also introduced here to indicate whether the testsuite
> is a parent suite or not.
>
> Signed-off-by: Ciara Power <ciara.power@intel.com>
> ---
>  app/test/test.c                      | 151 ++++++++++++++++++---------
>  app/test/test.h                      |   6 +-
>  app/test/test_bitratestats.c         |   4 +-
>  app/test/test_compressdev.c          |   4 +-
>  app/test/test_cryptodev.c            |  24 ++---
>  app/test/test_cryptodev_asym.c       |  12 +--
>  app/test/test_ethdev_link.c          |   4 +-
>  app/test/test_event_crypto_adapter.c |   4 +-
>  app/test/test_event_eth_rx_adapter.c |   8 +-
>  app/test/test_event_eth_tx_adapter.c |   4 +-
>  app/test/test_event_timer_adapter.c  |   4 +-
>  app/test/test_eventdev.c             |   4 +-
>  app/test/test_fbarray.c              |   4 +-
>  app/test/test_fib.c                  |   8 +-
>  app/test/test_fib6.c                 |   8 +-
>  app/test/test_graph.c                |   4 +-
>  app/test/test_graph_perf.c           |   4 +-
>  app/test/test_ipfrag.c               |   4 +-
>  app/test/test_ipsec.c                |   4 +-
>  app/test/test_ipsec_sad.c            |   4 +-
>  app/test/test_latencystats.c         |   4 +-
>  app/test/test_link_bonding.c         |   4 +-
>  app/test/test_link_bonding_mode4.c   |   4 +-
>  app/test/test_link_bonding_rssconf.c |   4 +-
>  app/test/test_metrics.c              |   4 +-
>  app/test/test_pmd_ring.c             |   4 +-
>  app/test/test_reorder.c              |   4 +-
>  app/test/test_rib.c                  |   8 +-
>  app/test/test_rib6.c                 |   8 +-
>  app/test/test_security.c             |   4 +-
>  app/test/test_service_cores.c        |   4 +-
>  app/test/test_trace.c                |   4 +-
>  32 files changed, 188 insertions(+), 137 deletions(-)
>
> diff --git a/app/test/test.c b/app/test/test.c
> index 72768c8854..fe40a91f97 100644
> --- a/app/test/test.c
> +++ b/app/test/test.c
> @@ -213,24 +213,37 @@ unit_test_suite_count_tcs_on_setup_fail(struct unit_test_suite *suite,
>  		unsigned int *failed)
>  {
>  	struct unit_test_case tc;
> -
> -	tc = suite->unit_test_cases[*total];
> -	while (tc.testcase) {
> -		if (!tc.enabled || test_success == TEST_SKIPPED)
> -			(*skipped)++;
> -		else
> -			(*failed)++;
> -		(*total)++;
> -		tc = suite->unit_test_cases[*total];
> +	int i, tc_count = 0;
> +
> +	if (suite->parent_testsuite) {
> +		for (i = 0; suite->unit_test_suites[i].suite_name != NULL; i++)
> +			unit_test_suite_count_tcs_on_setup_fail(
> +				&suite->unit_test_suites[i],
> +				test_success, total,
> +				skipped, failed);
> +	} else {
> +		tc = suite->unit_test_cases[tc_count];
> +		while (tc.testcase) {
> +			if (!tc.enabled ||
> +			test_success == TEST_SKIPPED)
> +				(*skipped)++;
> +			else
> +				(*failed)++;
> +			tc_count++;
> +			tc = suite->unit_test_cases[tc_count];
> +		}
> +		*total += tc_count;
>  	}
>  }
>  
>  int
>  unit_test_suite_runner(struct unit_test_suite *suite)
>  {
> -	int test_success;
> +	int test_success, i, ret;
>  	unsigned int total = 0, executed = 0, skipped = 0;
>  	unsigned int succeeded = 0, failed = 0, unsupported = 0;
> +	unsigned int sub_ts_succeeded = 0, sub_ts_failed = 0;
> +	unsigned int sub_ts_skipped = 0, sub_ts_total = 0;
>  	const char *status;
>  	struct unit_test_case tc;
>  
> @@ -255,63 +268,80 @@ unit_test_suite_runner(struct unit_test_suite *suite)
>  
>  	printf(" + ------------------------------------------------------- +\n");
>  
> -	tc = suite->unit_test_cases[total];
> -	while (tc.testcase) {
> -		if (!tc.enabled) {
> -			skipped++;
> -			total++;
> -			tc = suite->unit_test_cases[total];
> -			continue;
> -		} else {
> -			executed++;
> +	if (suite->parent_testsuite) {
> +		for (i = 0; suite->unit_test_suites[i].suite_name != NULL; i++) {
> +			ret = unit_test_suite_runner(&suite->unit_test_suites[i]);
> +			if (ret == TEST_SUCCESS)
> +				sub_ts_succeeded++;
> +			else if (ret == TEST_SKIPPED)
> +				sub_ts_skipped++;
> +			else
> +				sub_ts_failed++;
> +			sub_ts_total++;

I suggest adding these counts to the test suite object itself - that way
we can track them separately.  And we can clear them when we jump into
the unit_test_suite_runner() so that we get fresh counts each time and
don't need to track this information in different ways.

ie:

   void run_test(suite, tc) {
       if (!tc.enabled) {
          suite->skipped++;
       }

       suite->executed++;
       if tc.setup
          res = tc.setup
       else
          res = success

       if res != success
          suite->failed++
          return

       res = tc.testcase()
       switch res {
          case success:
             suite->success++
             break
          case fail:
             suite->fail++
             break
          case skipped:
             suite->skipped++
             break;
          case unsupported:
             suite->unsupported++;
             break;
       }
       if tc.teardown
          tc.teardown()
   }

   ...
   void run_tests_in_suite(suite) {
      struct unit_test_case tc;
      size_t total;

      FOR_EACH_SUITE_TESTCASE(total, suite, tc)
         run_test(suite, tc);
   }
   ...

   FOR_EACH_SUITE_TESTSUITE(total, suite, tsuite) {
       run_tests_in_suite(suite);
   }

   FOR_EACH_SUITE_TESTSUITE(total, suite, tsuite) {
       total_failed += tsuite->failed;
       total_executed += tsuite->executed;
       total_skipped += tsuite->skipped;
       ...
   }

etc..

Does it make sense?

>  		}
> +	} else {
> +		tc = suite->unit_test_cases[total];
> +		while (tc.testcase) {
> +			if (!tc.enabled) {
> +				skipped++;
> +				total++;
> +				tc = suite->unit_test_cases[total];
> +				continue;
> +			} else {
> +				executed++;
> +			}
> +
> +			/* run test case setup */
> +			if (tc.setup)
> +				test_success = tc.setup();
> +			else
> +				test_success = TEST_SUCCESS;
> +
> +			if (test_success == TEST_SUCCESS) {
> +				/* run the test case */
> +				test_success = tc.testcase();
> +				if (test_success == TEST_SUCCESS)
> +					succeeded++;
> +				else if (test_success == TEST_SKIPPED)
> +					skipped++;
> +				else if (test_success == -ENOTSUP)
> +					unsupported++;
> +				else
> +					failed++;
> +			} else if (test_success == -ENOTSUP) {
> +				unsupported++;
> +			} else {
> +				failed++;
> +			}
>  
> -		/* run test case setup */
> -		if (tc.setup)
> -			test_success = tc.setup();
> -		else
> -			test_success = TEST_SUCCESS;
> +			/* run the test case teardown */
> +			if (tc.teardown)
> +				tc.teardown();
>  
> -		if (test_success == TEST_SUCCESS) {
> -			/* run the test case */
> -			test_success = tc.testcase();
>  			if (test_success == TEST_SUCCESS)
> -				succeeded++;
> +				status = "succeeded";
>  			else if (test_success == TEST_SKIPPED)
> -				skipped++;
> +				status = "skipped";
>  			else if (test_success == -ENOTSUP)
> -				unsupported++;
> +				status = "unsupported";
>  			else
> -				failed++;
> -		} else if (test_success == -ENOTSUP) {
> -			unsupported++;
> -		} else {
> -			failed++;
> -		}
> -
> -		/* run the test case teardown */
> -		if (tc.teardown)
> -			tc.teardown();

This got dropped and never re-added anywhere afaict.

> -
> -		if (test_success == TEST_SUCCESS)
> -			status = "succeeded";
> -		else if (test_success == TEST_SKIPPED)
> -			status = "skipped";
> -		else if (test_success == -ENOTSUP)
> -			status = "unsupported";
> -		else
> -			status = "failed";
> +				status = "failed";
>  
> -		printf(" + TestCase [%2d] : %s %s\n", total, tc.name, status);
> +			printf(" + TestCase [%2d] : %s %s\n", total,
> +					tc.name, status);
>  
> -		total++;
> -		tc = suite->unit_test_cases[total];
> +			total++;
> +			tc = suite->unit_test_cases[total];
> +		}
>  	}
>  
>  	/* Run test suite teardown */
>  	if (suite->teardown)
>  		suite->teardown();
>  
> +	if (suite->parent_testsuite)
> +		goto parent_suite_summary;
> +
>  	goto suite_summary;
>  
>  suite_summary:
> @@ -332,4 +362,21 @@ unit_test_suite_runner(struct unit_test_suite *suite)
>  	if (total == skipped)
>  		return TEST_SKIPPED;
>  	return TEST_SUCCESS;
> +
> +parent_suite_summary:
> +	printf(" + ------------------------------------------------------- +\n");
> +	printf(" + Parent Test Suite Summary :  %s\n", suite->suite_name);
> +	printf(" + Sub Testsuites Total :       %2d\n", sub_ts_total);
> +	printf(" + Sub Testsuites Skipped :     %2d\n", sub_ts_skipped);
> +	printf(" + Sub Testsuites Passed :      %2d\n", sub_ts_succeeded);
> +	printf(" + Sub Testsuites Failed :      %2d\n", sub_ts_failed);
> +	printf(" + ------------------------------------------------------- +\n");
> +
> +	last_test_result = failed;
> +
> +	if (sub_ts_failed)
> +		return TEST_FAILED;
> +	if (sub_ts_total == sub_ts_skipped)
> +		return TEST_SKIPPED;
> +	return TEST_SUCCESS;
>  }
> diff --git a/app/test/test.h b/app/test/test.h
> index b07f6c1ef0..3fdac56631 100644
> --- a/app/test/test.h
> +++ b/app/test/test.h
> @@ -138,7 +138,11 @@ struct unit_test_suite {
>  	const char *suite_name;
>  	int (*setup)(void);
>  	void (*teardown)(void);
> -	struct unit_test_case unit_test_cases[];
> +	bool parent_testsuite;
> +	union {
> +		struct unit_test_case *unit_test_cases;
> +		struct unit_test_suite *unit_test_suites;
> +	};

I don't see the advantage to this.  Why not just have the structs as
flat members, and use the NULL of unit_test_suites as your boolean.
It saves on refactor of all the test suites, since those members should
be 0 initialized anyway.  In fact, you are relying on that behavior
(since you don't explicitly set parent_testsuite to 'false') so might as
well make your life easier by not having to touch all the test suite
files.

ie: instead of

  if (suite->parent_testsuite)
     FOR_EACH_SUITE_TESTSUITE
  else
     FOR_EACH_SUITE_TESTCASE

you could just do:

  struct unit_test_case tc;
  struct unit_test_suite ts;
  size_t total;

  if (suite->unit_test_suite && suite->unit_test_case)
     /* is this prohibited? */

  FOR_EACH_SUITE_TESTCASE(total, suite, tc);
      ...
  FOR_EACH_SUITE_TESTSUITE(total, suite, ts)
      ...

This also makes reading the code a bit nicer.

>  };
>  
>  int unit_test_suite_runner(struct unit_test_suite *suite);
> diff --git a/app/test/test_bitratestats.c b/app/test/test_bitratestats.c
> index f4a92c9be6..a3fe5e839a 100644
> --- a/app/test/test_bitratestats.c
> +++ b/app/test/test_bitratestats.c
> @@ -189,7 +189,7 @@ unit_test_suite bitratestats_testsuite  = {
>  	.suite_name = "BitRate Stats Unit Test Suite",
>  	.setup = test_bit_ring_setup,
>  	.teardown = test_bit_ring_free,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  		/* TEST CASE 1: Test to create bit rate data */
>  		TEST_CASE(test_stats_bitrate_create),
>  
> @@ -231,7 +231,7 @@ unit_test_suite bitratestats_testsuite  = {
>  		/* TEST CASE 9: Test to do the cleanup w.r.t create */
>  		TEST_CASE(test_stats_bitrate_free),
>  		TEST_CASES_END()
> -	}
> +	})
>  };
>  
>  static int
> diff --git a/app/test/test_compressdev.c b/app/test/test_compressdev.c
> index 0571c17ecb..7789511bd0 100644
> --- a/app/test/test_compressdev.c
> +++ b/app/test/test_compressdev.c
> @@ -4183,7 +4183,7 @@ static struct unit_test_suite compressdev_testsuite  = {
>  	.suite_name = "compressdev unit test suite",
>  	.setup = testsuite_setup,
>  	.teardown = testsuite_teardown,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  		TEST_CASE_ST(NULL, NULL,
>  			test_compressdev_invalid_configuration),
>  		TEST_CASE_ST(generic_ut_setup, generic_ut_teardown,
> @@ -4261,7 +4261,7 @@ static struct unit_test_suite compressdev_testsuite  = {
>  		      test_compressdev_deflate_im_buffers_SGL_over_2ops_second),
>  
>  		TEST_CASES_END() /**< NULL terminate unit test array */
> -	}
> +	})
>  };
>  
>  static int
> diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
> index f91debc168..bdfb2727dd 100644
> --- a/app/test/test_cryptodev.c
> +++ b/app/test/test_cryptodev.c
> @@ -13247,7 +13247,7 @@ static struct unit_test_suite cryptodev_scheduler_testsuite  = {
>  	.suite_name = "Crypto Device Scheduler Unit Test Suite",
>  	.setup = testsuite_setup,
>  	.teardown = testsuite_teardown,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  		/* Multi Core */
>  		TEST_CASE_ST(NULL, NULL, test_scheduler_attach_slave_op),
>  		TEST_CASE_ST(NULL, NULL, test_scheduler_mode_multicore_op),
> @@ -13281,7 +13281,7 @@ static struct unit_test_suite cryptodev_scheduler_testsuite  = {
>  		TEST_CASE_ST(NULL, NULL, test_scheduler_detach_slave_op),
>  
>  		TEST_CASES_END() /**< NULL terminate unit test array */
> -	}
> +	})
>  };
>  
>  #endif /* RTE_CRYPTO_SCHEDULER */
> @@ -13290,7 +13290,7 @@ static struct unit_test_suite cryptodev_testsuite  = {
>  	.suite_name = "Crypto Unit Test Suite",
>  	.setup = testsuite_setup,
>  	.teardown = testsuite_teardown,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  		TEST_CASE_ST(ut_setup, ut_teardown,
>  				test_device_configure_invalid_dev_id),
>  		TEST_CASE_ST(ut_setup, ut_teardown,
> @@ -13921,25 +13921,25 @@ static struct unit_test_suite cryptodev_testsuite  = {
>  		TEST_CASE_ST(ut_setup, ut_teardown, test_enq_callback_setup),
>  		TEST_CASE_ST(ut_setup, ut_teardown, test_deq_callback_setup),
>  		TEST_CASES_END() /**< NULL terminate unit test array */
> -	}
> +	})
>  };
>  
>  static struct unit_test_suite cryptodev_virtio_testsuite = {
>  	.suite_name = "Crypto VIRTIO Unit Test Suite",
>  	.setup = testsuite_setup,
>  	.teardown = testsuite_teardown,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_cipheronly_all),
>  
>  		TEST_CASES_END() /**< NULL terminate unit test array */
> -	}
> +	})
>  };
>  
>  static struct unit_test_suite cryptodev_caam_jr_testsuite  = {
>  	.suite_name = "Crypto CAAM JR Unit Test Suite",
>  	.setup = testsuite_setup,
>  	.teardown = testsuite_teardown,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  		TEST_CASE_ST(ut_setup, ut_teardown,
>  			     test_device_configure_invalid_dev_id),
>  		TEST_CASE_ST(ut_setup, ut_teardown,
> @@ -13952,14 +13952,14 @@ static struct unit_test_suite cryptodev_caam_jr_testsuite  = {
>  		TEST_CASE_ST(ut_setup, ut_teardown, test_authonly_all),
>  
>  		TEST_CASES_END() /**< NULL terminate unit test array */
> -	}
> +	})
>  };
>  
>  static struct unit_test_suite cryptodev_mrvl_testsuite  = {
>  	.suite_name = "Crypto Device Marvell Component Test Suite",
>  	.setup = testsuite_setup,
>  	.teardown = testsuite_teardown,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  		TEST_CASE_ST(ut_setup, ut_teardown, test_multi_session),
>  		TEST_CASE_ST(ut_setup, ut_teardown,
>  				test_multi_session_random_usage),
> @@ -13980,14 +13980,14 @@ static struct unit_test_suite cryptodev_mrvl_testsuite  = {
>  			auth_decryption_AES128CBC_HMAC_SHA1_fail_tag_corrupt),
>  
>  		TEST_CASES_END() /**< NULL terminate unit test array */
> -	}
> +	})
>  };
>  
>  static struct unit_test_suite cryptodev_ccp_testsuite  = {
>  	.suite_name = "Crypto Device CCP Unit Test Suite",
>  	.setup = testsuite_setup,
>  	.teardown = testsuite_teardown,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  		TEST_CASE_ST(ut_setup, ut_teardown, test_multi_session),
>  		TEST_CASE_ST(ut_setup, ut_teardown,
>  				test_multi_session_random_usage),
> @@ -14008,7 +14008,7 @@ static struct unit_test_suite cryptodev_ccp_testsuite  = {
>  			auth_decryption_AES128CBC_HMAC_SHA1_fail_tag_corrupt),
>  
>  		TEST_CASES_END() /**< NULL terminate unit test array */
> -	}
> +	})
>  };
>  
>  static int
> diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c
> index 85cd076059..4a2c0a310f 100644
> --- a/app/test/test_cryptodev_asym.c
> +++ b/app/test/test_cryptodev_asym.c
> @@ -2288,7 +2288,7 @@ static struct unit_test_suite cryptodev_openssl_asym_testsuite  = {
>  	.suite_name = "Crypto Device OPENSSL ASYM Unit Test Suite",
>  	.setup = testsuite_setup,
>  	.teardown = testsuite_teardown,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  		TEST_CASE_ST(ut_setup, ut_teardown, test_capability),
>  		TEST_CASE_ST(ut_setup, ut_teardown, test_dsa),
>  		TEST_CASE_ST(ut_setup, ut_teardown, test_dh_keygenration),
> @@ -2300,24 +2300,24 @@ static struct unit_test_suite cryptodev_openssl_asym_testsuite  = {
>  		TEST_CASE_ST(ut_setup, ut_teardown, test_mod_exp),
>  		TEST_CASE_ST(ut_setup, ut_teardown, test_one_by_one),
>  		TEST_CASES_END() /**< NULL terminate unit test array */
> -	}
> +	})
>  };
>  
>  static struct unit_test_suite cryptodev_qat_asym_testsuite  = {
>  	.suite_name = "Crypto Device QAT ASYM Unit Test Suite",
>  	.setup = testsuite_setup,
>  	.teardown = testsuite_teardown,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  		TEST_CASE_ST(ut_setup, ut_teardown, test_one_by_one),
>  		TEST_CASES_END() /**< NULL terminate unit test array */
> -	}
> +	})
>  };
>  
>  static struct unit_test_suite cryptodev_octeontx_asym_testsuite  = {
>  	.suite_name = "Crypto Device OCTEONTX ASYM Unit Test Suite",
>  	.setup = testsuite_setup,
>  	.teardown = testsuite_teardown,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  		TEST_CASE_ST(ut_setup, ut_teardown, test_capability),
>  		TEST_CASE_ST(ut_setup, ut_teardown, test_rsa_enc_dec_crt),
>  		TEST_CASE_ST(ut_setup, ut_teardown, test_rsa_sign_verify_crt),
> @@ -2326,7 +2326,7 @@ static struct unit_test_suite cryptodev_octeontx_asym_testsuite  = {
>  			     test_ecdsa_sign_verify_all_curve),
>  		TEST_CASE_ST(ut_setup, ut_teardown, test_ecpm_all_curve),
>  		TEST_CASES_END() /**< NULL terminate unit test array */
> -	}
> +	})
>  };
>  
>  static int
> diff --git a/app/test/test_ethdev_link.c b/app/test/test_ethdev_link.c
> index ee11987bae..1f3ac34b5f 100644
> --- a/app/test/test_ethdev_link.c
> +++ b/app/test/test_ethdev_link.c
> @@ -148,13 +148,13 @@ static struct unit_test_suite link_status_testsuite = {
>  	.suite_name = "link status formatting",
>  	.setup = NULL,
>  	.teardown = NULL,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  		TEST_CASE(test_link_status_up_default),
>  		TEST_CASE(test_link_status_down_default),
>  		TEST_CASE(test_link_speed_all_values),
>  		TEST_CASE(test_link_status_invalid),
>  		TEST_CASES_END() /**< NULL terminate unit test array */
> -	}
> +	})
>  };
>  
>  static int
> diff --git a/app/test/test_event_crypto_adapter.c b/app/test/test_event_crypto_adapter.c
> index 335211cd8c..722e2f1b7c 100644
> --- a/app/test/test_event_crypto_adapter.c
> +++ b/app/test/test_event_crypto_adapter.c
> @@ -959,7 +959,7 @@ static struct unit_test_suite functional_testsuite = {
>  	.suite_name = "Event crypto adapter test suite",
>  	.setup = testsuite_setup,
>  	.teardown = testsuite_teardown,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  
>  		TEST_CASE_ST(NULL, test_crypto_adapter_free,
>  				test_crypto_adapter_create),
> @@ -989,7 +989,7 @@ static struct unit_test_suite functional_testsuite = {
>  				test_sessionless_with_op_new_mode),
>  
>  		TEST_CASES_END() /**< NULL terminate unit test array */
> -	}
> +	})
>  };
>  
>  static int
> diff --git a/app/test/test_event_eth_rx_adapter.c b/app/test/test_event_eth_rx_adapter.c
> index 9198767b41..735d5766d6 100644
> --- a/app/test/test_event_eth_rx_adapter.c
> +++ b/app/test/test_event_eth_rx_adapter.c
> @@ -754,7 +754,7 @@ static struct unit_test_suite event_eth_rx_tests = {
>  	.suite_name = "rx event eth adapter test suite",
>  	.setup = testsuite_setup,
>  	.teardown = testsuite_teardown,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  		TEST_CASE_ST(NULL, NULL, adapter_create_free),
>  		TEST_CASE_ST(adapter_create, adapter_free,
>  					adapter_queue_add_del),
> @@ -763,18 +763,18 @@ static struct unit_test_suite event_eth_rx_tests = {
>  		TEST_CASE_ST(adapter_create, adapter_free, adapter_start_stop),
>  		TEST_CASE_ST(adapter_create, adapter_free, adapter_stats),
>  		TEST_CASES_END() /**< NULL terminate unit test array */
> -	}
> +	})
>  };
>  
>  static struct unit_test_suite event_eth_rx_intr_tests = {
>  	.suite_name = "rx event eth adapter test suite",
>  	.setup = testsuite_setup_rx_intr,
>  	.teardown = testsuite_teardown_rx_intr,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  		TEST_CASE_ST(adapter_create, adapter_free,
>  			adapter_intr_queue_add_del),
>  		TEST_CASES_END() /**< NULL terminate unit test array */
> -	}
> +	})
>  };
>  
>  static int
> diff --git a/app/test/test_event_eth_tx_adapter.c b/app/test/test_event_eth_tx_adapter.c
> index 7073030902..bf67afcc69 100644
> --- a/app/test/test_event_eth_tx_adapter.c
> +++ b/app/test/test_event_eth_tx_adapter.c
> @@ -680,7 +680,7 @@ static struct unit_test_suite event_eth_tx_tests = {
>  	.setup = testsuite_setup,
>  	.teardown = testsuite_teardown,
>  	.suite_name = "tx event eth adapter test suite",
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  		TEST_CASE_ST(NULL, NULL, tx_adapter_create_free),
>  		TEST_CASE_ST(tx_adapter_create, tx_adapter_free,
>  					tx_adapter_queue_add_del),
> @@ -690,7 +690,7 @@ static struct unit_test_suite event_eth_tx_tests = {
>  					tx_adapter_service),
>  		TEST_CASE_ST(NULL, NULL, tx_adapter_dynamic_device),
>  		TEST_CASES_END() /**< NULL terminate unit test array */
> -	}
> +	})
>  };
>  
>  static int
> diff --git a/app/test/test_event_timer_adapter.c b/app/test/test_event_timer_adapter.c
> index ad3f4dcc20..08c3035c7c 100644
> --- a/app/test/test_event_timer_adapter.c
> +++ b/app/test/test_event_timer_adapter.c
> @@ -1779,7 +1779,7 @@ static struct unit_test_suite event_timer_adptr_functional_testsuite  = {
>  	.suite_name = "event timer functional test suite",
>  	.setup = testsuite_setup,
>  	.teardown = testsuite_teardown,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  		TEST_CASE_ST(timdev_setup_usec, timdev_teardown,
>  				test_timer_state),
>  		TEST_CASE_ST(timdev_setup_usec, timdev_teardown,
> @@ -1832,7 +1832,7 @@ static struct unit_test_suite event_timer_adptr_functional_testsuite  = {
>  				adapter_tick_resolution),
>  		TEST_CASE(adapter_create_max),
>  		TEST_CASES_END() /**< NULL terminate unit test array */
> -	}
> +	})
>  };
>  
>  static int
> diff --git a/app/test/test_eventdev.c b/app/test/test_eventdev.c
> index 27ca5a6494..b4b55117b4 100644
> --- a/app/test/test_eventdev.c
> +++ b/app/test/test_eventdev.c
> @@ -934,7 +934,7 @@ static struct unit_test_suite eventdev_common_testsuite  = {
>  	.suite_name = "eventdev common code unit test suite",
>  	.setup = testsuite_setup,
>  	.teardown = testsuite_teardown,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  		TEST_CASE_ST(NULL, NULL,
>  			test_eventdev_count),
>  		TEST_CASE_ST(NULL, NULL,
> @@ -984,7 +984,7 @@ static struct unit_test_suite eventdev_common_testsuite  = {
>  		TEST_CASE_ST(eventdev_setup_device, NULL,
>  			test_eventdev_close),
>  		TEST_CASES_END() /**< NULL terminate unit test array */
> -	}
> +	})
>  };
>  
>  static int
> diff --git a/app/test/test_fbarray.c b/app/test/test_fbarray.c
> index a691bf4458..ff6896d1bc 100644
> --- a/app/test/test_fbarray.c
> +++ b/app/test/test_fbarray.c
> @@ -714,7 +714,7 @@ static struct unit_test_suite fbarray_test_suite = {
>  	.suite_name = "fbarray autotest",
>  	.setup = autotest_setup,
>  	.teardown = autotest_teardown,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  		TEST_CASE(test_invalid),
>  		TEST_CASE(test_basic),
>  		TEST_CASE_ST(first_msk_test_setup, reset_array, test_find),
> @@ -724,7 +724,7 @@ static struct unit_test_suite fbarray_test_suite = {
>  		TEST_CASE_ST(full_msk_test_setup, reset_array, test_find),
>  		TEST_CASE_ST(empty_msk_test_setup, reset_array, test_empty),
>  		TEST_CASES_END()
> -	}
> +	})
>  };
>  
>  static int
> diff --git a/app/test/test_fib.c b/app/test/test_fib.c
> index e46b9934fe..fc574bdf0b 100644
> --- a/app/test/test_fib.c
> +++ b/app/test/test_fib.c
> @@ -375,24 +375,24 @@ static struct unit_test_suite fib_fast_tests = {
>  	.suite_name = "fib autotest",
>  	.setup = NULL,
>  	.teardown = NULL,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  	TEST_CASE(test_create_invalid),
>  	TEST_CASE(test_free_null),
>  	TEST_CASE(test_add_del_invalid),
>  	TEST_CASE(test_get_invalid),
>  	TEST_CASE(test_lookup),
>  	TEST_CASES_END()
> -	}
> +	})
>  };
>  
>  static struct unit_test_suite fib_slow_tests = {
>  	.suite_name = "fib slow autotest",
>  	.setup = NULL,
>  	.teardown = NULL,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  	TEST_CASE(test_multiple_create),
>  	TEST_CASES_END()
> -	}
> +	})
>  };
>  
>  /*
> diff --git a/app/test/test_fib6.c b/app/test/test_fib6.c
> index 74abfc7a5d..4e36ab795e 100644
> --- a/app/test/test_fib6.c
> +++ b/app/test/test_fib6.c
> @@ -384,24 +384,24 @@ static struct unit_test_suite fib6_fast_tests = {
>  	.suite_name = "fib6 autotest",
>  	.setup = NULL,
>  	.teardown = NULL,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  	TEST_CASE(test_create_invalid),
>  	TEST_CASE(test_free_null),
>  	TEST_CASE(test_add_del_invalid),
>  	TEST_CASE(test_get_invalid),
>  	TEST_CASE(test_lookup),
>  	TEST_CASES_END()
> -	}
> +	})
>  };
>  
>  static struct unit_test_suite fib6_slow_tests = {
>  	.suite_name = "fib6 slow autotest",
>  	.setup = NULL,
>  	.teardown = NULL,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  	TEST_CASE(test_multiple_create),
>  	TEST_CASES_END()
> -	}
> +	})
>  };
>  
>  /*
> diff --git a/app/test/test_graph.c b/app/test/test_graph.c
> index 81bdcb9bea..81eef73900 100644
> --- a/app/test/test_graph.c
> +++ b/app/test/test_graph.c
> @@ -815,7 +815,7 @@ static struct unit_test_suite graph_testsuite = {
>  	.suite_name = "Graph library test suite",
>  	.setup = graph_setup,
>  	.teardown = graph_teardown,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  		TEST_CASE(test_update_edges),
>  		TEST_CASE(test_lookup_functions),
>  		TEST_CASE(test_create_graph),
> @@ -823,7 +823,7 @@ static struct unit_test_suite graph_testsuite = {
>  		TEST_CASE(test_graph_walk),
>  		TEST_CASE(test_print_stats),
>  		TEST_CASES_END(), /**< NULL terminate unit test array */
> -	},
> +	}),
>  };
>  
>  static int
> diff --git a/app/test/test_graph_perf.c b/app/test/test_graph_perf.c
> index 296d99a9d3..ae30ab3c41 100644
> --- a/app/test/test_graph_perf.c
> +++ b/app/test/test_graph_perf.c
> @@ -1035,7 +1035,7 @@ static struct unit_test_suite graph_perf_testsuite = {
>  	.suite_name = "Graph library performance test suite",
>  	.setup = graph_perf_setup,
>  	.teardown = graph_perf_teardown,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  		TEST_CASE_ST(graph_init_hr, graph_fini,
>  			     graph_hr_4s_1n_1src_1snk),
>  		TEST_CASE_ST(graph_init_hr_brst_one, graph_fini,
> @@ -1051,7 +1051,7 @@ static struct unit_test_suite graph_perf_testsuite = {
>  		TEST_CASE_ST(graph_init_parallel_tree, graph_fini,
>  			     graph_parallel_tree_5s_4n_4src_4snk),
>  		TEST_CASES_END(), /**< NULL terminate unit test array */
> -	},
> +	}),
>  };
>  
>  static int
> diff --git a/app/test/test_ipfrag.c b/app/test/test_ipfrag.c
> index da8c212f92..b0ac54e422 100644
> --- a/app/test/test_ipfrag.c
> +++ b/app/test/test_ipfrag.c
> @@ -242,12 +242,12 @@ static struct unit_test_suite ipfrag_testsuite  = {
>  	.suite_name = "IP Frag Unit Test Suite",
>  	.setup = testsuite_setup,
>  	.teardown = testsuite_teardown,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  		TEST_CASE_ST(ut_setup, ut_teardown,
>  			     test_ip_frag),
>  
>  		TEST_CASES_END() /**< NULL terminate unit test array */
> -	}
> +	})
>  };
>  
>  static int
> diff --git a/app/test/test_ipsec.c b/app/test/test_ipsec.c
> index d18220a885..bd9fc3f999 100644
> --- a/app/test/test_ipsec.c
> +++ b/app/test/test_ipsec.c
> @@ -2498,7 +2498,7 @@ static struct unit_test_suite ipsec_testsuite  = {
>  	.suite_name = "IPsec NULL Unit Test Suite",
>  	.setup = testsuite_setup,
>  	.teardown = testsuite_teardown,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  		TEST_CASE_ST(ut_setup, ut_teardown,
>  			test_ipsec_crypto_inb_burst_null_null_wrapper),
>  		TEST_CASE_ST(ut_setup, ut_teardown,
> @@ -2528,7 +2528,7 @@ static struct unit_test_suite ipsec_testsuite  = {
>  		TEST_CASE_ST(ut_setup, ut_teardown,
>  			test_ipsec_crypto_inb_burst_2sa_4grp_null_null_wrapper),
>  		TEST_CASES_END() /**< NULL terminate unit test array */
> -	}
> +	})
>  };
>  
>  static int
> diff --git a/app/test/test_ipsec_sad.c b/app/test/test_ipsec_sad.c
> index 491164689e..874b19a286 100644
> --- a/app/test/test_ipsec_sad.c
> +++ b/app/test/test_ipsec_sad.c
> @@ -864,7 +864,7 @@ static struct unit_test_suite ipsec_sad_tests = {
>  	.suite_name = "ipsec sad autotest",
>  	.setup = NULL,
>  	.teardown = NULL,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  		TEST_CASE(test_create_invalid),
>  		TEST_CASE(test_find_existing),
>  		TEST_CASE(test_multiple_create),
> @@ -875,7 +875,7 @@ static struct unit_test_suite ipsec_sad_tests = {
>  		TEST_CASE(test_lookup_adv),
>  		TEST_CASE(test_lookup_order),
>  		TEST_CASES_END()
> -	}
> +	})
>  };
>  
>  static int
> diff --git a/app/test/test_latencystats.c b/app/test/test_latencystats.c
> index 427339904d..f72eee98cc 100644
> --- a/app/test/test_latencystats.c
> +++ b/app/test/test_latencystats.c
> @@ -171,7 +171,7 @@ unit_test_suite latencystats_testsuite = {
>  	.suite_name = "Latency Stats Unit Test Suite",
>  	.setup = test_latency_ring_setup,
>  	.teardown = test_latency_ring_free,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  
>  		/* Test Case 1: To check latency init with
>  		 * metrics init
> @@ -198,7 +198,7 @@ unit_test_suite latencystats_testsuite = {
>  		TEST_CASE_ST(NULL, NULL, test_latency_uninit),
>  
>  		TEST_CASES_END()
> -	}
> +	})
>  };
>  
>  static int test_latencystats(void)
> diff --git a/app/test/test_link_bonding.c b/app/test/test_link_bonding.c
> index 8a5c8310a8..4fa1e0525c 100644
> --- a/app/test/test_link_bonding.c
> +++ b/app/test/test_link_bonding.c
> @@ -5094,7 +5094,7 @@ static struct unit_test_suite link_bonding_test_suite  = {
>  	.suite_name = "Link Bonding Unit Test Suite",
>  	.setup = test_setup,
>  	.teardown = testsuite_teardown,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  		TEST_CASE(test_create_bonded_device),
>  		TEST_CASE(test_create_bonded_device_with_invalid_params),
>  		TEST_CASE(test_add_slave_to_bonded_device),
> @@ -5162,7 +5162,7 @@ static struct unit_test_suite link_bonding_test_suite  = {
>  		TEST_CASE(test_close_bonded_device),
>  
>  		TEST_CASES_END() /**< NULL terminate unit test array */
> -	}
> +	})
>  };
>  
>  
> diff --git a/app/test/test_link_bonding_mode4.c b/app/test/test_link_bonding_mode4.c
> index 2c835fa7ad..aafa2236ce 100644
> --- a/app/test/test_link_bonding_mode4.c
> +++ b/app/test/test_link_bonding_mode4.c
> @@ -1653,7 +1653,7 @@ static struct unit_test_suite link_bonding_mode4_test_suite  = {
>  	.suite_name = "Link Bonding mode 4 Unit Test Suite",
>  	.setup = test_setup,
>  	.teardown = testsuite_teardown,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  		TEST_CASE_NAMED("test_mode4_agg_mode_selection",
>  				test_mode4_agg_mode_selection_wrapper),
>  		TEST_CASE_NAMED("test_mode4_lacp", test_mode4_lacp_wrapper),
> @@ -1667,7 +1667,7 @@ static struct unit_test_suite link_bonding_mode4_test_suite  = {
>  				test_mode4_ext_lacp_wrapper),
>  
>  		TEST_CASES_END() /**< NULL terminate unit test array */
> -	}
> +	})
>  };
>  
>  static int
> diff --git a/app/test/test_link_bonding_rssconf.c b/app/test/test_link_bonding_rssconf.c
> index 5dac60ca1e..58ff4a8971 100644
> --- a/app/test/test_link_bonding_rssconf.c
> +++ b/app/test/test_link_bonding_rssconf.c
> @@ -645,13 +645,13 @@ test_rss_lazy_wrapper(void)
>  static struct unit_test_suite link_bonding_rssconf_test_suite  = {
>  	.suite_name = "RSS Dynamic Configuration for Bonding Unit Test Suite",
>  	.teardown = testsuite_teardown,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  		TEST_CASE_NAMED("test_setup", test_setup_wrapper),
>  		TEST_CASE_NAMED("test_rss", test_rss_wrapper),
>  		TEST_CASE_NAMED("test_rss_lazy", test_rss_lazy_wrapper),
>  
>  		TEST_CASES_END()
> -	}
> +	})
>  };
>  
>  static int
> diff --git a/app/test/test_metrics.c b/app/test/test_metrics.c
> index e736019ae4..d80be0e5b4 100644
> --- a/app/test/test_metrics.c
> +++ b/app/test/test_metrics.c
> @@ -275,7 +275,7 @@ static struct unit_test_suite metrics_testsuite  = {
>  	.suite_name = "Metrics Unit Test Suite",
>  	.setup = NULL,
>  	.teardown = NULL,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  		/* Test Case 1: Test to check all metric APIs without
>  		 * metrics init
>  		 */
> @@ -317,7 +317,7 @@ static struct unit_test_suite metrics_testsuite  = {
>  		TEST_CASE(test_metrics_deinitialize),
>  
>  		TEST_CASES_END()
> -	}
> +	})
>  };
>  
>  static int
> diff --git a/app/test/test_pmd_ring.c b/app/test/test_pmd_ring.c
> index 86b1db2c1f..9ef667aed7 100644
> --- a/app/test/test_pmd_ring.c
> +++ b/app/test/test_pmd_ring.c
> @@ -576,7 +576,7 @@ unit_test_suite test_pmd_ring_suite  = {
>  	.setup = test_pmd_ringcreate_setup,
>  	.teardown = test_cleanup_resources,
>  	.suite_name = "Test Pmd Ring Unit Test Suite",
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  		TEST_CASE(test_ethdev_configure_ports),
>  		TEST_CASE(test_send_basic_packets),
>  		TEST_CASE(test_get_stats_for_port),
> @@ -584,7 +584,7 @@ unit_test_suite test_pmd_ring_suite  = {
>  		TEST_CASE(test_pmd_ring_pair_create_attach),
>  		TEST_CASE(test_command_line_ring_port),
>  		TEST_CASES_END()
> -	}
> +	})
>  };
>  
>  static int
> diff --git a/app/test/test_reorder.c b/app/test/test_reorder.c
> index 1c4226da65..04bdf4a2d1 100644
> --- a/app/test/test_reorder.c
> +++ b/app/test/test_reorder.c
> @@ -373,7 +373,7 @@ static struct unit_test_suite reorder_test_suite  = {
>  	.setup = test_setup,
>  	.teardown = test_teardown,
>  	.suite_name = "Reorder Unit Test Suite",
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  		TEST_CASE(test_reorder_create),
>  		TEST_CASE(test_reorder_init),
>  		TEST_CASE(test_reorder_find_existing),
> @@ -381,7 +381,7 @@ static struct unit_test_suite reorder_test_suite  = {
>  		TEST_CASE(test_reorder_insert),
>  		TEST_CASE(test_reorder_drain),
>  		TEST_CASES_END()
> -	}
> +	})
>  };
>  
>  static int
> diff --git a/app/test/test_rib.c b/app/test/test_rib.c
> index 3dc48fe1f2..8a2a7d68aa 100644
> --- a/app/test/test_rib.c
> +++ b/app/test/test_rib.c
> @@ -327,7 +327,7 @@ static struct unit_test_suite rib_tests = {
>  	.suite_name = "rib autotest",
>  	.setup = NULL,
>  	.teardown = NULL,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  		TEST_CASE(test_create_invalid),
>  		TEST_CASE(test_free_null),
>  		TEST_CASE(test_insert_invalid),
> @@ -335,17 +335,17 @@ static struct unit_test_suite rib_tests = {
>  		TEST_CASE(test_basic),
>  		TEST_CASE(test_tree_traversal),
>  		TEST_CASES_END()
> -	}
> +	})
>  };
>  
>  static struct unit_test_suite rib_slow_tests = {
>  	.suite_name = "rib slow autotest",
>  	.setup = NULL,
>  	.teardown = NULL,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  		TEST_CASE(test_multiple_create),
>  		TEST_CASES_END()
> -	}
> +	})
>  };
>  
>  /*
> diff --git a/app/test/test_rib6.c b/app/test/test_rib6.c
> index c77df11298..c381c68ce6 100644
> --- a/app/test/test_rib6.c
> +++ b/app/test/test_rib6.c
> @@ -332,7 +332,7 @@ static struct unit_test_suite rib6_tests = {
>  	.suite_name = "rib6 autotest",
>  	.setup = NULL,
>  	.teardown = NULL,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  		TEST_CASE(test_create_invalid),
>  		TEST_CASE(test_free_null),
>  		TEST_CASE(test_insert_invalid),
> @@ -340,17 +340,17 @@ static struct unit_test_suite rib6_tests = {
>  		TEST_CASE(test_basic),
>  		TEST_CASE(test_tree_traversal),
>  		TEST_CASES_END()
> -	}
> +	})
>  };
>  
>  static struct unit_test_suite rib6_slow_tests = {
>  	.suite_name = "rib6 slow autotest",
>  	.setup = NULL,
>  	.teardown = NULL,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  		TEST_CASE(test_multiple_create),
>  		TEST_CASES_END()
> -	}
> +	})
>  };
>  
>  /*
> diff --git a/app/test/test_security.c b/app/test/test_security.c
> index 060cf1ffa8..583a229c0e 100644
> --- a/app/test/test_security.c
> +++ b/app/test/test_security.c
> @@ -2484,7 +2484,7 @@ static struct unit_test_suite security_testsuite  = {
>  	.suite_name = "generic security",
>  	.setup = testsuite_setup,
>  	.teardown = testsuite_teardown,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  		TEST_CASE_ST(ut_setup, ut_teardown,
>  				test_session_create_inv_context),
>  		TEST_CASE_ST(ut_setup, ut_teardown,
> @@ -2627,7 +2627,7 @@ static struct unit_test_suite security_testsuite  = {
>  				test_capability_get_docsis_match),
>  
>  		TEST_CASES_END() /**< NULL terminate unit test array */
> -	}
> +	})
>  };
>  
>  static int
> diff --git a/app/test/test_service_cores.c b/app/test/test_service_cores.c
> index 37d7172d53..ff4d3aa95a 100644
> --- a/app/test/test_service_cores.c
> +++ b/app/test/test_service_cores.c
> @@ -996,7 +996,7 @@ static struct unit_test_suite service_tests  = {
>  	.suite_name = "service core test suite",
>  	.setup = testsuite_setup,
>  	.teardown = testsuite_teardown,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  		TEST_CASE_ST(dummy_register, NULL, unregister_all),
>  		TEST_CASE_ST(dummy_register, NULL, service_name),
>  		TEST_CASE_ST(dummy_register, NULL, service_get_by_name),
> @@ -1015,7 +1015,7 @@ static struct unit_test_suite service_tests  = {
>  		TEST_CASE_ST(dummy_register, NULL, service_may_be_active),
>  		TEST_CASE_ST(dummy_register, NULL, service_active_two_cores),
>  		TEST_CASES_END() /**< NULL terminate unit test array */
> -	}
> +	})
>  };
>  
>  static int
> diff --git a/app/test/test_trace.c b/app/test/test_trace.c
> index 0f9df83c40..d704ceb8c2 100644
> --- a/app/test/test_trace.c
> +++ b/app/test/test_trace.c
> @@ -176,7 +176,7 @@ static struct unit_test_suite trace_tests = {
>  	.suite_name = "trace autotest",
>  	.setup = NULL,
>  	.teardown = NULL,
> -	.unit_test_cases = {
> +	.unit_test_cases = ((struct unit_test_case []) {
>  		TEST_CASE(test_trace_mode),
>  		TEST_CASE(test_generic_trace_points),
>  		TEST_CASE(test_fp_trace_points),
> @@ -185,7 +185,7 @@ static struct unit_test_suite trace_tests = {
>  		TEST_CASE(test_trace_point_regex),
>  		TEST_CASE(test_trace_points_lookup),
>  		TEST_CASES_END()
> -	}
> +	})
>  };
>  
>  static int


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [dpdk-dev] [PATCH 0/6] test: refactor crypto unit test framework
  2021-03-30 16:15 ` [dpdk-dev] [PATCH 0/6] test: refactor crypto unit test framework Doherty, Declan
@ 2021-03-31 14:43   ` Aaron Conole
  2021-04-02 14:32     ` Power, Ciara
  0 siblings, 1 reply; 14+ messages in thread
From: Aaron Conole @ 2021-03-31 14:43 UTC (permalink / raw)
  To: Doherty\, Declan; +Cc: Ciara Power, dev

"Doherty, Declan" <declan.doherty@intel.com> writes:

> Hey Aaron,
>
> based on the work you've been doing on the unit test documentation we
> would appreciate if you could take a look over this patchset and get
> your thoughts. The primary drive here is to make it easier to get a
> clear picture of what is being executed in the cryptodev testsuite, as
> at the moment there are test suites masquerading as unit tests and the
> output doesn't reflect the actual number of unit tests being executed.

I sent some comments - thanks :)

> Thanks
> Declan
>
> On 16/03/2021 2:32 PM, Ciara Power wrote:
>> The current crypto unit test framework is not granular enough to
>> accurately track unit test results. This is caused by one testcase
>> in a suite actually running multiple testcases, but only returning
>> one result.
>>   The approach taken in this patchset allows a test suite have
>> either a
>> list of sub-testsuites, or a list of testcases as previously used.
>> The unit test suite runner can then recursively iterate and run the
>> sub-testsuites, until it reaches a suite with testcases,
>> and it then runs each testcase as it had done previously.
>>   By allowing this further breakdown into sub-testsuites,
>> a refactor of the crypto unit tests solves the issue of inaccurate
>> reporting, as sub-testsuites can be used in place of the testcases
>> that had multiple testcases hidden on a sub level.
>> The blockcipher tests previously had these hidden testcases,
>> but are now sub-testsuites that are dynamically created and added to a
>> parent test suite, allowing for each testcase status to be reported
>> directly to the runner.
>> The cryptodev test suite is broken down into smaller suites that are
>> used as sub-testsuites, which allows for more flexibility choosing which
>> sub-testsuites should run for the current device autotest.
>> The introduction of sub-testsuites also allows for more precise
>> setup/teardown functions, rather than general ones loaded with
>> conditions as was seen with the initial setup function used for all
>> crypto testsuites.
>>   For example, when running the cryptodev_aesni_mb_autotest,
>> the AESNI MB parent test suite has its own setup function to initialise
>> the AESNI MB device.
>> Various sub-testsuites are added to the parent test suite, such as some
>> of the static suites that were once in the cryptodev_testsuite,
>> and blockcipher suites.
>> The unit test runner can then run the AESNI MB parent test suite,
>> which in turn will run the sub-testsuites.
>>   Documentation will be added in a later version of the patchset,
>> adding to the test document that isn't yet merged. [1]
>>
>> ---
>> [1] https://patchwork.dpdk.org/project/dpdk/patch/20210309155757.615536-1-aconole@redhat.com/
>>
>> Ciara Power (6):
>>    app/test: refactor of unit test suite runner
>>    test: introduce parent testsuite format
>>    test/crypto: refactor to use sub-testsuites
>>    test/crypto: move testsuite params to header file
>>    test/crypto: dynamically build blockcipher suite
>>    doc: add unit test suite change to release notes
>>
>>   app/test/test.c                        |  168 +-
>>   app/test/test.h                        |   22 +-
>>   app/test/test_bitratestats.c           |    4 +-
>>   app/test/test_compressdev.c            |    4 +-
>>   app/test/test_cryptodev.c              | 2020 ++++++++++++++++++------
>>   app/test/test_cryptodev.h              |   20 +
>>   app/test/test_cryptodev_asym.c         |  105 +-
>>   app/test/test_cryptodev_blockcipher.c  |  121 +-
>>   app/test/test_cryptodev_blockcipher.h  |   12 +-
>>   app/test/test_ethdev_link.c            |    4 +-
>>   app/test/test_event_crypto_adapter.c   |    4 +-
>>   app/test/test_event_eth_rx_adapter.c   |    8 +-
>>   app/test/test_event_eth_tx_adapter.c   |    4 +-
>>   app/test/test_event_timer_adapter.c    |    4 +-
>>   app/test/test_eventdev.c               |    4 +-
>>   app/test/test_fbarray.c                |    4 +-
>>   app/test/test_fib.c                    |    8 +-
>>   app/test/test_fib6.c                   |    8 +-
>>   app/test/test_graph.c                  |    4 +-
>>   app/test/test_graph_perf.c             |    4 +-
>>   app/test/test_ipfrag.c                 |    4 +-
>>   app/test/test_ipsec.c                  |   36 +-
>>   app/test/test_ipsec_sad.c              |    4 +-
>>   app/test/test_latencystats.c           |    4 +-
>>   app/test/test_link_bonding.c           |    4 +-
>>   app/test/test_link_bonding_mode4.c     |    4 +-
>>   app/test/test_link_bonding_rssconf.c   |    4 +-
>>   app/test/test_metrics.c                |    4 +-
>>   app/test/test_pmd_ring.c               |    4 +-
>>   app/test/test_reorder.c                |    4 +-
>>   app/test/test_rib.c                    |    8 +-
>>   app/test/test_rib6.c                   |    8 +-
>>   app/test/test_security.c               |    4 +-
>>   app/test/test_service_cores.c          |    4 +-
>>   app/test/test_trace.c                  |    4 +-
>>   doc/guides/rel_notes/release_21_05.rst |    5 +
>>   36 files changed, 1898 insertions(+), 739 deletions(-)
>>


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [dpdk-dev] [PATCH 0/6] test: refactor crypto unit test framework
  2021-03-16 14:32 [dpdk-dev] [PATCH 0/6] test: refactor crypto unit test framework Ciara Power
                   ` (6 preceding siblings ...)
  2021-03-30 16:15 ` [dpdk-dev] [PATCH 0/6] test: refactor crypto unit test framework Doherty, Declan
@ 2021-04-01  3:13 ` Ruifeng Wang
  2021-04-02 14:29   ` Power, Ciara
  7 siblings, 1 reply; 14+ messages in thread
From: Ruifeng Wang @ 2021-04-01  3:13 UTC (permalink / raw)
  To: Ciara Power, dev; +Cc: declan.doherty, nd

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Ciara Power
> Sent: Tuesday, March 16, 2021 10:33 PM
> To: dev@dpdk.org
> Cc: declan.doherty@intel.com; Ciara Power <ciara.power@intel.com>
> Subject: [dpdk-dev] [PATCH 0/6] test: refactor crypto unit test framework
> 
> The current crypto unit test framework is not granular enough to accurately
> track unit test results. This is caused by one testcase in a suite actually
> running multiple testcases, but only returning one result.
> 
> The approach taken in this patchset allows a test suite have either a list of
> sub-testsuites, or a list of testcases as previously used.
> The unit test suite runner can then recursively iterate and run the sub-
> testsuites, until it reaches a suite with testcases, and it then runs each
> testcase as it had done previously.
> 
> By allowing this further breakdown into sub-testsuites, a refactor of the
> crypto unit tests solves the issue of inaccurate reporting, as sub-testsuites
> can be used in place of the testcases that had multiple testcases hidden on a
> sub level.
> The blockcipher tests previously had these hidden testcases, but are now
> sub-testsuites that are dynamically created and added to a parent test suite,
> allowing for each testcase status to be reported directly to the runner.
> The cryptodev test suite is broken down into smaller suites that are used as
> sub-testsuites, which allows for more flexibility choosing which sub-
> testsuites should run for the current device autotest.
> The introduction of sub-testsuites also allows for more precise
> setup/teardown functions, rather than general ones loaded with conditions
> as was seen with the initial setup function used for all crypto testsuites.
> 
> For example, when running the cryptodev_aesni_mb_autotest, the AESNI
> MB parent test suite has its own setup function to initialise the AESNI MB
> device.
> Various sub-testsuites are added to the parent test suite, such as some of
> the static suites that were once in the cryptodev_testsuite, and blockcipher
> suites.
> The unit test runner can then run the AESNI MB parent test suite, which in
> turn will run the sub-testsuites.
> 
> Documentation will be added in a later version of the patchset, adding to the
> test document that isn't yet merged. [1]
> 
> ---
> [1]
> https://patchwork.dpdk.org/project/dpdk/patch/20210309155757.615536-1-
> aconole@redhat.com/
> 
> Ciara Power (6):
>   app/test: refactor of unit test suite runner
>   test: introduce parent testsuite format
>   test/crypto: refactor to use sub-testsuites
>   test/crypto: move testsuite params to header file
>   test/crypto: dynamically build blockcipher suite
>   doc: add unit test suite change to release notes
> 
>  app/test/test.c                        |  168 +-
>  app/test/test.h                        |   22 +-
>  app/test/test_bitratestats.c           |    4 +-
>  app/test/test_compressdev.c            |    4 +-
>  app/test/test_cryptodev.c              | 2020 ++++++++++++++++++------
>  app/test/test_cryptodev.h              |   20 +
>  app/test/test_cryptodev_asym.c         |  105 +-
>  app/test/test_cryptodev_blockcipher.c  |  121 +-
>  app/test/test_cryptodev_blockcipher.h  |   12 +-
>  app/test/test_ethdev_link.c            |    4 +-
>  app/test/test_event_crypto_adapter.c   |    4 +-
>  app/test/test_event_eth_rx_adapter.c   |    8 +-
>  app/test/test_event_eth_tx_adapter.c   |    4 +-
>  app/test/test_event_timer_adapter.c    |    4 +-
>  app/test/test_eventdev.c               |    4 +-
>  app/test/test_fbarray.c                |    4 +-
>  app/test/test_fib.c                    |    8 +-
>  app/test/test_fib6.c                   |    8 +-
>  app/test/test_graph.c                  |    4 +-
>  app/test/test_graph_perf.c             |    4 +-
>  app/test/test_ipfrag.c                 |    4 +-
>  app/test/test_ipsec.c                  |   36 +-
>  app/test/test_ipsec_sad.c              |    4 +-
>  app/test/test_latencystats.c           |    4 +-
>  app/test/test_link_bonding.c           |    4 +-
>  app/test/test_link_bonding_mode4.c     |    4 +-
>  app/test/test_link_bonding_rssconf.c   |    4 +-
>  app/test/test_metrics.c                |    4 +-
>  app/test/test_pmd_ring.c               |    4 +-
>  app/test/test_reorder.c                |    4 +-
>  app/test/test_rib.c                    |    8 +-
>  app/test/test_rib6.c                   |    8 +-
>  app/test/test_security.c               |    4 +-
>  app/test/test_service_cores.c          |    4 +-
>  app/test/test_trace.c                  |    4 +-
>  doc/guides/rel_notes/release_21_05.rst |    5 +
>  36 files changed, 1898 insertions(+), 739 deletions(-)
> 
> --
> 2.25.1

Tested against armv8crypto PMD and the result looks good.
Tested-by: Ruifeng Wang <ruifeng.wang@arm.com>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [dpdk-dev] [PATCH 0/6] test: refactor crypto unit test framework
  2021-04-01  3:13 ` Ruifeng Wang
@ 2021-04-02 14:29   ` Power, Ciara
  0 siblings, 0 replies; 14+ messages in thread
From: Power, Ciara @ 2021-04-02 14:29 UTC (permalink / raw)
  To: Ruifeng Wang, dev; +Cc: Doherty, Declan, nd


>-----Original Message-----
>From: Ruifeng Wang <Ruifeng.Wang@arm.com>
>Sent: Thursday 1 April 2021 04:14
>To: Power, Ciara <ciara.power@intel.com>; dev@dpdk.org
>Cc: Doherty, Declan <declan.doherty@intel.com>; nd <nd@arm.com>
>Subject: RE: [dpdk-dev] [PATCH 0/6] test: refactor crypto unit test framework
>
>> -----Original Message-----
>> From: dev <dev-bounces@dpdk.org> On Behalf Of Ciara Power
>> Sent: Tuesday, March 16, 2021 10:33 PM
>> To: dev@dpdk.org
>> Cc: declan.doherty@intel.com; Ciara Power <ciara.power@intel.com>
>> Subject: [dpdk-dev] [PATCH 0/6] test: refactor crypto unit test
>> framework
>>
>> The current crypto unit test framework is not granular enough to
>> accurately track unit test results. This is caused by one testcase in
>> a suite actually running multiple testcases, but only returning one result.
>>
>> The approach taken in this patchset allows a test suite have either a
>> list of sub-testsuites, or a list of testcases as previously used.
>> The unit test suite runner can then recursively iterate and run the
>> sub- testsuites, until it reaches a suite with testcases, and it then
>> runs each testcase as it had done previously.
>>
>> By allowing this further breakdown into sub-testsuites, a refactor of
>> the crypto unit tests solves the issue of inaccurate reporting, as
>> sub-testsuites can be used in place of the testcases that had multiple
>> testcases hidden on a sub level.
>> The blockcipher tests previously had these hidden testcases, but are
>> now sub-testsuites that are dynamically created and added to a parent
>> test suite, allowing for each testcase status to be reported directly to the
>runner.
>> The cryptodev test suite is broken down into smaller suites that are
>> used as sub-testsuites, which allows for more flexibility choosing
>> which sub- testsuites should run for the current device autotest.
>> The introduction of sub-testsuites also allows for more precise
>> setup/teardown functions, rather than general ones loaded with
>> conditions as was seen with the initial setup function used for all crypto
>testsuites.
>>
>> For example, when running the cryptodev_aesni_mb_autotest, the AESNI
>> MB parent test suite has its own setup function to initialise the
>> AESNI MB device.
>> Various sub-testsuites are added to the parent test suite, such as
>> some of the static suites that were once in the cryptodev_testsuite,
>> and blockcipher suites.
>> The unit test runner can then run the AESNI MB parent test suite,
>> which in turn will run the sub-testsuites.
>>
>> Documentation will be added in a later version of the patchset, adding
>> to the test document that isn't yet merged. [1]
>>
>> ---
>> [1]
>> https://patchwork.dpdk.org/project/dpdk/patch/20210309155757.615536-
>1-
>> aconole@redhat.com/
>>
>> Ciara Power (6):
>>   app/test: refactor of unit test suite runner
>>   test: introduce parent testsuite format
>>   test/crypto: refactor to use sub-testsuites
>>   test/crypto: move testsuite params to header file
>>   test/crypto: dynamically build blockcipher suite
>>   doc: add unit test suite change to release notes
>>
>>  app/test/test.c                        |  168 +-
>>  app/test/test.h                        |   22 +-
>>  app/test/test_bitratestats.c           |    4 +-
>>  app/test/test_compressdev.c            |    4 +-
>>  app/test/test_cryptodev.c              | 2020 ++++++++++++++++++------
>>  app/test/test_cryptodev.h              |   20 +
>>  app/test/test_cryptodev_asym.c         |  105 +-
>>  app/test/test_cryptodev_blockcipher.c  |  121 +-
>>  app/test/test_cryptodev_blockcipher.h  |   12 +-
>>  app/test/test_ethdev_link.c            |    4 +-
>>  app/test/test_event_crypto_adapter.c   |    4 +-
>>  app/test/test_event_eth_rx_adapter.c   |    8 +-
>>  app/test/test_event_eth_tx_adapter.c   |    4 +-
>>  app/test/test_event_timer_adapter.c    |    4 +-
>>  app/test/test_eventdev.c               |    4 +-
>>  app/test/test_fbarray.c                |    4 +-
>>  app/test/test_fib.c                    |    8 +-
>>  app/test/test_fib6.c                   |    8 +-
>>  app/test/test_graph.c                  |    4 +-
>>  app/test/test_graph_perf.c             |    4 +-
>>  app/test/test_ipfrag.c                 |    4 +-
>>  app/test/test_ipsec.c                  |   36 +-
>>  app/test/test_ipsec_sad.c              |    4 +-
>>  app/test/test_latencystats.c           |    4 +-
>>  app/test/test_link_bonding.c           |    4 +-
>>  app/test/test_link_bonding_mode4.c     |    4 +-
>>  app/test/test_link_bonding_rssconf.c   |    4 +-
>>  app/test/test_metrics.c                |    4 +-
>>  app/test/test_pmd_ring.c               |    4 +-
>>  app/test/test_reorder.c                |    4 +-
>>  app/test/test_rib.c                    |    8 +-
>>  app/test/test_rib6.c                   |    8 +-
>>  app/test/test_security.c               |    4 +-
>>  app/test/test_service_cores.c          |    4 +-
>>  app/test/test_trace.c                  |    4 +-
>>  doc/guides/rel_notes/release_21_05.rst |    5 +
>>  36 files changed, 1898 insertions(+), 739 deletions(-)
>>
>> --
>> 2.25.1
>
>Tested against armv8crypto PMD and the result looks good.
>Tested-by: Ruifeng Wang <ruifeng.wang@arm.com>

Thanks for testing this Ruifeng.

I have just sent a v2 of the patchset but didn't add the "Tested-by" tag, as it has quite a number of changes.
I don't think the changes should have affected armv8crypto PMD, but if you could test with the new version that would be really appreciated.
https://patchwork.dpdk.org/project/dpdk/list/?series=16085

Thanks!
Ciara



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [dpdk-dev] [PATCH 0/6] test: refactor crypto unit test framework
  2021-03-31 14:43   ` Aaron Conole
@ 2021-04-02 14:32     ` Power, Ciara
  0 siblings, 0 replies; 14+ messages in thread
From: Power, Ciara @ 2021-04-02 14:32 UTC (permalink / raw)
  To: Aaron Conole, Doherty, Declan; +Cc: dev

Hi Aaron,


>-----Original Message-----
>From: Aaron Conole <aconole@redhat.com>
>Sent: Wednesday 31 March 2021 15:43
>To: Doherty, Declan <declan.doherty@intel.com>
>Cc: Power, Ciara <ciara.power@intel.com>; dev@dpdk.org
>Subject: Re: [PATCH 0/6] test: refactor crypto unit test framework
>
>"Doherty, Declan" <declan.doherty@intel.com> writes:
>
>> Hey Aaron,
>>
>> based on the work you've been doing on the unit test documentation we
>> would appreciate if you could take a look over this patchset and get
>> your thoughts. The primary drive here is to make it easier to get a
>> clear picture of what is being executed in the cryptodev testsuite, as
>> at the moment there are test suites masquerading as unit tests and the
>> output doesn't reflect the actual number of unit tests being executed.
>
>I sent some comments - thanks :)
>

Thanks for the review!
I have sent a v2 including your suggested changes incorporated.
https://patchwork.dpdk.org/project/dpdk/list/?series=16085


>> Thanks
>> Declan
>>
>> On 16/03/2021 2:32 PM, Ciara Power wrote:
>>> The current crypto unit test framework is not granular enough to
>>> accurately track unit test results. This is caused by one testcase in
>>> a suite actually running multiple testcases, but only returning one
>>> result.
>>>   The approach taken in this patchset allows a test suite have either
>>> a list of sub-testsuites, or a list of testcases as previously used.
>>> The unit test suite runner can then recursively iterate and run the
>>> sub-testsuites, until it reaches a suite with testcases, and it then
>>> runs each testcase as it had done previously.
>>>   By allowing this further breakdown into sub-testsuites, a refactor
>>> of the crypto unit tests solves the issue of inaccurate reporting, as
>>> sub-testsuites can be used in place of the testcases that had
>>> multiple testcases hidden on a sub level.
>>> The blockcipher tests previously had these hidden testcases, but are
>>> now sub-testsuites that are dynamically created and added to a parent
>>> test suite, allowing for each testcase status to be reported directly
>>> to the runner.
>>> The cryptodev test suite is broken down into smaller suites that are
>>> used as sub-testsuites, which allows for more flexibility choosing
>>> which sub-testsuites should run for the current device autotest.
>>> The introduction of sub-testsuites also allows for more precise
>>> setup/teardown functions, rather than general ones loaded with
>>> conditions as was seen with the initial setup function used for all
>>> crypto testsuites.
>>>   For example, when running the cryptodev_aesni_mb_autotest, the
>>> AESNI MB parent test suite has its own setup function to initialise
>>> the AESNI MB device.
>>> Various sub-testsuites are added to the parent test suite, such as
>>> some of the static suites that were once in the cryptodev_testsuite,
>>> and blockcipher suites.
>>> The unit test runner can then run the AESNI MB parent test suite,
>>> which in turn will run the sub-testsuites.
>>>   Documentation will be added in a later version of the patchset,
>>> adding to the test document that isn't yet merged. [1]
>>>
>>> ---
>>> [1]
>>> https://patchwork.dpdk.org/project/dpdk/patch/20210309155757.615536-
>1
>>> -aconole@redhat.com/
>>>
>>> Ciara Power (6):
>>>    app/test: refactor of unit test suite runner
>>>    test: introduce parent testsuite format
>>>    test/crypto: refactor to use sub-testsuites
>>>    test/crypto: move testsuite params to header file
>>>    test/crypto: dynamically build blockcipher suite
>>>    doc: add unit test suite change to release notes
>>>
>>>   app/test/test.c                        |  168 +-
>>>   app/test/test.h                        |   22 +-
>>>   app/test/test_bitratestats.c           |    4 +-
>>>   app/test/test_compressdev.c            |    4 +-
>>>   app/test/test_cryptodev.c              | 2020 ++++++++++++++++++------
>>>   app/test/test_cryptodev.h              |   20 +
>>>   app/test/test_cryptodev_asym.c         |  105 +-
>>>   app/test/test_cryptodev_blockcipher.c  |  121 +-
>>>   app/test/test_cryptodev_blockcipher.h  |   12 +-
>>>   app/test/test_ethdev_link.c            |    4 +-
>>>   app/test/test_event_crypto_adapter.c   |    4 +-
>>>   app/test/test_event_eth_rx_adapter.c   |    8 +-
>>>   app/test/test_event_eth_tx_adapter.c   |    4 +-
>>>   app/test/test_event_timer_adapter.c    |    4 +-
>>>   app/test/test_eventdev.c               |    4 +-
>>>   app/test/test_fbarray.c                |    4 +-
>>>   app/test/test_fib.c                    |    8 +-
>>>   app/test/test_fib6.c                   |    8 +-
>>>   app/test/test_graph.c                  |    4 +-
>>>   app/test/test_graph_perf.c             |    4 +-
>>>   app/test/test_ipfrag.c                 |    4 +-
>>>   app/test/test_ipsec.c                  |   36 +-
>>>   app/test/test_ipsec_sad.c              |    4 +-
>>>   app/test/test_latencystats.c           |    4 +-
>>>   app/test/test_link_bonding.c           |    4 +-
>>>   app/test/test_link_bonding_mode4.c     |    4 +-
>>>   app/test/test_link_bonding_rssconf.c   |    4 +-
>>>   app/test/test_metrics.c                |    4 +-
>>>   app/test/test_pmd_ring.c               |    4 +-
>>>   app/test/test_reorder.c                |    4 +-
>>>   app/test/test_rib.c                    |    8 +-
>>>   app/test/test_rib6.c                   |    8 +-
>>>   app/test/test_security.c               |    4 +-
>>>   app/test/test_service_cores.c          |    4 +-
>>>   app/test/test_trace.c                  |    4 +-
>>>   doc/guides/rel_notes/release_21_05.rst |    5 +
>>>   36 files changed, 1898 insertions(+), 739 deletions(-)
>>>


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-04-02 14:32 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-16 14:32 [dpdk-dev] [PATCH 0/6] test: refactor crypto unit test framework Ciara Power
2021-03-16 14:32 ` [dpdk-dev] [PATCH 1/6] app/test: refactor of unit test suite runner Ciara Power
2021-03-31 14:42   ` Aaron Conole
2021-03-16 14:32 ` [dpdk-dev] [PATCH 2/6] test: introduce parent testsuite format Ciara Power
2021-03-31 14:42   ` Aaron Conole
2021-03-16 14:32 ` [dpdk-dev] [PATCH 3/6] test/crypto: refactor to use sub-testsuites Ciara Power
2021-03-16 14:32 ` [dpdk-dev] [PATCH 4/6] test/crypto: move testsuite params to header file Ciara Power
2021-03-16 14:32 ` [dpdk-dev] [PATCH 5/6] test/crypto: dynamically build blockcipher suite Ciara Power
2021-03-16 14:32 ` [dpdk-dev] [PATCH 6/6] doc: add unit test suite change to release notes Ciara Power
2021-03-30 16:15 ` [dpdk-dev] [PATCH 0/6] test: refactor crypto unit test framework Doherty, Declan
2021-03-31 14:43   ` Aaron Conole
2021-04-02 14:32     ` Power, Ciara
2021-04-01  3:13 ` Ruifeng Wang
2021-04-02 14:29   ` Power, Ciara

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git