test/event_crypto: fix check for HW support
authorHemant Agrawal <hemant.agrawal@nxp.com>
Thu, 7 Nov 2019 09:01:21 +0000 (14:31 +0530)
committerJerin Jacob <jerinj@marvell.com>
Tue, 26 Nov 2019 06:49:31 +0000 (07:49 +0100)
When HW is available but the mode mismatches, it is better
to skip the test case.

Fixes: aa026482baf9 ("test/event_crypto: no service core when HW support available")

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
app/test/test_event_crypto_adapter.c

index 6b47a5c..8d42462 100644 (file)
@@ -302,6 +302,10 @@ test_sessionless_with_op_forward_mode(void)
        if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) &&
            !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW))
                map_adapter_service_core();
+       else {
+               if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD))
+                       return TEST_SKIPPED;
+       }
 
        TEST_ASSERT_SUCCESS(rte_event_crypto_adapter_start(TEST_ADAPTER_ID),
                                "Failed to start event crypto adapter");
@@ -323,6 +327,10 @@ test_session_with_op_forward_mode(void)
        if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) &&
            !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW))
                map_adapter_service_core();
+       else {
+               if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD))
+                       return TEST_SKIPPED;
+       }
 
        TEST_ASSERT_SUCCESS(rte_event_crypto_adapter_start(TEST_ADAPTER_ID
                                ), "Failed to start event crypto adapter");
@@ -458,6 +466,10 @@ test_sessionless_with_op_new_mode(void)
        if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) &&
            !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW))
                map_adapter_service_core();
+       else {
+               if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW))
+                       return TEST_SKIPPED;
+       }
 
        /* start the event crypto adapter */
        TEST_ASSERT_SUCCESS(rte_event_crypto_adapter_start(TEST_ADAPTER_ID),
@@ -480,6 +492,10 @@ test_session_with_op_new_mode(void)
        if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) &&
            !(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW))
                map_adapter_service_core();
+       else {
+               if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_NEW))
+                       return TEST_SKIPPED;
+       }
 
        TEST_ASSERT_SUCCESS(rte_event_crypto_adapter_start(TEST_ADAPTER_ID),
                                "Failed to start event crypto adapter");