summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-08-03 08:04:51 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:57:46 -0500
commitd4ceaff6a56215cd9ca4b0b115b14bae91e03b34 (patch)
tree29feab237adafdc131c0b15731659d16e7552eac /source4/torture
parentbff2c7a5780433d815eea7a3d735ac562a0dbdf9 (diff)
downloadsamba-d4ceaff6a56215cd9ca4b0b115b14bae91e03b34.tar.gz
samba-d4ceaff6a56215cd9ca4b0b115b14bae91e03b34.tar.bz2
samba-d4ceaff6a56215cd9ca4b0b115b14bae91e03b34.zip
r1636: improved the negnowait test so it is standalone (taking advantage of the async APIs)
(This used to be commit 19c22760c699aa2b000f023ff6083055a27a83cb)
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/torture.c40
1 files changed, 36 insertions, 4 deletions
diff --git a/source4/torture/torture.c b/source4/torture/torture.c
index 761eb7ef65..90f6226200 100644
--- a/source4/torture/torture.c
+++ b/source4/torture/torture.c
@@ -1890,7 +1890,7 @@ static BOOL run_maxfidtest(struct cli_state *cli, int dummy)
static BOOL run_negprot_nowait(int dummy)
{
int i;
- struct cli_state *cli;
+ struct cli_state *cli, *cli2;
BOOL correct = True;
printf("starting negprot nowait test\n");
@@ -1900,16 +1900,48 @@ static BOOL run_negprot_nowait(int dummy)
return False;
}
- printf("Establishing protocol negotiations - connect with another client\n");
+ printf("Filling send buffer\n");
+
+ for (i=0;i<10000;i++) {
+ struct cli_request *req;
+ time_t t1 = time(NULL);
+ req = smb_negprot_send(cli->transport, PROTOCOL_NT1);
+ while (req->state == CLI_REQUEST_SEND && time(NULL) < t1+5) {
+ cli_transport_process(cli->transport);
+ }
+ if (req->state == CLI_REQUEST_ERROR) {
+ printf("Failed to fill pipe - %s\n", nt_errstr(req->status));
+ torture_close_connection(cli);
+ return correct;
+ }
+ if (req->state == CLI_REQUEST_SEND) {
+ break;
+ }
+ }
+
+ if (i == 10000) {
+ printf("send buffer failed to fill\n");
+ if (!torture_close_connection(cli)) {
+ correct = False;
+ }
+ return correct;
+ }
+
+ printf("send buffer filled after %d requests\n", i);
- for (i=0;i<50000;i++) {
- smb_negprot_send(cli->transport, PROTOCOL_NT1);
+ printf("Opening secondary connection\n");
+ if (!torture_open_connection(&cli2)) {
+ return False;
}
if (!torture_close_connection(cli)) {
correct = False;
}
+ if (!torture_close_connection(cli2)) {
+ correct = False;
+ }
+
printf("finished negprot nowait test\n");
return correct;