diff options
author | Jeremy Allison <jra@samba.org> | 2002-06-28 19:28:58 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-06-28 19:28:58 +0000 |
commit | 2d6570904e56d42e47a59a6f8f77f0c4615c205b (patch) | |
tree | ea28082d30d43999c3c31f905575c7ffc4f73aa9 /source3/torture/torture.c | |
parent | f90e74afbabf86b54cf0d0cc137bff167d23d768 (diff) | |
download | samba-2d6570904e56d42e47a59a6f8f77f0c4615c205b.tar.gz samba-2d6570904e56d42e47a59a6f8f77f0c4615c205b.tar.bz2 samba-2d6570904e56d42e47a59a6f8f77f0c4615c205b.zip |
Test how many pipes we can open.
Jeremy.
(This used to be commit 95d22f18d7a2bb06804a6a336b243face4b496a1)
Diffstat (limited to 'source3/torture/torture.c')
-rw-r--r-- | source3/torture/torture.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c index 23624d0733..101f4071cb 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -2997,6 +2997,34 @@ static BOOL run_rename(int dummy) return correct; } +static BOOL run_pipe_number(int dummy) +{ + static struct cli_state cli1; + char *pipe_name = "\\SPOOLSS"; + int fnum; + int num_pipes = 0; + + printf("starting pipenumber test\n"); + if (!torture_open_connection(&cli1)) { + return False; + } + + cli_sockopt(&cli1, sockops); + while(1) { + fnum = cli_nt_create_full(&cli1, pipe_name,FILE_READ_DATA, FILE_ATTRIBUTE_NORMAL, + FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN_IF, 0); + + if (fnum == -1) { + printf("Open of pipe %s failed with error (%s)\n", pipe_name, cli_errstr(&cli1)); + break; + } + num_pipes++; + } + + printf("pipe_number test - we can open %d %s pipes.\n", num_pipes, pipe_name ); + torture_close_connection(&cli1); + return True; +} /* Test open mode returns on read-only files. @@ -3701,6 +3729,7 @@ static struct { {"UTABLE", torture_utable, 0}, {"CASETABLE", torture_casetable, 0}, {"ERRMAPEXTRACT", run_error_map_extract, 0}, + {"PIPE_NUMBER", run_pipe_number, 0}, {NULL, NULL, 0}}; |