diff options
author | Andrew Tridgell <tridge@samba.org> | 2002-07-15 10:35:28 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2002-07-15 10:35:28 +0000 |
commit | e90b65284812aaa5ff9e9935ce9bbad7791cbbcd (patch) | |
tree | 9e744d1dc2f93934a4b49166a37383d3cb2b2139 /source3/torture | |
parent | ec167dc9cc0ec2ee461837c25a371d2981744208 (diff) | |
download | samba-e90b65284812aaa5ff9e9935ce9bbad7791cbbcd.tar.gz samba-e90b65284812aaa5ff9e9935ce9bbad7791cbbcd.tar.bz2 samba-e90b65284812aaa5ff9e9935ce9bbad7791cbbcd.zip |
updated the 3.0 branch from the head branch - ready for alpha18
(This used to be commit 03ac082dcb375b6f3ca3d810a6a6367542bc23ce)
Diffstat (limited to 'source3/torture')
-rw-r--r-- | source3/torture/mangle_test.c | 5 | ||||
-rw-r--r-- | source3/torture/nbio.c | 10 | ||||
-rw-r--r-- | source3/torture/nsstest.c | 4 | ||||
-rw-r--r-- | source3/torture/torture.c | 29 |
4 files changed, 44 insertions, 4 deletions
diff --git a/source3/torture/mangle_test.c b/source3/torture/mangle_test.c index 2d5b3610d5..ced0185c95 100644 --- a/source3/torture/mangle_test.c +++ b/source3/torture/mangle_test.c @@ -88,8 +88,9 @@ static BOOL test_one(struct cli_state *cli, const char *name) if (strcasecmp(name, data.dptr) != 0) { /* we have a collision */ collisions++; - printf("Collision between %s and %s -> %s\n", - name, data.dptr, shortname); + printf("Collision between %s and %s -> %s " + " (coll/tot: %u/%u)\n", + name, data.dptr, shortname, collisions, total); } free(data.dptr); } else { diff --git a/source3/torture/nbio.c b/source3/torture/nbio.c index 0d6955c879..2d519b40ba 100644 --- a/source3/torture/nbio.c +++ b/source3/torture/nbio.c @@ -79,6 +79,16 @@ void nbio_shmem(int n) } } +static int ne_find_handle(int handle) +{ + int i; + children[nbio_id].line = line_count; + for (i=0;i<MAX_FILES;i++) { + if (ftable[i].handle == handle) return i; + } + return -1; +} + static int find_handle(int handle) { int i; diff --git a/source3/torture/nsstest.c b/source3/torture/nsstest.c index 3aeaa177a1..c9b068aa04 100644 --- a/source3/torture/nsstest.c +++ b/source3/torture/nsstest.c @@ -35,13 +35,13 @@ static void *find_fn(const char *name) snprintf(s,sizeof(s), "_nss_%s_%s", nss_name, name); if (!h) { - h = dlopen(so_path, RTLD_LAZY); + h = sys_dlopen(so_path, RTLD_LAZY); } if (!h) { printf("Can't open shared library %s\n", so_path); exit(1); } - res = dlsym(h, s); + res = sys_dlsym(h, s); if (!res) { printf("Can't find function %s\n", s); return NULL; 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}}; |