[API-NEXT,v1,2/2] validation: pktio: clean shutdown in case pkt sending failed

Message ID 1514458808-9218-3-git-send-email-odpbot@yandex.ru
State New
Headers show
Series
  • Two fixes for the testsuite
Related show

Commit Message

Github ODP bot Dec. 28, 2017, 11 a.m.
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


Provide clean shutdown path for the case of odp_pktout_send() returning
an error during pktio_test_send_failure test.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>

---
/** Email created from pull request 376 (lumag:test-fixes)
 ** https://github.com/Linaro/odp/pull/376
 ** Patch: https://github.com/Linaro/odp/pull/376.patch
 ** Base sha: 68735b312926a44ddf42f9ecf96a0badd941a247
 ** Merge commit sha: c3ae2320e846c56ecc6040c63336b9e30de0beee
 **/
 test/validation/api/pktio/pktio.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Patch

diff --git a/test/validation/api/pktio/pktio.c b/test/validation/api/pktio/pktio.c
index a6820a1de..a23641036 100644
--- a/test/validation/api/pktio/pktio.c
+++ b/test/validation/api/pktio/pktio.c
@@ -1846,7 +1846,9 @@  void pktio_test_send_failure(void)
 		 * the initial short packets should be sent successfully */
 		odp_errno_zero();
 		ret = odp_pktout_send(pktout, pkt_tbl, TX_BATCH_LEN);
-		CU_ASSERT_FATAL(ret == long_pkt_idx);
+		CU_ASSERT(ret == long_pkt_idx);
+		if (ret != long_pkt_idx)
+			goto cleanup;
 		CU_ASSERT(odp_errno() == 0);
 
 		info_rx.id   = pktio_rx;
@@ -1897,6 +1899,7 @@  void pktio_test_send_failure(void)
 			odp_packet_free(pkt_tbl[i]);
 	}
 
+cleanup:
 	if (pktio_rx != pktio_tx) {
 		CU_ASSERT(odp_pktio_stop(pktio_rx) == 0);
 		CU_ASSERT(odp_pktio_close(pktio_rx) == 0);