summaryrefslogtreecommitdiffstats
path: root/source3/torture/torture.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-08-27 19:30:57 +0200
committerVolker Lendecke <vl@samba.org>2008-08-28 18:16:00 +0200
commit228a12681bc7e6eb5bddb75b3b97a74c5eef1c3a (patch)
tree43fa6443cbbaabefbc88b9e574d0da0994988860 /source3/torture/torture.c
parentbb0fc9cfceab7e961eaa9049d111121609ff8174 (diff)
downloadsamba-228a12681bc7e6eb5bddb75b3b97a74c5eef1c3a.tar.gz
samba-228a12681bc7e6eb5bddb75b3b97a74c5eef1c3a.tar.xz
samba-228a12681bc7e6eb5bddb75b3b97a74c5eef1c3a.zip
Add async smbecho client support
(This used to be commit c1d645fbe39433541d8bfe6b818c855cee318dc5)
Diffstat (limited to 'source3/torture/torture.c')
-rw-r--r--source3/torture/torture.c33
1 files changed, 33 insertions, 0 deletions
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},