diff options
author | Luke Leighton <lkcl@samba.org> | 1999-02-11 18:35:26 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1999-02-11 18:35:26 +0000 |
commit | f02321a9987555d616d36b0c151e408d7140c023 (patch) | |
tree | a0ce8fb694e2120a04ca2fc336ae447258d0fbca /source3 | |
parent | a71d268114abf0344251e6dbfa30a320f07eba8f (diff) | |
download | samba-f02321a9987555d616d36b0c151e408d7140c023.tar.gz samba-f02321a9987555d616d36b0c151e408d7140c023.tar.bz2 samba-f02321a9987555d616d36b0c151e408d7140c023.zip |
refinement of random ipc$ SMBtrans torture test. send requests, and
don't wait for responses :-)
(This used to be commit c1d65e906054297e42d6d177194d3b9ab16c7e35)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/utils/torture.c | 62 |
1 files changed, 58 insertions, 4 deletions
diff --git a/source3/utils/torture.c b/source3/utils/torture.c index be77c48cfe..0e1b0b6fcd 100644 --- a/source3/utils/torture.c +++ b/source3/utils/torture.c @@ -786,10 +786,10 @@ static void run_randomipc(int numops) SSVAL(param,0,api); - cli_api(&cli, + cli_api(&cli, param, param_len, 8, NULL, 0, BUFFER_SIZE, - &rparam, &rprcnt, + &rparam, &rprcnt, &rdata, &rdrcnt); } @@ -798,6 +798,58 @@ static void run_randomipc(int numops) DEBUG(0,("finished random ipc test\n")); } +/* send random IPC commands */ +static void run_randomipc_nowait(int numops) +{ + char param[BUFFER_SIZE]; + int api, param_len, i; + int reconnect_count = 50; + static struct cli_state cli; + + DEBUG(0,("start random ipc test no waiting for SMBtrans response\n")); + + while (reconnect_count > 0 && open_connection(&cli) != 0) + { + DEBUG(0,("connection failed: retrying %d\n", reconnect_count)); + msleep(sys_random() % 1000); + reconnect_count--; + } + + if (reconnect_count == 0) + { + return; + } + + for (i=0;i<numops * 100;i++) + { + api = sys_random() % 500; + if ((sys_random() % 10) == 0) + { + param_len = (sys_random() % BUFFER_SIZE); + } + else + { + param_len = (sys_random() % 64); + } + + rand_buf(param, param_len); + + SSVAL(param,0,api); + + cli_send_trans(&cli,SMBtrans, + PIPE_LANMAN,strlen(PIPE_LANMAN), /* Name, length */ + 0,0, /* fid, flags */ + NULL,0,0, /* Setup, length, max */ + + param, param_len, 8, + NULL, 0, BUFFER_SIZE); + } + + close_connection(&cli); + + DEBUG(0,("finished random ipc test\n")); +} + static void browse_callback(const char *sname, uint32 stype, @@ -1167,9 +1219,11 @@ static void create_procs(int nprocs, int numops, void (*fn)(int )) printf("host=%s share=%s user=%s myname=%s procs=%d ops=%d\n", host, share, username, myname, nprocs, numops); - create_procs(nprocs, numops, run_randomipc); -/* create_procs(nprocs, numops, run_connection); +/* + + create_procs(nprocs, numops, run_randomipc); + create_procs(nprocs, numops, run_randomipc_nowait); run_fdpasstest(); run_locktest1(); |