diff mbox

[API-NEXT,PATCHv2,3/4] validation: test odp_pktio_link_status()

Message ID 1451320813-9428-4-git-send-email-maxim.uvarov@linaro.org
State New
Headers show

Commit Message

Maxim Uvarov Dec. 28, 2015, 4:40 p.m. UTC
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
---
 test/validation/pktio/pktio.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox

Patch

diff --git a/test/validation/pktio/pktio.c b/test/validation/pktio/pktio.c
index e473a1d..7b647a4 100644
--- a/test/validation/pktio/pktio.c
+++ b/test/validation/pktio/pktio.c
@@ -9,6 +9,7 @@ 
 #include <odp/helper/eth.h>
 #include <odp/helper/ip.h>
 #include <odp/helper/udp.h>
+#include <odp/helper/pktio.h>
 
 #include <stdlib.h>
 #include "pktio.h"
@@ -1052,6 +1053,13 @@  void pktio_test_recv_on_wonly(void)
 	ret = odp_pktio_start(pktio);
 	CU_ASSERT_FATAL(ret == 0);
 
+	ret = odph_pktio_wait_linkup(pktio);
+	if (ret != -1) {
+		/* assert only if link state supported and
+		 * it's down. */
+		CU_ASSERT_FATAL(ret == 1);
+	}
+
 	ret = odp_pktio_recv(pktio, &pkt, 1);
 	CU_ASSERT(ret < 0);