Skip to content

Commit

Permalink
test/ipsec: fix result code for not supported
Browse files Browse the repository at this point in the history
[ upstream commit 8dda080 ]

During SA creation, if the required algorithm is not supported,
drivers can return ENOTSUP. But in most of the IPsec test cases,
if the SA creation does not success, it just returns
TEST_FAILED.

This patch fixes this issue by returning the actual return values
from the driver to the application, so that it can make decisions
whether the test case is passed, failed or unsupported.

Fixes: 05fe65e ("test/ipsec: introduce functional test")

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
  • Loading branch information
Gagandeep Singh authored and cpaelzer committed Feb 3, 2021
1 parent b23e86e commit 3b08e23
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions app/test/test_ipsec.c
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ create_sa(enum rte_security_session_action_type action_type,
ut->ss[j].type = action_type;
rc = create_session(ut, &ts->qp_conf, ts->valid_dev, j);
if (rc != 0)
return TEST_FAILED;
return rc;

rc = rte_ipsec_sa_init(ut->ss[j].sa, &ut->sa_prm, sz);
rc = (rc > 0 && (uint32_t)rc <= sz) ? 0 : -EINVAL;
Expand Down Expand Up @@ -1246,7 +1246,7 @@ test_ipsec_crypto_inb_burst_null_null(int i)
test_cfg[i].replay_win_sz, test_cfg[i].flags, 0);
if (rc != 0) {
RTE_LOG(ERR, USER1, "create_sa failed, cfg %d\n", i);
return TEST_FAILED;
return rc;
}

/* Generate test mbuf data */
Expand Down Expand Up @@ -1348,7 +1348,7 @@ test_ipsec_crypto_outb_burst_null_null(int i)
test_cfg[i].replay_win_sz, test_cfg[i].flags, 0);
if (rc != 0) {
RTE_LOG(ERR, USER1, "create_sa failed, cfg %d\n", i);
return TEST_FAILED;
return rc;
}

/* Generate input mbuf data */
Expand Down Expand Up @@ -1457,7 +1457,7 @@ test_ipsec_inline_crypto_inb_burst_null_null(int i)
test_cfg[i].replay_win_sz, test_cfg[i].flags, 0);
if (rc != 0) {
RTE_LOG(ERR, USER1, "create_sa failed, cfg %d\n", i);
return TEST_FAILED;
return rc;
}

/* Generate inbound mbuf data */
Expand Down Expand Up @@ -1535,7 +1535,7 @@ test_ipsec_inline_proto_inb_burst_null_null(int i)
test_cfg[i].replay_win_sz, test_cfg[i].flags, 0);
if (rc != 0) {
RTE_LOG(ERR, USER1, "create_sa failed, cfg %d\n", i);
return TEST_FAILED;
return rc;
}

/* Generate inbound mbuf data */
Expand Down Expand Up @@ -1643,7 +1643,7 @@ test_ipsec_inline_crypto_outb_burst_null_null(int i)
test_cfg[i].replay_win_sz, test_cfg[i].flags, 0);
if (rc != 0) {
RTE_LOG(ERR, USER1, "create_sa failed, cfg %d\n", i);
return TEST_FAILED;
return rc;
}

/* Generate test mbuf data */
Expand Down Expand Up @@ -1721,7 +1721,7 @@ test_ipsec_inline_proto_outb_burst_null_null(int i)
test_cfg[i].replay_win_sz, test_cfg[i].flags, 0);
if (rc != 0) {
RTE_LOG(ERR, USER1, "create_sa failed, cfg %d\n", i);
return TEST_FAILED;
return rc;
}

/* Generate test mbuf data */
Expand Down Expand Up @@ -1797,7 +1797,7 @@ test_ipsec_lksd_proto_inb_burst_null_null(int i)
test_cfg[i].replay_win_sz, test_cfg[i].flags, 0);
if (rc != 0) {
RTE_LOG(ERR, USER1, "create_sa failed, cfg %d\n", i);
return TEST_FAILED;
return rc;
}

/* Generate test mbuf data */
Expand Down Expand Up @@ -1910,7 +1910,7 @@ test_ipsec_replay_inb_inside_null_null(int i)
test_cfg[i].replay_win_sz, test_cfg[i].flags, 0);
if (rc != 0) {
RTE_LOG(ERR, USER1, "create_sa failed, cfg %d\n", i);
return TEST_FAILED;
return rc;
}

/* Generate inbound mbuf data */
Expand Down Expand Up @@ -2003,7 +2003,7 @@ test_ipsec_replay_inb_outside_null_null(int i)
test_cfg[i].replay_win_sz, test_cfg[i].flags, 0);
if (rc != 0) {
RTE_LOG(ERR, USER1, "create_sa failed, cfg %d\n", i);
return TEST_FAILED;
return rc;
}

/* Generate test mbuf data */
Expand Down Expand Up @@ -2103,7 +2103,7 @@ test_ipsec_replay_inb_repeat_null_null(int i)
test_cfg[i].replay_win_sz, test_cfg[i].flags, 0);
if (rc != 0) {
RTE_LOG(ERR, USER1, "create_sa failed, cfg %d\n", i);
return TEST_FAILED;
return rc;
}

/* Generate test mbuf data */
Expand Down Expand Up @@ -2204,7 +2204,7 @@ test_ipsec_replay_inb_inside_burst_null_null(int i)
test_cfg[i].replay_win_sz, test_cfg[i].flags, 0);
if (rc != 0) {
RTE_LOG(ERR, USER1, "create_sa failed, cfg %d\n", i);
return TEST_FAILED;
return rc;
}

/* Generate inbound mbuf data */
Expand Down Expand Up @@ -2337,7 +2337,7 @@ test_ipsec_crypto_inb_burst_2sa_null_null(int i)
test_cfg[i].replay_win_sz, test_cfg[i].flags, 0);
if (rc != 0) {
RTE_LOG(ERR, USER1, "create_sa 0 failed, cfg %d\n", i);
return TEST_FAILED;
return rc;
}

/* create second rte_ipsec_sa */
Expand All @@ -2347,7 +2347,7 @@ test_ipsec_crypto_inb_burst_2sa_null_null(int i)
if (rc != 0) {
RTE_LOG(ERR, USER1, "create_sa 1 failed, cfg %d\n", i);
destroy_sa(0);
return TEST_FAILED;
return rc;
}

/* Generate test mbuf data */
Expand Down Expand Up @@ -2423,7 +2423,7 @@ test_ipsec_crypto_inb_burst_2sa_4grp_null_null(int i)
test_cfg[i].replay_win_sz, test_cfg[i].flags, 0);
if (rc != 0) {
RTE_LOG(ERR, USER1, "create_sa 0 failed, cfg %d\n", i);
return TEST_FAILED;
return rc;
}

/* create second rte_ipsec_sa */
Expand All @@ -2433,7 +2433,7 @@ test_ipsec_crypto_inb_burst_2sa_4grp_null_null(int i)
if (rc != 0) {
RTE_LOG(ERR, USER1, "create_sa 1 failed, cfg %d\n", i);
destroy_sa(0);
return TEST_FAILED;
return rc;
}

/* Generate test mbuf data */
Expand Down

0 comments on commit 3b08e23

Please sign in to comment.