New upstream version 16.11.8
[deb_dpdk.git] / app / test / test_cryptodev.c
index 872f8b4..a1f8717 100644 (file)
@@ -30,6 +30,8 @@
  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include <time.h>
+
 #include <rte_common.h>
 #include <rte_hexdump.h>
 #include <rte_mbuf.h>
@@ -514,7 +516,7 @@ test_device_configure_invalid_dev_id(void)
        dev_id = ts_params->valid_devs[ts_params->valid_dev_count - 1];
 
        /* Stop the device in case it's started so it can be configured */
-       rte_cryptodev_stop(ts_params->valid_devs[dev_id]);
+       rte_cryptodev_stop(dev_id);
 
        TEST_ASSERT_SUCCESS(rte_cryptodev_configure(dev_id, &ts_params->conf),
                        "Failed test for rte_cryptodev_configure: "
@@ -1545,6 +1547,22 @@ test_authonly_openssl_all(void)
        return TEST_SUCCESS;
 }
 
+static int
+test_authonly_qat_all(void)
+{
+       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->valid_devs[0],
+               RTE_CRYPTODEV_QAT_SYM_PMD,
+               BLKCIPHER_AUTHONLY_TYPE);
+
+       TEST_ASSERT_EQUAL(status, 0, "Test failed");
+
+       return TEST_SUCCESS;
+}
+
 /* ***** SNOW 3G Tests ***** */
 static int
 create_wireless_algo_hash_session(uint8_t dev_id,
@@ -2944,8 +2962,7 @@ test_snow3g_encryption_offset_oop(const struct snow3g_test_data *tdata)
        rte_hexdump(stdout, "ciphertext:", ciphertext, plaintext_len);
 #endif
 
-       expected_ciphertext_shifted = rte_malloc(NULL,
-                       ceil_byte_length(plaintext_len + extra_offset), 0);
+       expected_ciphertext_shifted = rte_malloc(NULL, plaintext_len, 8);
 
        TEST_ASSERT_NOT_NULL(expected_ciphertext_shifted,
                        "failed to reserve memory for ciphertext shifted\n");
@@ -4604,7 +4621,7 @@ test_multi_session_random_usage(void)
                                        * dev_info.sym.max_nb_sessions) + 1, 0);
 
        for (i = 0; i < MB_SESSION_NUMBER; i++) {
-               rte_memcpy(&ut_paramz[i].ut_params, &testsuite_params,
+               rte_memcpy(&ut_paramz[i].ut_params, &unittest_params,
                                sizeof(struct crypto_unittest_params));
 
                test_AES_CBC_HMAC_SHA512_decrypt_create_session_params(
@@ -6035,6 +6052,7 @@ static struct unit_test_suite cryptodev_qat_testsuite  = {
                TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_chain_qat_all),
                TEST_CASE_ST(ut_setup, ut_teardown,
                                                test_3DES_cipheronly_qat_all),
+               TEST_CASE_ST(ut_setup, ut_teardown, test_authonly_qat_all),
                TEST_CASE_ST(ut_setup, ut_teardown, test_stats),
 
                /** AES GCM Authenticated Encryption */