summaryrefslogtreecommitdiff
path: root/source4/lib/messaging/tests/messaging.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/messaging/tests/messaging.c')
-rw-r--r--source4/lib/messaging/tests/messaging.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/source4/lib/messaging/tests/messaging.c b/source4/lib/messaging/tests/messaging.c
index 82fdf2f73e..38c34fc52e 100644
--- a/source4/lib/messaging/tests/messaging.c
+++ b/source4/lib/messaging/tests/messaging.c
@@ -29,24 +29,24 @@
static uint32_t msg_pong;
-static void ping_message(struct messaging_context *msg, void *private_data,
+static void ping_message(struct imessaging_context *msg, void *private_data,
uint32_t msg_type, struct server_id src, DATA_BLOB *data)
{
NTSTATUS status;
- status = messaging_send(msg, src, msg_pong, data);
+ status = imessaging_send(msg, src, msg_pong, data);
if (!NT_STATUS_IS_OK(status)) {
printf("pong failed - %s\n", nt_errstr(status));
}
}
-static void pong_message(struct messaging_context *msg, void *private_data,
+static void pong_message(struct imessaging_context *msg, void *private_data,
uint32_t msg_type, struct server_id src, DATA_BLOB *data)
{
int *count = (int *)private_data;
(*count)++;
}
-static void exit_message(struct messaging_context *msg, void *private_data,
+static void exit_message(struct imessaging_context *msg, void *private_data,
uint32_t msg_type, struct server_id src, DATA_BLOB *data)
{
talloc_free(private_data);
@@ -59,8 +59,8 @@ static void exit_message(struct messaging_context *msg, void *private_data,
static bool test_ping_speed(struct torture_context *tctx)
{
struct tevent_context *ev;
- struct messaging_context *msg_client_ctx;
- struct messaging_context *msg_server_ctx;
+ struct imessaging_context *msg_client_ctx;
+ struct imessaging_context *msg_server_ctx;
int ping_count = 0;
int pong_count = 0;
struct timeval tv;
@@ -71,24 +71,24 @@ static bool test_ping_speed(struct torture_context *tctx)
ev = tctx->ev;
- msg_server_ctx = messaging_init(tctx,
- lpcfg_messaging_path(tctx, tctx->lp_ctx), cluster_id(0, 1),
+ msg_server_ctx = imessaging_init(tctx,
+ lpcfg_imessaging_path(tctx, tctx->lp_ctx), cluster_id(0, 1),
ev);
torture_assert(tctx, msg_server_ctx != NULL, "Failed to init ping messaging context");
- messaging_register_tmp(msg_server_ctx, NULL, ping_message, &msg_ping);
- messaging_register_tmp(msg_server_ctx, tctx, exit_message, &msg_exit);
+ imessaging_register_tmp(msg_server_ctx, NULL, ping_message, &msg_ping);
+ imessaging_register_tmp(msg_server_ctx, tctx, exit_message, &msg_exit);
- msg_client_ctx = messaging_init(tctx,
- lpcfg_messaging_path(tctx, tctx->lp_ctx),
+ msg_client_ctx = imessaging_init(tctx,
+ lpcfg_imessaging_path(tctx, tctx->lp_ctx),
cluster_id(0, 2),
ev);
torture_assert(tctx, msg_client_ctx != NULL,
- "msg_client_ctx messaging_init() failed");
+ "msg_client_ctx imessaging_init() failed");
- messaging_register_tmp(msg_client_ctx, &pong_count, pong_message, &msg_pong);
+ imessaging_register_tmp(msg_client_ctx, &pong_count, pong_message, &msg_pong);
tv = timeval_current();
@@ -100,8 +100,8 @@ static bool test_ping_speed(struct torture_context *tctx)
data.data = discard_const_p(uint8_t, "testing");
data.length = strlen((const char *)data.data);
- status1 = messaging_send(msg_client_ctx, cluster_id(0, 1), msg_ping, &data);
- status2 = messaging_send(msg_client_ctx, cluster_id(0, 1), msg_ping, NULL);
+ status1 = imessaging_send(msg_client_ctx, cluster_id(0, 1), msg_ping, &data);
+ status2 = imessaging_send(msg_client_ctx, cluster_id(0, 1), msg_ping, NULL);
torture_assert_ntstatus_ok(tctx, status1, "msg1 failed");
ping_count++;
@@ -121,7 +121,7 @@ static bool test_ping_speed(struct torture_context *tctx)
}
torture_comment(tctx, "sending exit\n");
- messaging_send(msg_client_ctx, cluster_id(0, 1), msg_exit, NULL);
+ imessaging_send(msg_client_ctx, cluster_id(0, 1), msg_exit, NULL);
torture_assert_int_equal(tctx, ping_count, pong_count, "ping test failed");