diff mbox series

test/crypto: refactor docsis to show hidden cases

Message ID 20211022105302.3652-1-rebecca.troy@intel.com (mailing list archive)
State Superseded, archived
Delegated to: akhil goyal
Headers show
Series test/crypto: refactor docsis to show hidden cases | expand

Checks

Context Check Description
ci/intel-Testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/github-robot: build success github build: passed
ci/checkpatch success coding style OK

Commit Message

Rebecca Troy Oct. 22, 2021, 10:53 a.m. UTC
In the current implementation, the docsis test cases are running
and being reported as one test, despite the fact that multiple
test cases are hidden inside i.e. "test_DOCSIS_PROTO_all" runs
52 test cases. Each docsis test case should be reported individually
instead.

This commit achieves this by removing the use of the
test_DOCSIS_PROTO_all function and statically listing the test cases
to run when building the test suite, which are then reported to the
user by description.

Signed-off-by: Rebecca Troy <rebecca.troy@intel.com>
---
 app/test/test_cryptodev.c                     | 265 +++++++-----------
 ...t_cryptodev_security_docsis_test_vectors.h | 159 +++++++++--
 2 files changed, 241 insertions(+), 183 deletions(-)

Comments

Coyle, David Oct. 28, 2021, 10:34 a.m. UTC | #1
Hi Rebecca, see below


> -----Original Message-----
> From: Troy, Rebecca <rebecca.troy@intel.com>
> 
> In the current implementation, the docsis test cases are running and being
> reported as one test, despite the fact that multiple test cases are hidden
> inside i.e. "test_DOCSIS_PROTO_all" runs
> 52 test cases. Each docsis test case should be reported individually instead.

[DC] Should make "docsis" all uppercase in the commit message - "DOCSIS"

> 
> This commit achieves this by removing the use of the
> test_DOCSIS_PROTO_all function and statically listing the test cases to run
> when building the test suite, which are then reported to the user by
> description.
> 
> Signed-off-by: Rebecca Troy <rebecca.troy@intel.com>
> ---
>  app/test/test_cryptodev.c                     | 265 +++++++-----------
>  ...t_cryptodev_security_docsis_test_vectors.h | 159 +++++++++--
>  2 files changed, 241 insertions(+), 183 deletions(-)
> 
> 

<snip>

> +
>  static struct unit_test_suite docsis_proto_testsuite  = {
>  	.suite_name = "Docsis Proto Unit Test Suite",

[DC] Outside the specific changes of this patch, but "Docsis" should be all uppercase in the
suite name too - "DOCSIS"... could take this opportunity to fix up this minor one

>  	.setup = docsis_proto_testsuite_setup,
>  	.unit_test_cases = {
> -		TEST_CASE_ST(ut_setup_security, ut_teardown,
> -			test_DOCSIS_PROTO_all),
> +		/* Uplink */
> +		ADD_UPLINK_TESTCASE(docsis_test_case_1)
> +		ADD_UPLINK_TESTCASE(docsis_test_case_2)
> +		ADD_UPLINK_TESTCASE(docsis_test_case_3)
> +		ADD_UPLINK_TESTCASE(docsis_test_case_4)

<snip>

> 
> -struct docsis_test_data docsis_test_case_1 = {
> +const struct docsis_test_data docsis_test_case_1 = {
> +	.test_descr_uplink = {"AES-DOCSIS-BPI-128 and CRC Verify (24-byte "
> +			"frame, Small offset and runt block encryption)"},
> +	.test_descr_downlink = {"CRC Generate and AES-DOCSIS-BPI-128
> (24-byte "
> +			"frame, Small offset and runt block encryption)"},

[DC] This one is my fault when I supplied the descriptions, so apologies about this,
but all the uplink descriptions should say "decryption" instead of "encryption"

Also I think all the descriptions should say "Uplink" or "Downlink" at the start.
This can be inferred from the order of AES-DOCSIS-BPI and CRC in the description, but
when I ran the test cases, I still had to think are these Uplink or Downlink tests.
It would be much clearer if it's stated explicitly

Regards,
David
Rebecca Troy Oct. 28, 2021, 10:41 a.m. UTC | #2
> -----Original Message-----
> From: Coyle, David <david.coyle@intel.com>
> Sent: Thursday 28 October 2021 11:34
> To: Troy, Rebecca <rebecca.troy@intel.com>; dev@dpdk.org
> Cc: Power, Ciara <ciara.power@intel.com>; Zhang, Roy Fan
> <roy.fan.zhang@intel.com>; Akhil Goyal <gakhil@marvell.com>; Doherty,
> Declan <declan.doherty@intel.com>
> Subject: RE: [PATCH] test/crypto: refactor docsis to show hidden cases
> 
> Hi Rebecca, see below
> 
> 
> > -----Original Message-----
> > From: Troy, Rebecca <rebecca.troy@intel.com>
> >
> > In the current implementation, the docsis test cases are running and
> > being reported as one test, despite the fact that multiple test cases
> > are hidden inside i.e. "test_DOCSIS_PROTO_all" runs
> > 52 test cases. Each docsis test case should be reported individually instead.
> 
> [DC] Should make "docsis" all uppercase in the commit message - "DOCSIS"
> 
> >
> > This commit achieves this by removing the use of the
> > test_DOCSIS_PROTO_all function and statically listing the test cases
> > to run when building the test suite, which are then reported to the
> > user by description.
> >
> > Signed-off-by: Rebecca Troy <rebecca.troy@intel.com>
> > ---
> >  app/test/test_cryptodev.c                     | 265 +++++++-----------
> >  ...t_cryptodev_security_docsis_test_vectors.h | 159 +++++++++--
> >  2 files changed, 241 insertions(+), 183 deletions(-)
> >
> >
> 
> <snip>
> 
> > +
> >  static struct unit_test_suite docsis_proto_testsuite  = {
> >  	.suite_name = "Docsis Proto Unit Test Suite",
> 
> [DC] Outside the specific changes of this patch, but "Docsis" should be all
> uppercase in the suite name too - "DOCSIS"... could take this opportunity to
> fix up this minor one
> 
> >  	.setup = docsis_proto_testsuite_setup,
> >  	.unit_test_cases = {
> > -		TEST_CASE_ST(ut_setup_security, ut_teardown,
> > -			test_DOCSIS_PROTO_all),
> > +		/* Uplink */
> > +		ADD_UPLINK_TESTCASE(docsis_test_case_1)
> > +		ADD_UPLINK_TESTCASE(docsis_test_case_2)
> > +		ADD_UPLINK_TESTCASE(docsis_test_case_3)
> > +		ADD_UPLINK_TESTCASE(docsis_test_case_4)
> 
> <snip>
> 
> >
> > -struct docsis_test_data docsis_test_case_1 = {
> > +const struct docsis_test_data docsis_test_case_1 = {
> > +	.test_descr_uplink = {"AES-DOCSIS-BPI-128 and CRC Verify (24-byte "
> > +			"frame, Small offset and runt block encryption)"},
> > +	.test_descr_downlink = {"CRC Generate and AES-DOCSIS-BPI-128
> > (24-byte "
> > +			"frame, Small offset and runt block encryption)"},
> 
> [DC] This one is my fault when I supplied the descriptions, so apologies about
> this, but all the uplink descriptions should say "decryption" instead of
> "encryption"
> 
> Also I think all the descriptions should say "Uplink" or "Downlink" at the
> start.
> This can be inferred from the order of AES-DOCSIS-BPI and CRC in the
> description, but when I ran the test cases, I still had to think are these Uplink
> or Downlink tests.
> It would be much clearer if it's stated explicitly
> 
> Regards,
> David

Great, thanks for the feedback David! Will look at implementing these changes in a v2.

Thanks,
Rebecca.
diff mbox series

Patch

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 814a0b401d..ab9727861c 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -9518,11 +9518,13 @@  test_PDCP_PROTO_all(void)
 }
 
 static int
-test_docsis_proto_uplink(int i, struct docsis_test_data *d_td)
+test_docsis_proto_uplink(const void *data)
 {
+	const struct docsis_test_data *d_td = data;
 	struct crypto_testsuite_params *ts_params = &testsuite_params;
 	struct crypto_unittest_params *ut_params = &unittest_params;
-	uint8_t *plaintext, *ciphertext;
+	uint8_t *plaintext = NULL;
+	uint8_t *ciphertext = NULL;
 	uint8_t *iv_ptr;
 	int32_t cipher_len, crc_len;
 	uint32_t crc_data_len;
@@ -9539,6 +9541,15 @@  test_docsis_proto_uplink(int i, struct docsis_test_data *d_td)
 	const struct rte_cryptodev_symmetric_capability *sym_cap;
 	int j = 0;
 
+	/* Set action type */
+	ut_params->type = gbl_action_type == RTE_SECURITY_ACTION_TYPE_NONE ?
+		RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL :
+		gbl_action_type;
+
+	if (security_proto_supported(ut_params->type,
+			RTE_SECURITY_PROTOCOL_DOCSIS) < 0)
+		return TEST_SKIPPED;
+
 	sec_cap_idx.action = ut_params->type;
 	sec_cap_idx.protocol = RTE_SECURITY_PROTOCOL_DOCSIS;
 	sec_cap_idx.docsis.direction = RTE_SECURITY_DOCSIS_UPLINK;
@@ -9601,8 +9612,8 @@  test_docsis_proto_uplink(int i, struct docsis_test_data *d_td)
 					ts_params->session_priv_mpool);
 
 	if (!ut_params->sec_session) {
-		printf("TestCase %s(%d) line %d: %s\n",
-			__func__, i, __LINE__, "failed to allocate session");
+		printf("Test function %s line %u: failed to allocate session\n",
+			__func__, __LINE__);
 		ret = TEST_FAILED;
 		goto on_err;
 	}
@@ -9611,9 +9622,8 @@  test_docsis_proto_uplink(int i, struct docsis_test_data *d_td)
 	ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
 				RTE_CRYPTO_OP_TYPE_SYMMETRIC);
 	if (!ut_params->op) {
-		printf("TestCase %s(%d) line %d: %s\n",
-			__func__, i, __LINE__,
-			"failed to allocate symmetric crypto operation");
+		printf("Test function %s line %u: failed to allocate symmetric "
+			"crypto operation\n", __func__, __LINE__);
 		ret = TEST_FAILED;
 		goto on_err;
 	}
@@ -9652,16 +9662,15 @@  test_docsis_proto_uplink(int i, struct docsis_test_data *d_td)
 	/* Process crypto operation */
 	if (process_crypto_request(ts_params->valid_devs[0], ut_params->op) ==
 			NULL) {
-		printf("TestCase %s(%d) line %d: %s\n",
-			__func__, i, __LINE__,
-			"failed to process security crypto op");
+		printf("Test function %s line %u: failed to process security "
+			"crypto op\n", __func__, __LINE__);
 		ret = TEST_FAILED;
 		goto on_err;
 	}
 
 	if (ut_params->op->status != RTE_CRYPTO_OP_STATUS_SUCCESS) {
-		printf("TestCase %s(%d) line %d: %s\n",
-			__func__, i, __LINE__, "crypto op processing failed");
+		printf("Test function %s line %u: failed to process crypto op\n",
+			__func__, __LINE__);
 		ret = TEST_FAILED;
 		goto on_err;
 	}
@@ -9671,8 +9680,8 @@  test_docsis_proto_uplink(int i, struct docsis_test_data *d_td)
 
 	if (memcmp(plaintext, d_td->plaintext.data,
 			d_td->plaintext.len - crc_data_len)) {
-		printf("TestCase %s(%d) line %d: %s\n",
-			__func__, i, __LINE__, "plaintext not as expected\n");
+		printf("Test function %s line %u: plaintext not as expected\n",
+			__func__, __LINE__);
 		rte_hexdump(stdout, "expected", d_td->plaintext.data,
 				d_td->plaintext.len);
 		rte_hexdump(stdout, "actual", plaintext, d_td->plaintext.len);
@@ -9695,11 +9704,13 @@  test_docsis_proto_uplink(int i, struct docsis_test_data *d_td)
 }
 
 static int
-test_docsis_proto_downlink(int i, struct docsis_test_data *d_td)
+test_docsis_proto_downlink(const void *data)
 {
+	const struct docsis_test_data *d_td = data;
 	struct crypto_testsuite_params *ts_params = &testsuite_params;
 	struct crypto_unittest_params *ut_params = &unittest_params;
-	uint8_t *plaintext, *ciphertext;
+	uint8_t *plaintext = NULL;
+	uint8_t *ciphertext = NULL;
 	uint8_t *iv_ptr;
 	int32_t cipher_len, crc_len;
 	int ret = TEST_SUCCESS;
@@ -9715,6 +9726,15 @@  test_docsis_proto_downlink(int i, struct docsis_test_data *d_td)
 	const struct rte_cryptodev_symmetric_capability *sym_cap;
 	int j = 0;
 
+	/* Set action type */
+	ut_params->type = gbl_action_type == RTE_SECURITY_ACTION_TYPE_NONE ?
+		RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL :
+		gbl_action_type;
+
+	if (security_proto_supported(ut_params->type,
+			RTE_SECURITY_PROTOCOL_DOCSIS) < 0)
+		return TEST_SKIPPED;
+
 	sec_cap_idx.action = ut_params->type;
 	sec_cap_idx.protocol = RTE_SECURITY_PROTOCOL_DOCSIS;
 	sec_cap_idx.docsis.direction = RTE_SECURITY_DOCSIS_DOWNLINK;
@@ -9777,8 +9797,8 @@  test_docsis_proto_downlink(int i, struct docsis_test_data *d_td)
 					ts_params->session_priv_mpool);
 
 	if (!ut_params->sec_session) {
-		printf("TestCase %s(%d) line %d: %s\n",
-			__func__, i, __LINE__, "failed to allocate session");
+		printf("Test function %s line %u: failed to allocate session\n",
+			__func__, __LINE__);
 		ret = TEST_FAILED;
 		goto on_err;
 	}
@@ -9787,9 +9807,8 @@  test_docsis_proto_downlink(int i, struct docsis_test_data *d_td)
 	ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool,
 				RTE_CRYPTO_OP_TYPE_SYMMETRIC);
 	if (!ut_params->op) {
-		printf("TestCase %s(%d) line %d: %s\n",
-			__func__, i, __LINE__,
-			"failed to allocate security crypto operation");
+		printf("Test function %s line %u: failed to allocate symmetric "
+			"crypto operation\n", __func__, __LINE__);
 		ret = TEST_FAILED;
 		goto on_err;
 	}
@@ -9827,16 +9846,15 @@  test_docsis_proto_downlink(int i, struct docsis_test_data *d_td)
 	/* Process crypto operation */
 	if (process_crypto_request(ts_params->valid_devs[0], ut_params->op) ==
 			NULL) {
-		printf("TestCase %s(%d) line %d: %s\n",
-			__func__, i, __LINE__,
-			"failed to process security crypto op");
+		printf("Test function %s line %u: failed to process crypto op\n",
+			__func__, __LINE__);
 		ret = TEST_FAILED;
 		goto on_err;
 	}
 
 	if (ut_params->op->status != RTE_CRYPTO_OP_STATUS_SUCCESS) {
-		printf("TestCase %s(%d) line %d: %s\n",
-			__func__, i, __LINE__, "crypto op processing failed");
+		printf("Test function %s line %u: crypto op processing failed\n",
+			__func__, __LINE__);
 		ret = TEST_FAILED;
 		goto on_err;
 	}
@@ -9845,8 +9863,8 @@  test_docsis_proto_downlink(int i, struct docsis_test_data *d_td)
 	ciphertext = plaintext;
 
 	if (memcmp(ciphertext, d_td->ciphertext.data, d_td->ciphertext.len)) {
-		printf("TestCase %s(%d) line %d: %s\n",
-			__func__, i, __LINE__, "ciphertext not as expected\n");
+		printf("Test function %s line %u: plaintext not as expected\n",
+			__func__, __LINE__);
 		rte_hexdump(stdout, "expected", d_td->ciphertext.data,
 				d_td->ciphertext.len);
 		rte_hexdump(stdout, "actual", ciphertext, d_td->ciphertext.len);
@@ -9867,133 +9885,6 @@  test_docsis_proto_downlink(int i, struct docsis_test_data *d_td)
 
 	return ret;
 }
-
-#define TEST_DOCSIS_COUNT(func) do {			\
-	int ret = func;					\
-	if (ret == TEST_SUCCESS)  {			\
-		printf("\t%2d)", n++);			\
-		printf("+++++ PASSED:" #func"\n");	\
-		p++;					\
-	} else if (ret == TEST_SKIPPED) {		\
-		printf("\t%2d)", n++);			\
-		printf("~~~~~ SKIPPED:" #func"\n");	\
-		s++;					\
-	} else {					\
-		printf("\t%2d)", n++);			\
-		printf("----- FAILED:" #func"\n");	\
-		f++;					\
-	}						\
-} while (0)
-
-static int
-test_DOCSIS_PROTO_uplink_all(void)
-{
-	int p = 0, s = 0, f = 0, n = 0;
-
-	TEST_DOCSIS_COUNT(test_docsis_proto_uplink(1, &docsis_test_case_1));
-	TEST_DOCSIS_COUNT(test_docsis_proto_uplink(2, &docsis_test_case_2));
-	TEST_DOCSIS_COUNT(test_docsis_proto_uplink(3, &docsis_test_case_3));
-	TEST_DOCSIS_COUNT(test_docsis_proto_uplink(4, &docsis_test_case_4));
-	TEST_DOCSIS_COUNT(test_docsis_proto_uplink(5, &docsis_test_case_5));
-	TEST_DOCSIS_COUNT(test_docsis_proto_uplink(6, &docsis_test_case_6));
-	TEST_DOCSIS_COUNT(test_docsis_proto_uplink(7, &docsis_test_case_7));
-	TEST_DOCSIS_COUNT(test_docsis_proto_uplink(8, &docsis_test_case_8));
-	TEST_DOCSIS_COUNT(test_docsis_proto_uplink(9, &docsis_test_case_9));
-	TEST_DOCSIS_COUNT(test_docsis_proto_uplink(10, &docsis_test_case_10));
-	TEST_DOCSIS_COUNT(test_docsis_proto_uplink(11, &docsis_test_case_11));
-	TEST_DOCSIS_COUNT(test_docsis_proto_uplink(12, &docsis_test_case_12));
-	TEST_DOCSIS_COUNT(test_docsis_proto_uplink(13, &docsis_test_case_13));
-	TEST_DOCSIS_COUNT(test_docsis_proto_uplink(14, &docsis_test_case_14));
-	TEST_DOCSIS_COUNT(test_docsis_proto_uplink(15, &docsis_test_case_15));
-	TEST_DOCSIS_COUNT(test_docsis_proto_uplink(16, &docsis_test_case_16));
-	TEST_DOCSIS_COUNT(test_docsis_proto_uplink(17, &docsis_test_case_17));
-	TEST_DOCSIS_COUNT(test_docsis_proto_uplink(18, &docsis_test_case_18));
-	TEST_DOCSIS_COUNT(test_docsis_proto_uplink(19, &docsis_test_case_19));
-	TEST_DOCSIS_COUNT(test_docsis_proto_uplink(20, &docsis_test_case_20));
-	TEST_DOCSIS_COUNT(test_docsis_proto_uplink(21, &docsis_test_case_21));
-	TEST_DOCSIS_COUNT(test_docsis_proto_uplink(22, &docsis_test_case_22));
-	TEST_DOCSIS_COUNT(test_docsis_proto_uplink(23, &docsis_test_case_23));
-	TEST_DOCSIS_COUNT(test_docsis_proto_uplink(24, &docsis_test_case_24));
-	TEST_DOCSIS_COUNT(test_docsis_proto_uplink(25, &docsis_test_case_25));
-	TEST_DOCSIS_COUNT(test_docsis_proto_uplink(26, &docsis_test_case_26));
-
-	if (f)
-		printf("## %s: %d passed out of %d (%d skipped)\n",
-			__func__, p, n, s);
-
-	return f;
-};
-
-static int
-test_DOCSIS_PROTO_downlink_all(void)
-{
-	int p = 0, s = 0, f = 0, n = 0;
-
-	TEST_DOCSIS_COUNT(test_docsis_proto_downlink(1, &docsis_test_case_1));
-	TEST_DOCSIS_COUNT(test_docsis_proto_downlink(2, &docsis_test_case_2));
-	TEST_DOCSIS_COUNT(test_docsis_proto_downlink(3, &docsis_test_case_3));
-	TEST_DOCSIS_COUNT(test_docsis_proto_downlink(4, &docsis_test_case_4));
-	TEST_DOCSIS_COUNT(test_docsis_proto_downlink(5, &docsis_test_case_5));
-	TEST_DOCSIS_COUNT(test_docsis_proto_downlink(6, &docsis_test_case_6));
-	TEST_DOCSIS_COUNT(test_docsis_proto_downlink(7, &docsis_test_case_7));
-	TEST_DOCSIS_COUNT(test_docsis_proto_downlink(8, &docsis_test_case_8));
-	TEST_DOCSIS_COUNT(test_docsis_proto_downlink(9, &docsis_test_case_9));
-	TEST_DOCSIS_COUNT(test_docsis_proto_downlink(10, &docsis_test_case_10));
-	TEST_DOCSIS_COUNT(test_docsis_proto_downlink(11, &docsis_test_case_11));
-	TEST_DOCSIS_COUNT(test_docsis_proto_downlink(12, &docsis_test_case_12));
-	TEST_DOCSIS_COUNT(test_docsis_proto_downlink(13, &docsis_test_case_13));
-	TEST_DOCSIS_COUNT(test_docsis_proto_downlink(14, &docsis_test_case_14));
-	TEST_DOCSIS_COUNT(test_docsis_proto_downlink(15, &docsis_test_case_15));
-	TEST_DOCSIS_COUNT(test_docsis_proto_downlink(16, &docsis_test_case_16));
-	TEST_DOCSIS_COUNT(test_docsis_proto_downlink(17, &docsis_test_case_17));
-	TEST_DOCSIS_COUNT(test_docsis_proto_downlink(18, &docsis_test_case_18));
-	TEST_DOCSIS_COUNT(test_docsis_proto_downlink(19, &docsis_test_case_19));
-	TEST_DOCSIS_COUNT(test_docsis_proto_downlink(20, &docsis_test_case_20));
-	TEST_DOCSIS_COUNT(test_docsis_proto_downlink(21, &docsis_test_case_21));
-	TEST_DOCSIS_COUNT(test_docsis_proto_downlink(22, &docsis_test_case_22));
-	TEST_DOCSIS_COUNT(test_docsis_proto_downlink(23, &docsis_test_case_23));
-	TEST_DOCSIS_COUNT(test_docsis_proto_downlink(24, &docsis_test_case_24));
-	TEST_DOCSIS_COUNT(test_docsis_proto_downlink(25, &docsis_test_case_25));
-	TEST_DOCSIS_COUNT(test_docsis_proto_downlink(26, &docsis_test_case_26));
-
-	if (f)
-		printf("## %s: %d passed out of %d (%d skipped)\n",
-			__func__, p, n, s);
-
-	return f;
-};
-
-static int
-test_DOCSIS_PROTO_all(void)
-{
-	struct crypto_testsuite_params *ts_params = &testsuite_params;
-	struct crypto_unittest_params *ut_params = &unittest_params;
-	struct rte_cryptodev_info dev_info;
-	int status;
-
-	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
-	uint64_t feat_flags = dev_info.feature_flags;
-
-	if (!(feat_flags & RTE_CRYPTODEV_FF_SECURITY))
-		return TEST_SKIPPED;
-
-	/* Set action type */
-	ut_params->type = gbl_action_type == RTE_SECURITY_ACTION_TYPE_NONE ?
-		RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL :
-		gbl_action_type;
-
-	if (security_proto_supported(ut_params->type,
-			RTE_SECURITY_PROTOCOL_DOCSIS) < 0)
-		return TEST_SKIPPED;
-
-	status = test_DOCSIS_PROTO_uplink_all();
-	status += test_DOCSIS_PROTO_downlink_all();
-
-	if (status)
-		return TEST_FAILED;
-	else
-		return TEST_SUCCESS;
-}
 #endif
 
 static int
@@ -14488,12 +14379,72 @@  static struct unit_test_suite pdcp_proto_testsuite  = {
 	}
 };
 
+#define ADD_UPLINK_TESTCASE(data)						\
+	TEST_CASE_NAMED_WITH_DATA(data.test_descr_uplink, ut_setup_security,	\
+	ut_teardown, test_docsis_proto_uplink, (const void *) &data),		\
+
+#define ADD_DOWNLINK_TESTCASE(data)						\
+	TEST_CASE_NAMED_WITH_DATA(data.test_descr_downlink, ut_setup_security,	\
+	ut_teardown, test_docsis_proto_downlink, (const void *) &data),		\
+
 static struct unit_test_suite docsis_proto_testsuite  = {
 	.suite_name = "Docsis Proto Unit Test Suite",
 	.setup = docsis_proto_testsuite_setup,
 	.unit_test_cases = {
-		TEST_CASE_ST(ut_setup_security, ut_teardown,
-			test_DOCSIS_PROTO_all),
+		/* Uplink */
+		ADD_UPLINK_TESTCASE(docsis_test_case_1)
+		ADD_UPLINK_TESTCASE(docsis_test_case_2)
+		ADD_UPLINK_TESTCASE(docsis_test_case_3)
+		ADD_UPLINK_TESTCASE(docsis_test_case_4)
+		ADD_UPLINK_TESTCASE(docsis_test_case_5)
+		ADD_UPLINK_TESTCASE(docsis_test_case_6)
+		ADD_UPLINK_TESTCASE(docsis_test_case_7)
+		ADD_UPLINK_TESTCASE(docsis_test_case_8)
+		ADD_UPLINK_TESTCASE(docsis_test_case_9)
+		ADD_UPLINK_TESTCASE(docsis_test_case_10)
+		ADD_UPLINK_TESTCASE(docsis_test_case_11)
+		ADD_UPLINK_TESTCASE(docsis_test_case_12)
+		ADD_UPLINK_TESTCASE(docsis_test_case_13)
+		ADD_UPLINK_TESTCASE(docsis_test_case_14)
+		ADD_UPLINK_TESTCASE(docsis_test_case_15)
+		ADD_UPLINK_TESTCASE(docsis_test_case_16)
+		ADD_UPLINK_TESTCASE(docsis_test_case_17)
+		ADD_UPLINK_TESTCASE(docsis_test_case_18)
+		ADD_UPLINK_TESTCASE(docsis_test_case_19)
+		ADD_UPLINK_TESTCASE(docsis_test_case_20)
+		ADD_UPLINK_TESTCASE(docsis_test_case_21)
+		ADD_UPLINK_TESTCASE(docsis_test_case_22)
+		ADD_UPLINK_TESTCASE(docsis_test_case_23)
+		ADD_UPLINK_TESTCASE(docsis_test_case_24)
+		ADD_UPLINK_TESTCASE(docsis_test_case_25)
+		ADD_UPLINK_TESTCASE(docsis_test_case_26)
+		/* Downlink */
+		ADD_DOWNLINK_TESTCASE(docsis_test_case_1)
+		ADD_DOWNLINK_TESTCASE(docsis_test_case_2)
+		ADD_DOWNLINK_TESTCASE(docsis_test_case_3)
+		ADD_DOWNLINK_TESTCASE(docsis_test_case_4)
+		ADD_DOWNLINK_TESTCASE(docsis_test_case_5)
+		ADD_DOWNLINK_TESTCASE(docsis_test_case_6)
+		ADD_DOWNLINK_TESTCASE(docsis_test_case_7)
+		ADD_DOWNLINK_TESTCASE(docsis_test_case_8)
+		ADD_DOWNLINK_TESTCASE(docsis_test_case_9)
+		ADD_DOWNLINK_TESTCASE(docsis_test_case_10)
+		ADD_DOWNLINK_TESTCASE(docsis_test_case_11)
+		ADD_DOWNLINK_TESTCASE(docsis_test_case_12)
+		ADD_DOWNLINK_TESTCASE(docsis_test_case_13)
+		ADD_DOWNLINK_TESTCASE(docsis_test_case_14)
+		ADD_DOWNLINK_TESTCASE(docsis_test_case_15)
+		ADD_DOWNLINK_TESTCASE(docsis_test_case_16)
+		ADD_DOWNLINK_TESTCASE(docsis_test_case_17)
+		ADD_DOWNLINK_TESTCASE(docsis_test_case_18)
+		ADD_DOWNLINK_TESTCASE(docsis_test_case_19)
+		ADD_DOWNLINK_TESTCASE(docsis_test_case_20)
+		ADD_DOWNLINK_TESTCASE(docsis_test_case_21)
+		ADD_DOWNLINK_TESTCASE(docsis_test_case_22)
+		ADD_DOWNLINK_TESTCASE(docsis_test_case_23)
+		ADD_DOWNLINK_TESTCASE(docsis_test_case_24)
+		ADD_DOWNLINK_TESTCASE(docsis_test_case_25)
+		ADD_DOWNLINK_TESTCASE(docsis_test_case_26)
 		TEST_CASES_END() /**< NULL terminate unit test array */
 	}
 };
diff --git a/app/test/test_cryptodev_security_docsis_test_vectors.h b/app/test/test_cryptodev_security_docsis_test_vectors.h
index 2ed57bd563..faff2b0c53 100644
--- a/app/test/test_cryptodev_security_docsis_test_vectors.h
+++ b/app/test/test_cryptodev_security_docsis_test_vectors.h
@@ -12,6 +12,9 @@ 
  */
 
 struct docsis_test_data {
+	const char test_descr_uplink[128];
+	const char test_descr_downlink[128];
+
 	struct {
 		uint8_t data[32];
 		unsigned int len;
@@ -41,7 +44,11 @@  struct docsis_test_data {
 	} ciphertext;
 };
 
-struct docsis_test_data docsis_test_case_1 = {
+const struct docsis_test_data docsis_test_case_1 = {
+	.test_descr_uplink = {"AES-DOCSIS-BPI-128 and CRC Verify (24-byte "
+			"frame, Small offset and runt block encryption)"},
+	.test_descr_downlink = {"CRC Generate and AES-DOCSIS-BPI-128 (24-byte "
+			"frame, Small offset and runt block encryption)"},
 	.key = {
 		.data = {
 			0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
@@ -90,7 +97,11 @@  struct docsis_test_data docsis_test_case_1 = {
 	}
 };
 
-struct docsis_test_data docsis_test_case_2 = {
+const struct docsis_test_data docsis_test_case_2 = {
+	.test_descr_uplink = {"AES-DOCSIS-BPI-128 and CRC Verify (25-byte "
+			"frame, Small offset and runt block encryption)"},
+	.test_descr_downlink = {"CRC Generate and AES-DOCSIS-BPI-128 (25-byte "
+			"frame, Small offset and runt block encryption)"},
 	.key = {
 		.data = {
 			0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
@@ -139,7 +150,11 @@  struct docsis_test_data docsis_test_case_2 = {
 	}
 };
 
-struct docsis_test_data docsis_test_case_3 = {
+const struct docsis_test_data docsis_test_case_3 = {
+	.test_descr_uplink = {"AES-DOCSIS-BPI-128 and CRC Verify (34-byte "
+			"frame, Small offset and full block encryption)"},
+	.test_descr_downlink = {"CRC Generate and AES-DOCSIS-BPI-128 (34-byte "
+			"frame, Small offset and full block encryption)"},
 	.key = {
 		.data = {
 			0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
@@ -190,7 +205,11 @@  struct docsis_test_data docsis_test_case_3 = {
 	}
 };
 
-struct docsis_test_data docsis_test_case_4 = {
+const struct docsis_test_data docsis_test_case_4 = {
+	.test_descr_uplink = {"AES-DOCSIS-BPI-128 and CRC Verify (35-byte "
+			"frame, Small offset and uneven encryption)"},
+	.test_descr_downlink = {"CRC Generate and AES-DOCSIS-BPI-128 (35-byte "
+			"frame, Small offset and uneven encryption)"},
 	.key = {
 		.data = {
 			0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
@@ -243,7 +262,11 @@  struct docsis_test_data docsis_test_case_4 = {
 	}
 };
 
-struct docsis_test_data docsis_test_case_5 = {
+const struct docsis_test_data docsis_test_case_5 = {
+	.test_descr_uplink = {"AES-DOCSIS-BPI-128 and CRC Verify (82-byte "
+			"frame, Small offset and full block encryption)"},
+	.test_descr_downlink = {"CRC Generate and AES-DOCSIS-BPI-128 (82-byte "
+			"frame, Small offset and full block encryption)"},
 	.key = {
 		.data = {
 			0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
@@ -306,7 +329,11 @@  struct docsis_test_data docsis_test_case_5 = {
 	}
 };
 
-struct docsis_test_data docsis_test_case_6 = {
+const struct docsis_test_data docsis_test_case_6 = {
+	.test_descr_uplink = {"AES-DOCSIS-BPI-128 and CRC Verify (83-byte "
+			"frame, Small offset and uneven encryption)"},
+	.test_descr_downlink = {"CRC Generate and AES-DOCSIS-BPI-128 (83-byte "
+			"frame, Small offset and uneven encryption)"},
 	.key = {
 		.data = {
 			0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
@@ -371,7 +398,11 @@  struct docsis_test_data docsis_test_case_6 = {
 	}
 };
 
-struct docsis_test_data docsis_test_case_7 = {
+const struct docsis_test_data docsis_test_case_7 = {
+	.test_descr_uplink = {"AES-DOCSIS-BPI-128 and CRC Verify (83-byte "
+			"frame, Big offset and uneven encryption)"},
+	.test_descr_downlink = {"CRC Generate and AES-DOCSIS-BPI-128 (83-byte "
+			"frame, Big offset and uneven encryption)"},
 	.key = {
 		.data = {
 			0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
@@ -436,7 +467,11 @@  struct docsis_test_data docsis_test_case_7 = {
 	}
 };
 
-struct docsis_test_data docsis_test_case_8 = {
+const struct docsis_test_data docsis_test_case_8 = {
+	.test_descr_uplink = {"AES-DOCSIS-BPI-128 and CRC Verify (24-byte "
+			"frame, No CRC, Small offset and runt block encryption)"},
+	.test_descr_downlink = {"CRC Generate and AES-DOCSIS-BPI-128 (24-byte "
+			"frame, No CRC, Small offset and runt block encryption)"},
 	.key = {
 		.data = {
 			0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
@@ -485,7 +520,11 @@  struct docsis_test_data docsis_test_case_8 = {
 	}
 };
 
-struct docsis_test_data docsis_test_case_9 = {
+const struct docsis_test_data docsis_test_case_9 = {
+	.test_descr_uplink = {"AES-DOCSIS-BPI-128 and CRC Verify (83-byte "
+			"frame, No CRC, Big offset and uneven encryption)"},
+	.test_descr_downlink = {"CRC Generate and AES-DOCSIS-BPI-128 (83-byte "
+			"frame, No CRC, Big offset and uneven encryption)"},
 	.key = {
 		.data = {
 			0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
@@ -550,7 +589,11 @@  struct docsis_test_data docsis_test_case_9 = {
 	}
 };
 
-struct docsis_test_data docsis_test_case_10 = {
+const struct docsis_test_data docsis_test_case_10 = {
+	.test_descr_uplink = {"AES-DOCSIS-BPI-128 and CRC Verify (24-byte "
+			"frame, No encryption)"},
+	.test_descr_downlink = {"CRC Generate and AES-DOCSIS-BPI-128 (24-byte "
+			"frame, No encryption)"},
 	.key = {
 		.data = {
 			0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
@@ -599,7 +642,11 @@  struct docsis_test_data docsis_test_case_10 = {
 	}
 };
 
-struct docsis_test_data docsis_test_case_11 = {
+const struct docsis_test_data docsis_test_case_11 = {
+	.test_descr_uplink = {"AES-DOCSIS-BPI-128 and CRC Verify (83-byte "
+			"frame, No encryption)"},
+	.test_descr_downlink = {"CRC Generate and AES-DOCSIS-BPI-128 (83-byte "
+			"frame, No encryption)"},
 	.key = {
 		.data = {
 			0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
@@ -664,7 +711,11 @@  struct docsis_test_data docsis_test_case_11 = {
 	}
 };
 
-struct docsis_test_data docsis_test_case_12 = {
+const struct docsis_test_data docsis_test_case_12 = {
+	.test_descr_uplink = {"AES-DOCSIS-BPI-128 and CRC Verify (24-byte "
+			"frame, No CRC, No encryption)"},
+	.test_descr_downlink = {"CRC Generate and AES-DOCSIS-BPI-128 (24-byte "
+			"frame, No CRC, No encryption)"},
 	.key = {
 		.data = {
 			0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
@@ -713,7 +764,11 @@  struct docsis_test_data docsis_test_case_12 = {
 	}
 };
 
-struct docsis_test_data docsis_test_case_13 = {
+const struct docsis_test_data docsis_test_case_13 = {
+	.test_descr_uplink = {"AES-DOCSIS-BPI-128 and CRC Verify (83-byte "
+			"frame, No CRC, No encryption)"},
+	.test_descr_downlink = {"CRC Generate and AES-DOCSIS-BPI-128 (83-byte "
+			"frame, No CRC, No encryption)"},
 	.key = {
 		.data = {
 			0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
@@ -778,7 +833,11 @@  struct docsis_test_data docsis_test_case_13 = {
 	}
 };
 
-struct docsis_test_data docsis_test_case_14 = {
+const struct docsis_test_data docsis_test_case_14 = {
+	.test_descr_uplink = {"AES-DOCSIS-BPI-256 and CRC Verify (24-byte "
+			"frame, Small offset and runt block encryption)"},
+	.test_descr_downlink = {"CRC Generate and AES-DOCSIS-BPI-256 (24-byte "
+			"frame, Small offset and runt block encryption)"},
 	.key = {
 		.data = {
 			0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
@@ -829,7 +888,11 @@  struct docsis_test_data docsis_test_case_14 = {
 	}
 };
 
-struct docsis_test_data docsis_test_case_15 = {
+const struct docsis_test_data docsis_test_case_15 = {
+	.test_descr_uplink = {"AES-DOCSIS-BPI-256 and CRC Verify (25-byte "
+			"frame, Small offset and runt block encryption)"},
+	.test_descr_downlink = {"CRC Generate and AES-DOCSIS-BPI-256 (25-byte "
+			"frame, Small offset and runt block encryption)"},
 	.key = {
 		.data = {
 			0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
@@ -880,7 +943,11 @@  struct docsis_test_data docsis_test_case_15 = {
 	}
 };
 
-struct docsis_test_data docsis_test_case_16 = {
+const struct docsis_test_data docsis_test_case_16 = {
+	.test_descr_uplink = {"AES-DOCSIS-BPI-256 and CRC Verify (34-byte "
+			"frame, Small offset and full block encryption)"},
+	.test_descr_downlink = {"CRC Generate and AES-DOCSIS-BPI-256 (34-byte "
+			"frame, Small offset and full block encryption)"},
 	.key = {
 		.data = {
 			0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
@@ -933,7 +1000,11 @@  struct docsis_test_data docsis_test_case_16 = {
 	}
 };
 
-struct docsis_test_data docsis_test_case_17 = {
+const struct docsis_test_data docsis_test_case_17 = {
+	.test_descr_uplink = {"AES-DOCSIS-BPI-256 and CRC Verify (35-byte "
+			"frame, Small offset and uneven encryption)"},
+	.test_descr_downlink = {"CRC Generate and AES-DOCSIS-BPI-256 (35-byte "
+			"frame, Small offset and uneven encryption)"},
 	.key = {
 		.data = {
 			0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
@@ -988,7 +1059,11 @@  struct docsis_test_data docsis_test_case_17 = {
 	}
 };
 
-struct docsis_test_data docsis_test_case_18 = {
+const struct docsis_test_data docsis_test_case_18 = {
+	.test_descr_uplink = {"AES-DOCSIS-BPI-256 and CRC Verify (82-byte "
+			"frame, Small offset and full block encryption)"},
+	.test_descr_downlink = {"CRC Generate and AES-DOCSIS-BPI-256 (82-byte "
+			"frame, Small offset and full block encryption)"},
 	.key = {
 		.data = {
 			0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
@@ -1053,7 +1128,11 @@  struct docsis_test_data docsis_test_case_18 = {
 	}
 };
 
-struct docsis_test_data docsis_test_case_19 = {
+const struct docsis_test_data docsis_test_case_19 = {
+	.test_descr_uplink = {"AES-DOCSIS-BPI-256 and CRC Verify (83-byte "
+			"frame, Small offset and uneven encryption)"},
+	.test_descr_downlink = {"CRC Generate and AES-DOCSIS-BPI-256 (83-byte "
+			"frame, Small offset and uneven encryption)"},
 	.key = {
 		.data = {
 			0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
@@ -1120,7 +1199,11 @@  struct docsis_test_data docsis_test_case_19 = {
 	}
 };
 
-struct docsis_test_data docsis_test_case_20 = {
+const struct docsis_test_data docsis_test_case_20 = {
+	.test_descr_uplink = {"AES-DOCSIS-BPI-256 and CRC Verify (83-byte "
+			"frame, Big offset and uneven encryption)"},
+	.test_descr_downlink = {"CRC Generate and AES-DOCSIS-BPI-256 (83-byte "
+			"frame, Big offset and uneven encryption)"},
 	.key = {
 		.data = {
 			0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
@@ -1187,7 +1270,11 @@  struct docsis_test_data docsis_test_case_20 = {
 	}
 };
 
-struct docsis_test_data docsis_test_case_21 = {
+const struct docsis_test_data docsis_test_case_21 = {
+	.test_descr_uplink = {"AES-DOCSIS-BPI-256 and CRC Verify (24-byte "
+			"frame, No CRC, Small offset and runt block encryption)"},
+	.test_descr_downlink = {"CRC Generate and AES-DOCSIS-BPI-256 (24-byte "
+			"frame, No CRC, Small offset and runt block encryption)"},
 	.key = {
 		.data = {
 			0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
@@ -1238,7 +1325,11 @@  struct docsis_test_data docsis_test_case_21 = {
 	}
 };
 
-struct docsis_test_data docsis_test_case_22 = {
+const struct docsis_test_data docsis_test_case_22 = {
+	.test_descr_uplink = {"AES-DOCSIS-BPI-256 and CRC Verify (83-byte "
+			"frame, No CRC, Big offset and uneven encryption)"},
+	.test_descr_downlink = {"CRC Generate and AES-DOCSIS-BPI-256 (83-byte "
+			"frame, No CRC, Big offset and uneven encryption)"},
 	.key = {
 		.data = {
 			0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
@@ -1305,7 +1396,11 @@  struct docsis_test_data docsis_test_case_22 = {
 	}
 };
 
-struct docsis_test_data docsis_test_case_23 = {
+const struct docsis_test_data docsis_test_case_23 = {
+	.test_descr_uplink = {"AES-DOCSIS-BPI-256 and CRC Verify (24-byte "
+			"frame, No encryption)"},
+	.test_descr_downlink = {"CRC Generate and AES-DOCSIS-BPI-256 (24-byte "
+			"frame, No encryption)"},
 	.key = {
 		.data = {
 			0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
@@ -1356,7 +1451,11 @@  struct docsis_test_data docsis_test_case_23 = {
 	}
 };
 
-struct docsis_test_data docsis_test_case_24 = {
+const struct docsis_test_data docsis_test_case_24 = {
+	.test_descr_uplink = {"AES-DOCSIS-BPI-256 and CRC Verify (83-byte "
+			"frame, No encryption)"},
+	.test_descr_downlink = {"CRC Generate and AES-DOCSIS-BPI-256 (83-byte "
+			"frame, No encryption)"},
 	.key = {
 		.data = {
 			0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
@@ -1423,7 +1522,11 @@  struct docsis_test_data docsis_test_case_24 = {
 	}
 };
 
-struct docsis_test_data docsis_test_case_25 = {
+const struct docsis_test_data docsis_test_case_25 = {
+	.test_descr_uplink = {"AES-DOCSIS-BPI-256 and CRC Verify (24-byte "
+			"frame, No CRC, No encryption)"},
+	.test_descr_downlink = {"CRC Generate and AES-DOCSIS-BPI-256 (24-byte "
+			"frame, No CRC, No encryption)"},
 	.key = {
 		.data = {
 			0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,
@@ -1474,7 +1577,11 @@  struct docsis_test_data docsis_test_case_25 = {
 	}
 };
 
-struct docsis_test_data docsis_test_case_26 = {
+const struct docsis_test_data docsis_test_case_26 = {
+	.test_descr_uplink = {"AES-DOCSIS-BPI-256 and CRC Verify (83-byte "
+			"frame, No CRC, No encryption)"},
+	.test_descr_downlink = {"CRC Generate and AES-DOCSIS-BPI-256 (83-byte "
+			"frame, No CRC, No encryption)"},
 	.key = {
 		.data = {
 			0x00, 0x00, 0x00, 0x00, 0xAA, 0xBB, 0xCC, 0xDD,