summaryrefslogtreecommitdiffstats
path: root/app/test
diff options
context:
space:
mode:
Diffstat (limited to 'app/test')
-rw-r--r--app/test/test_cryptodev.c14
-rw-r--r--app/test/test_hash_multiwriter.c10
2 files changed, 12 insertions, 12 deletions
diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 647787d2..afc02aa4 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -2988,13 +2988,13 @@ test_snow3g_encrypted_authentication_test_case_1(void)
static int
create_gcm_session(uint8_t dev_id, enum rte_crypto_cipher_operation op,
const uint8_t *key, const uint8_t key_len,
- const uint8_t aad_len, const uint8_t auth_len)
+ const uint8_t aad_len, const uint8_t auth_len,
+ enum rte_crypto_auth_operation auth_op)
{
uint8_t cipher_key[key_len];
struct crypto_unittest_params *ut_params = &unittest_params;
-
memcpy(cipher_key, key, key_len);
/* Setup Cipher Parameters */
@@ -3002,7 +3002,7 @@ create_gcm_session(uint8_t dev_id, enum rte_crypto_cipher_operation op,
ut_params->cipher_xform.next = NULL;
ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_GCM;
- ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
+ ut_params->auth_xform.auth.op = auth_op;
ut_params->cipher_xform.cipher.op = op;
ut_params->cipher_xform.cipher.key.data = cipher_key;
ut_params->cipher_xform.cipher.key.length = key_len;
@@ -3057,8 +3057,6 @@ create_gcm_operation(enum rte_crypto_cipher_operation op,
struct rte_crypto_sym_op *sym_op = ut_params->op->sym;
-
-
sym_op->auth.digest.data = (uint8_t *)rte_pktmbuf_append(
ut_params->ibuf, auth_tag_len);
TEST_ASSERT_NOT_NULL(sym_op->auth.digest.data,
@@ -3139,7 +3137,8 @@ test_mb_AES_GCM_authenticated_encryption(const struct gcm_test_data *tdata)
retval = create_gcm_session(ts_params->valid_devs[0],
RTE_CRYPTO_CIPHER_OP_ENCRYPT,
tdata->key.data, tdata->key.len,
- tdata->aad.len, tdata->auth_tag.len);
+ tdata->aad.len, tdata->auth_tag.len,
+ RTE_CRYPTO_AUTH_OP_GENERATE);
if (retval < 0)
return retval;
@@ -3269,7 +3268,8 @@ test_mb_AES_GCM_authenticated_decryption(const struct gcm_test_data *tdata)
retval = create_gcm_session(ts_params->valid_devs[0],
RTE_CRYPTO_CIPHER_OP_DECRYPT,
tdata->key.data, tdata->key.len,
- tdata->aad.len, tdata->auth_tag.len);
+ tdata->aad.len, tdata->auth_tag.len,
+ RTE_CRYPTO_AUTH_OP_VERIFY);
if (retval < 0)
return retval;
diff --git a/app/test/test_hash_multiwriter.c b/app/test/test_hash_multiwriter.c
index 40af95d4..4dcbd9d5 100644
--- a/app/test/test_hash_multiwriter.c
+++ b/app/test/test_hash_multiwriter.c
@@ -247,8 +247,6 @@ err1:
static int
test_hash_multiwriter_main(void)
{
- int r = -1;
-
if (rte_lcore_count() == 1) {
printf("More than one lcore is required to do multiwriter test\n");
return 0;
@@ -268,14 +266,16 @@ test_hash_multiwriter_main(void)
printf("Test multi-writer with Hardware transactional memory\n");
use_htm = 1;
- r = test_hash_multiwriter();
+ if (test_hash_multiwriter() < 0)
+ return -1;
}
printf("Test multi-writer without Hardware transactional memory\n");
use_htm = 0;
- r = test_hash_multiwriter();
+ if (test_hash_multiwriter() < 0)
+ return -1;
- return r;
+ return 0;
}
REGISTER_TEST_COMMAND(hash_multiwriter_autotest, test_hash_multiwriter_main);