[dpdk-dev,2/2] service: fix service lcore start stop unit test

Message ID 20170905141057.8998-2-gprathyusha@caviumnetworks.com (mailing list archive)
State Superseded, archived
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Guduri Prathyusha Sept. 5, 2017, 2:10 p.m. UTC
  Unit test case service_lcore_start_stop fails since the service core was
stopped without stopping the service.

This commit fixes the test by adding negative and positive cases of
stopping the service lcore before and after stopping the service
respectively.

Fixes: f038a81e1c56 ("service: add unit tests")

Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
---
 test/test/test_service_cores.c | 4 ++++
 1 file changed, 4 insertions(+)

--
2.14.1
  

Patch

diff --git a/test/test/test_service_cores.c b/test/test/test_service_cores.c
index 88fac8f44..b043397ef 100644
--- a/test/test/test_service_cores.c
+++ b/test/test/test_service_cores.c
@@ -553,6 +553,10 @@  service_lcore_start_stop(void)
 			"Service core expected to poll service but it didn't");

 	/* core stop */
+	TEST_ASSERT_EQUAL(-EBUSY, rte_service_lcore_stop(slcore_id),
+			"Service core running a service should return -EBUSY");
+	TEST_ASSERT_EQUAL(0, rte_service_stop(s),
+			"Stopping valid service failed");
 	TEST_ASSERT_EQUAL(-EINVAL, rte_service_lcore_stop(100000),
 			"Invalid Service core stop should return -EINVAL");
 	TEST_ASSERT_EQUAL(0, rte_service_lcore_stop(slcore_id),