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

Guduri Prathyusha gprathyusha at caviumnetworks.com
Tue Sep 5 16:10:57 CEST 2017


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 at caviumnetworks.com>
---
 test/test/test_service_cores.c | 4 ++++
 1 file changed, 4 insertions(+)

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),
--
2.14.1



More information about the dev mailing list