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

Message ID 1451051319-22073-3-git-send-email-maxim.uvarov@linaro.org
State New
Headers show

Commit Message

Maxim Uvarov Dec. 25, 2015, 1:48 p.m.
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
---
 test/validation/pktio/pktio.c | 7 +++++++
 1 file changed, 7 insertions(+)

Patch

diff --git a/test/validation/pktio/pktio.c b/test/validation/pktio/pktio.c
index e473a1d..dc58dfc 100644
--- a/test/validation/pktio/pktio.c
+++ b/test/validation/pktio/pktio.c
@@ -1052,6 +1052,13 @@  void pktio_test_recv_on_wonly(void)
 	ret = odp_pktio_start(pktio);
 	CU_ASSERT_FATAL(ret == 0);
 
+	ret = odp_pktio_link_status(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);