test/crypto: fix misleading trace message
authorFiona Trahe <fiona.trahe@intel.com>
Fri, 21 Dec 2018 00:01:25 +0000 (00:01 +0000)
committerPablo de Lara <pablo.de.lara.guarch@intel.com>
Thu, 10 Jan 2019 15:57:22 +0000 (16:57 +0100)
Test was reporting digest verification failed for all operation errors.
Fixed so it only reports this if the PMD actually reports an auth failure.

Fixes: 9c0eed2f06ae ("app/test: rework crypto AES unit test")
Cc: stable@dpdk.org
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
test/test/test_cryptodev_blockcipher.c

index 1c3f29f..4f1298e 100644 (file)
@@ -401,13 +401,14 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,
 
        /* Verify results */
        if (op->status != RTE_CRYPTO_OP_STATUS_SUCCESS) {
-               if (t->op_mask & BLOCKCIPHER_TEST_OP_AUTH_VERIFY)
+               if ((t->op_mask & BLOCKCIPHER_TEST_OP_AUTH_VERIFY) &&
+                       (op->status == RTE_CRYPTO_OP_STATUS_AUTH_FAILED))
                        snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN, "line %u "
                                "FAILED: Digest verification failed "
                                "(0x%X)", __LINE__, op->status);
                else
                        snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN, "line %u "
-                               "FAILED: Digest verification failed "
+                               "FAILED: Operation failed "
                                "(0x%X)", __LINE__, op->status);
                status = TEST_FAILED;
                goto error_exit;