Skip to content
Snippets Groups Projects
Commit 34014a0a authored by Ali Mohammed's avatar Ali Mohammed
Browse files

modify check_pm_interlock test to have both clients name as Client but with...

modify check_pm_interlock test to have both clients name as Client but with different indices 1 and 2
parent d846f907
No related branches found
No related tags found
1 merge request!21Resolve "create unit test for components with component-indices"
......@@ -157,11 +157,11 @@ INJECTOR_OPS="\
simple_interlock_client_1_SOURCES = simple_interlock_client.c
simple_interlock_client_1_CPPFLAGS = $(AM_CPPFLAGS) -DCLIENT_ARGS=$(CLIENT1_OPS)
simple_interlock_client_1_CPPFLAGS = $(AM_CPPFLAGS) -DCOMPONENT_ID=1 -DCLIENT_ARGS=$(CLIENT1_OPS)
simple_interlock_client_2_SOURCES = simple_interlock_client.c
simple_interlock_client_2_CPPFLAGS = $(AM_CPPFLAGS) -DCLIENT_ARGS=$(CLIENT2_OPS)
simple_interlock_client_2_CPPFLAGS = $(AM_CPPFLAGS) -DCOMPONENT_ID=2 -DCLIENT_ARGS=$(CLIENT2_OPS)
simple_injector_SOURCES = simple_interlock_client.c
simple_injector_CPPFLAGS = $(AM_CPPFLAGS) -DCLIENT_ARGS=$(INJECTOR_OPS)
simple_injector_CPPFLAGS = $(AM_CPPFLAGS) -DCOMPONENT_ID=0 -DCLIENT_ARGS=$(INJECTOR_OPS)
simple_group_injector_SOURCES = simple_group_client.c
simple_group_injector_CPPFLAGS = $(AM_CPPFLAGS) -DINJECT_GROUP_MEMBERS=1
......
......@@ -90,10 +90,10 @@ MSTRO_POOL_MANAGER_INFO="$pm_info"
export MSTRO_POOL_MANAGER_INFO
# start client 1
(env MSTRO_COMPONENT_NAME="C1a" MSTRO_TRANSPORT_DEFAULT="MIO" MSTRO_MIO_CONFIG="./mio-config-C1a.yaml" MSTRO_LOG_COLOR_ERRORS=1 MSTRO_LOG_COLOR="BLUE" ${CLIENT_CMD}_1 -n) || exit 99 &
(env MSTRO_COMPONENT_NAME="Client" MSTRO_TRANSPORT_DEFAULT="MIO" MSTRO_MIO_CONFIG="./mio-config-C1a.yaml" MSTRO_LOG_COLOR_ERRORS=1 MSTRO_LOG_COLOR="BLUE" ${CLIENT_CMD}_1 -n) || exit 99 &
# start client 2
(env MSTRO_COMPONENT_NAME="C2a" MSTRO_TRANSPORT_DEFAULT="MIO" MSTRO_MIO_CONFIG="./mio-config-C2a.yaml" MSTRO_LOG_COLOR_ERRORS=1 MSTRO_LOG_COLOR="CYAN" ${CLIENT_CMD}_2 -n) || exit 99 &
(env MSTRO_COMPONENT_NAME="Client" MSTRO_TRANSPORT_DEFAULT="MIO" MSTRO_MIO_CONFIG="./mio-config-C2a.yaml" MSTRO_LOG_COLOR_ERRORS=1 MSTRO_LOG_COLOR="CYAN" ${CLIENT_CMD}_2 -n) || exit 99 &
wait %1 || exit 99
wait %2 || exit 99
......
......@@ -61,6 +61,12 @@
#error You need to define CLIENT_ARGS when compiling this file
#endif
#ifndef COMPONENT_ID
#error You need to define COMPONENT_ID when compiling this file
#endif
#define XSTRINGIFY(s) #s
#define STRINGIFY(s) XSTRINGIFY(s)
......@@ -267,7 +273,10 @@ CHEAT_DECLARE(
)
CHEAT_TEST(simple_interlock_client,
cheat_assert(MSTRO_OK == mstro_init(NULL,NULL,0));
char *component_id = STRINGIFY(COMPONENT_ID);
int my_id = atoi(component_id);
cheat_assert(MSTRO_OK == mstro_init(NULL,NULL,my_id));
cheat_yield();
cheat_assert(0==parse_args(g_client_args));
cheat_assert(0==execute_steps(g_steps));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment