summaryrefslogtreecommitdiff
path: root/source4/torture/basic
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-09-23 08:35:17 +0200
committerStefan Metzmacher <metze@samba.org>2011-11-30 15:13:36 +0100
commit4afbda221c20ffa36a1d1e37ef11f86073a49da6 (patch)
tree8d9cc7d03f5bb4ea4ffa761dfee0ba7e9cdc005c /source4/torture/basic
parent99ef6a4bec1058b3649e5e72f8ea85f6df93a154 (diff)
downloadsamba-4afbda221c20ffa36a1d1e37ef11f86073a49da6.tar.gz
samba-4afbda221c20ffa36a1d1e37ef11f86073a49da6.tar.bz2
samba-4afbda221c20ffa36a1d1e37ef11f86073a49da6.zip
s4:libcli/raw: implement on top of smbXcli_conn/req
metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Wed Nov 30 15:13:36 CET 2011 on sn-devel-104
Diffstat (limited to 'source4/torture/basic')
-rw-r--r--source4/torture/basic/base.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/source4/torture/basic/base.c b/source4/torture/basic/base.c
index d1005d0bdc..56461005e8 100644
--- a/source4/torture/basic/base.c
+++ b/source4/torture/basic/base.c
@@ -65,6 +65,14 @@ static struct smbcli_state *open_nbt_connection(struct torture_context *tctx)
goto failed;
}
+ cli->transport = smbcli_transport_init(cli->sock, cli,
+ true, &cli->options);
+ cli->sock = NULL;
+ if (!cli->transport) {
+ torture_comment(tctx, "smbcli_transport_init failed\n");
+ goto failed;
+ }
+
return cli;
failed:
@@ -360,15 +368,23 @@ static bool run_negprot_nowait(struct torture_context *tctx)
torture_comment(tctx, "Filling send buffer\n");
for (i=0;i<100;i++) {
- struct smbcli_request *req;
- req = smb_raw_negotiate_send(cli->transport, lpcfg_unicode(tctx->lp_ctx), PROTOCOL_NT1);
+ struct tevent_req *req;
+ req = smb_raw_negotiate_send(cli, tctx->ev,
+ cli->transport,
+ PROTOCOL_NT1);
tevent_loop_once(tctx->ev);
- if (req->state == SMBCLI_REQUEST_ERROR) {
+ if (!tevent_req_is_in_progress(req)) {
+ NTSTATUS status;
+
+ status = smb_raw_negotiate_recv(req);
+ TALLOC_FREE(req);
if (i > 0) {
- torture_comment(tctx, "Failed to fill pipe packet[%d] - %s (ignored)\n", i+1, nt_errstr(req->status));
+ torture_comment(tctx, "Failed to fill pipe packet[%d] - %s (ignored)\n",
+ i+1, nt_errstr(status));
break;
} else {
- torture_comment(tctx, "Failed to fill pipe - %s \n", nt_errstr(req->status));
+ torture_comment(tctx, "Failed to fill pipe - %s \n",
+ nt_errstr(status));
torture_close_connection(cli);
return false;
}