From 228a12681bc7e6eb5bddb75b3b97a74c5eef1c3a Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 27 Aug 2008 19:30:57 +0200 Subject: Add async smbecho client support (This used to be commit c1d645fbe39433541d8bfe6b818c855cee318dc5) --- source3/torture/torture.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'source3/torture') diff --git a/source3/torture/torture.c b/source3/torture/torture.c index d159ffbac35..d8942e42b9b 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -4976,6 +4976,38 @@ static bool run_chain1(int dummy) return True; } +static bool run_cli_echo(int dummy) +{ + struct cli_state *cli; + struct event_context *ev = event_context_init(NULL); + struct async_req *req; + NTSTATUS status; + + printf("starting chain1 test\n"); + if (!torture_open_connection(&cli, 0)) { + return false; + } + cli_sockopt(cli, sockops); + + req = cli_echo_send(ev, ev, cli, 5, data_blob_const("hello", 5)); + if (req == NULL) { + d_printf("cli_echo_send failed\n"); + return false; + } + + while (req->state < ASYNC_REQ_DONE) { + event_loop_once(ev); + } + + status = cli_echo_recv(req); + d_printf("cli_echo returned %s\n", nt_errstr(status)); + + TALLOC_FREE(req); + + torture_close_connection(cli); + return NT_STATUS_IS_OK(status); +} + static bool run_local_substitute(int dummy) { bool ok = true; @@ -5474,6 +5506,7 @@ static struct { { "EATEST", run_eatest, 0}, { "SESSSETUP_BENCH", run_sesssetup_bench, 0}, { "CHAIN1", run_chain1, 0}, + { "CLI_ECHO", run_cli_echo, 0}, { "LOCAL-SUBSTITUTE", run_local_substitute, 0}, { "LOCAL-GENCACHE", run_local_gencache, 0}, { "LOCAL-RBTREE", run_local_rbtree, 0}, -- cgit