service: reintroduce test dummy service delay
Checks
Commit Message
Eliminate unreachable code and have dummy service function perform a
short delay again, mimicking previous service core test behavior.
Fixes: a37e053b2364 ("service: extend service function call statistics")
Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
---
app/test/test_service_cores.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
Comments
On Wed, Oct 2, 2024 at 9:40 PM Mattias Rönnblom
<mattias.ronnblom@ericsson.com> wrote:
>
> Eliminate unreachable code and have dummy service function perform a
> short delay again, mimicking previous service core test behavior.
>
Coverity issue: 445158
> Fixes: a37e053b2364 ("service: extend service function call statistics")
>
> Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Applied, thanks.
@@ -49,21 +49,27 @@ testsuite_teardown(void)
static int32_t dummy_cb(void *args)
{
RTE_SET_USED(args);
+ int32_t rc;
service_calls++;
switch (rte_rand_max(3)) {
case 0:
- return 0;
+ rc = 0;
+ break;
case 1:
service_idle_calls++;
- return -EAGAIN;
+ rc = -EAGAIN;
+ break;
default:
service_error_calls++;
- return -ENOENT;
+ rc = -ENOENT;
+ break;
}
rte_delay_ms(SERVICE_DELAY);
+
+ return rc;
}
static int32_t dummy_mt_unsafe_cb(void *args)