This patch adds the GMAC test cases to AESNI-MB crypto unit test.

Signed-off-by: Fan Zhang <roy.fan.zh...@intel.com>
Acked-by: Damian Nowak <damianx.no...@intel.com>
---
 test/test/test_cryptodev.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/test/test/test_cryptodev.c b/test/test/test_cryptodev.c
index 84065eb49..f17054520 100644
--- a/test/test/test_cryptodev.c
+++ b/test/test/test_cryptodev.c
@@ -21,6 +21,10 @@
 #include <rte_cryptodev_scheduler_operations.h>
 #endif
 
+#ifdef RTE_LIBRTE_PMD_AESNI_MB
+#include <intel-ipsec-mb.h>
+#endif
+
 #include <rte_lcore.h>
 
 #include "test.h"
@@ -41,6 +45,11 @@
 #define VDEV_ARGS_SIZE 100
 #define MAX_NB_SESSIONS            4
 
+#if !defined(IMB_VERSION_NUM)
+#define IMB_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + (c))
+#define IMB_VERSION_NUM IMB_VERSION(0, 49, 0)
+#endif
+
 static int gbl_driver_id;
 
 struct crypto_testsuite_params {
@@ -9228,6 +9237,7 @@ static struct unit_test_suite 
cryptodev_aesni_mb_testsuite  = {
        .setup = testsuite_setup,
        .teardown = testsuite_teardown,
        .unit_test_cases = {
+#if IMB_VERSION_NUM >= IMB_VERSION(0, 51, 0)
                TEST_CASE_ST(ut_setup, ut_teardown,
                        test_AES_GCM_authenticated_encryption_test_case_1),
                TEST_CASE_ST(ut_setup, ut_teardown,
@@ -9341,6 +9351,20 @@ static struct unit_test_suite 
cryptodev_aesni_mb_testsuite  = {
                TEST_CASE_ST(ut_setup, ut_teardown,
                        
test_AES_GCM_authenticated_decryption_sessionless_test_case_1),
 
+               /** AES GMAC Authentication */
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_AES_GMAC_authentication_test_case_1),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_AES_GMAC_authentication_verify_test_case_1),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_AES_GMAC_authentication_test_case_2),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_AES_GMAC_authentication_verify_test_case_2),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_AES_GMAC_authentication_test_case_3),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_AES_GMAC_authentication_verify_test_case_3),
+#endif /* IMB_VERSION_NUM >= IMB_VERSION(0, 51, 0) */
 
                TEST_CASE_ST(ut_setup, ut_teardown, test_AES_chain_mb_all),
                TEST_CASE_ST(ut_setup, ut_teardown, test_AES_cipheronly_mb_all),
-- 
2.13.6

Reply via email to