test/threads: add unit test
[dpdk.git] / app / test / test_ipsec.c
index fb90130..8da025b 100644 (file)
@@ -2,6 +2,8 @@
  * Copyright(c) 2018 Intel Corporation
  */
 
+#include "test.h"
+
 #include <time.h>
 
 #include <rte_common.h>
 #include <rte_cycles.h>
 #include <rte_bus_vdev.h>
 #include <rte_ip.h>
-
 #include <rte_crypto.h>
 #include <rte_cryptodev.h>
-#include <rte_cryptodev_pmd.h>
 #include <rte_lcore.h>
+
+#ifdef RTE_EXEC_ENV_WINDOWS
+static int
+test_ipsec(void)
+{
+       printf("ipsec not supported on Windows, skipping test\n");
+       return TEST_SKIPPED;
+}
+
+#else
+
 #include <rte_ipsec.h>
 #include <rte_random.h>
 #include <rte_esp.h>
 #include <rte_security_driver.h>
 
-#include "test.h"
 #include "test_cryptodev.h"
 
 #define VDEV_ARGS_SIZE 100
@@ -654,7 +664,7 @@ create_crypto_session(struct ipsec_unitest_params *ut,
        if (s == NULL)
                return -ENOMEM;
 
-       /* initiliaze SA crypto session for device */
+       /* initialize SA crypto session for device */
        rc = rte_cryptodev_sym_session_init(dev_id, s,
                        ut->crypto_xforms, qp->mp_session_private);
        if (rc == 0) {
@@ -1623,8 +1633,8 @@ inline_outb_burst_null_null_check(struct ipsec_unitest_params *ut_params,
                        "ibuf pkt_len is not equal to obuf pkt_len");
 
                /* check mbuf ol_flags */
-               TEST_ASSERT(ut_params->ibuf[j]->ol_flags & PKT_TX_SEC_OFFLOAD,
-                       "ibuf PKT_TX_SEC_OFFLOAD is not set");
+               TEST_ASSERT(ut_params->ibuf[j]->ol_flags & RTE_MBUF_F_TX_SEC_OFFLOAD,
+                           "ibuf RTE_MBUF_F_TX_SEC_OFFLOAD is not set");
        }
        return 0;
 }
@@ -2537,4 +2547,6 @@ test_ipsec(void)
        return unit_test_suite_runner(&ipsec_testsuite);
 }
 
+#endif /* !RTE_EXEC_ENV_WINDOWS */
+
 REGISTER_TEST_COMMAND(ipsec_autotest, test_ipsec);