From 1d795fa57b9f0b9c23cecfe0329a5e551ea903ee Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 12 Jan 2005 07:03:29 +0000 Subject: r4700: first attempt at a composite async function, smb_composite_loadfile(), which combineds ntcreatex, readx and close into a single call that behaves just like a normal libcli async call. (This used to be commit 516f68fb054f0717f0429e031aa820776ecc6597) --- source4/torture/raw/composite.c | 77 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 source4/torture/raw/composite.c (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c new file mode 100644 index 0000000000..97f820c9e5 --- /dev/null +++ b/source4/torture/raw/composite.c @@ -0,0 +1,77 @@ +/* + Unix SMB/CIFS implementation. + + libcli composite function testing + + Copyright (C) Andrew Tridgell 2005 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "includes.h" +#include "libcli/raw/libcliraw.h" +#include "libcli/composite/composite.h" + +#define BASEDIR "\\composite" + +static BOOL test_loadfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) +{ + const char *fname = BASEDIR "\\test.txt"; + int fnum; + NTSTATUS status; + struct smb_composite_loadfile io; + + fnum = create_complex_file(cli, mem_ctx, fname); + smbcli_close(cli->tree, fnum); + + io.in.fname = fname; + + status = smb_composite_loadfile(cli->tree, mem_ctx, &io); + if (!NT_STATUS_IS_OK(status)) { + printf("Loadfile failed: %s\n", nt_errstr(status)); + return False; + } + + return True; +} + +/* + basic testing of libcli composite calls +*/ +BOOL torture_raw_composite(void) +{ + struct smbcli_state *cli; + BOOL ret = True; + TALLOC_CTX *mem_ctx; + + if (!torture_open_connection(&cli)) { + return False; + } + + mem_ctx = talloc_init("torture_raw_composite"); + + if (!torture_setup_dir(cli, BASEDIR)) { + return False; + } + + ret &= test_loadfile(cli, mem_ctx); + + smb_raw_exit(cli->session); + smbcli_deltree(cli->tree, BASEDIR); + + torture_close_connection(cli); + talloc_destroy(mem_ctx); + return ret; +} -- cgit From 287515fd3db1932f06d56da3bb388a7efc1120eb Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 12 Jan 2005 11:43:18 +0000 Subject: r4710: added a smb_composite_savefile() function, and expanded the test suite a little (This used to be commit ef4dbc443dbdebc4160209ed3f23cbb97109c414) --- source4/torture/raw/composite.c | 47 +++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 7 deletions(-) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index 97f820c9e5..563705740d 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -26,24 +26,57 @@ #define BASEDIR "\\composite" +/* + test a simple savefile/loadfile combination +*/ static BOOL test_loadfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { const char *fname = BASEDIR "\\test.txt"; - int fnum; NTSTATUS status; - struct smb_composite_loadfile io; - - fnum = create_complex_file(cli, mem_ctx, fname); - smbcli_close(cli->tree, fnum); + struct smb_composite_savefile io1; + struct smb_composite_loadfile io2; + char *data; + size_t len = random() % 100000; + + data = talloc_array(mem_ctx, uint8_t, len); + + generate_random_buffer(data, len); - io.in.fname = fname; + io1.in.fname = fname; + io1.in.data = data; + io1.in.size = len; - status = smb_composite_loadfile(cli->tree, mem_ctx, &io); + printf("testing savefile\n"); + + status = smb_composite_savefile(cli->tree, &io1); + if (!NT_STATUS_IS_OK(status)) { + printf("savefile failed: %s\n", nt_errstr(status)); + return False; + } + + io2.in.fname = fname; + + printf("testing loadfile\n"); + + status = smb_composite_loadfile(cli->tree, mem_ctx, &io2); if (!NT_STATUS_IS_OK(status)) { printf("Loadfile failed: %s\n", nt_errstr(status)); return False; } + if (io2.out.size != len) { + printf("wrong length in returned data - %d should be %d\n", + io2.out.size, len); + return False; + } + + if (memcmp(io2.out.data, data, len) != 0) { + printf("wrong data in loadfile!\n"); + return False; + } + + talloc_free(data); + return True; } -- cgit From 79f32d794ab65f8cde07779771d660589edb156a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 16 Jan 2005 12:10:14 +0000 Subject: r4779: demonstrate doing 50 parallel loadfile operations, with a callback for completion (This used to be commit b8c5269482cd7c2611d785bb8831eebae2f905d2) --- source4/torture/raw/composite.c | 53 +++++++++++++++++++++++++++++++---------- 1 file changed, 40 insertions(+), 13 deletions(-) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index 563705740d..f1fb6a9829 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -26,6 +26,12 @@ #define BASEDIR "\\composite" +static void loadfile_complete(struct smbcli_composite *c) +{ + int *count = c->async.private; + (*count)++; +} + /* test a simple savefile/loadfile combination */ @@ -35,8 +41,11 @@ static BOOL test_loadfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) NTSTATUS status; struct smb_composite_savefile io1; struct smb_composite_loadfile io2; + struct smbcli_composite **c; char *data; size_t len = random() % 100000; + const int num_ops = 50; + int i, count=0; data = talloc_array(mem_ctx, uint8_t, len); @@ -56,23 +65,41 @@ static BOOL test_loadfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) io2.in.fname = fname; - printf("testing loadfile\n"); + printf("testing parallel loadfile with %d ops\n", num_ops); - status = smb_composite_loadfile(cli->tree, mem_ctx, &io2); - if (!NT_STATUS_IS_OK(status)) { - printf("Loadfile failed: %s\n", nt_errstr(status)); - return False; - } + c = talloc_array(mem_ctx, struct smbcli_composite *, num_ops); - if (io2.out.size != len) { - printf("wrong length in returned data - %d should be %d\n", - io2.out.size, len); - return False; + for (i=0;itree, &io2); + c[i]->async.fn = loadfile_complete; + c[i]->async.private = &count; } - if (memcmp(io2.out.data, data, len) != 0) { - printf("wrong data in loadfile!\n"); - return False; + printf("waiting for completion\n"); + while (count != num_ops) { + event_loop_once(cli->transport->socket->event.ctx); + printf("count=%d\r", count); + fflush(stdout); + } + printf("count=%d\n", count); + + for (i=0;i Date: Sun, 16 Jan 2005 23:32:37 +0000 Subject: r4792: use type safety int the test suite too (This used to be commit 4a963e3b7aa38f0f6907bcd8acaaeb8c7982cafa) --- source4/torture/raw/composite.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index f1fb6a9829..080db4f2c2 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -28,7 +28,7 @@ static void loadfile_complete(struct smbcli_composite *c) { - int *count = c->async.private; + int *count = talloc_get_type(c->async.private, int); (*count)++; } @@ -45,7 +45,8 @@ static BOOL test_loadfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) char *data; size_t len = random() % 100000; const int num_ops = 50; - int i, count=0; + int i; + int *count = talloc_zero(mem_ctx, int); data = talloc_array(mem_ctx, uint8_t, len); @@ -72,16 +73,16 @@ static BOOL test_loadfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) for (i=0;itree, &io2); c[i]->async.fn = loadfile_complete; - c[i]->async.private = &count; + c[i]->async.private = count; } printf("waiting for completion\n"); - while (count != num_ops) { + while (*count != num_ops) { event_loop_once(cli->transport->socket->event.ctx); - printf("count=%d\r", count); + printf("count=%d\r", *count); fflush(stdout); } - printf("count=%d\n", count); + printf("count=%d\n", *count); for (i=0;i Date: Sun, 23 Jan 2005 23:23:26 +0000 Subject: r4949: First version of a fetchfile composite function which connects to a server and loads a file. Needs a smb url parsing wrapper. Volker (This used to be commit fa435bf7c878d4a5beb6afb2ed6e2990abc11e82) --- source4/torture/raw/composite.c | 99 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index 080db4f2c2..5c09848f52 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -108,6 +108,104 @@ static BOOL test_loadfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) return True; } +/* + test a simple savefile/loadfile combination +*/ +static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) +{ + const char *fname = BASEDIR "\\test.txt"; + NTSTATUS status; + struct smb_composite_savefile io1; + struct smb_composite_fetchfile io2; + struct smbcli_composite **c; + char *data; + int i; + size_t len = random() % 10000; + const int num_ops = 10; + struct event_context *event_ctx; + int *count = talloc_zero(mem_ctx, int); + + data = talloc_array(mem_ctx, uint8_t, len); + + generate_random_buffer(data, len); + + io1.in.fname = fname; + io1.in.data = data; + io1.in.size = len; + + printf("testing savefile\n"); + + status = smb_composite_savefile(cli->tree, &io1); + if (!NT_STATUS_IS_OK(status)) { + printf("savefile failed: %s\n", nt_errstr(status)); + return False; + } + + io2.in.dest_host = lp_parm_string(-1, "torture", "host"); + io2.in.port = 0; + io2.in.called_name = lp_parm_string(-1, "torture", "host"); + io2.in.calling_name = lp_netbios_name(); + io2.in.service = lp_parm_string(-1, "torture", "share"); + io2.in.service_type = "A:"; + io2.in.user = lp_parm_string(-1, "torture", "username"); + io2.in.domain = lp_parm_string(-1, "torture", "userdomain"); + io2.in.password = lp_parm_string(-1, "torture", "password"); + io2.in.filename = fname; + + printf("testing parallel fetchfile with %d ops\n", num_ops); + + event_ctx = event_context_init(mem_ctx); + c = talloc_array(mem_ctx, struct smbcli_composite *, num_ops); + + for (i=0; iasync.fn = loadfile_complete; + c[i]->async.private = count; + } + + printf("waiting for completion\n"); + + while (*count != num_ops) { + event_loop_once(event_ctx); +#if 0 + /* Attempt to kill the event ... To fix -- vl */ + for (i=0; istate == SMBCLI_REQUEST_ERROR) { + printf("error in %d\n", i); msleep(1000); + talloc_free(c[i]); c[i]=NULL; + } + } +#endif + printf("count=%d\r", *count); + fflush(stdout); + } + printf("count=%d\n", *count); + + for (i=0;isession); -- cgit From 93e27bec159db33e77a7eae34249f6073993815a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 27 Jan 2005 06:18:20 +0000 Subject: r5035: fixed composite test to use --num-ops command line option (This used to be commit f36e4cf6862c9cbcd36563007efa8dc59912d896) --- source4/torture/raw/composite.c | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index 5c09848f52..38941b8c56 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -121,9 +121,10 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) char *data; int i; size_t len = random() % 10000; - const int num_ops = 10; + extern int torture_numops; struct event_context *event_ctx; int *count = talloc_zero(mem_ctx, int); + BOOL ret = True; data = talloc_array(mem_ctx, uint8_t, len); @@ -152,12 +153,12 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) io2.in.password = lp_parm_string(-1, "torture", "password"); io2.in.filename = fname; - printf("testing parallel fetchfile with %d ops\n", num_ops); + printf("testing parallel fetchfile with %d ops\n", torture_numops); event_ctx = event_context_init(mem_ctx); - c = talloc_array(mem_ctx, struct smbcli_composite *, num_ops); + c = talloc_array(mem_ctx, struct smbcli_composite *, torture_numops); - for (i=0; iasync.fn = loadfile_complete; c[i]->async.private = count; @@ -165,45 +166,38 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) printf("waiting for completion\n"); - while (*count != num_ops) { + while (*count != torture_numops) { event_loop_once(event_ctx); -#if 0 - /* Attempt to kill the event ... To fix -- vl */ - for (i=0; istate == SMBCLI_REQUEST_ERROR) { - printf("error in %d\n", i); msleep(1000); - talloc_free(c[i]); c[i]=NULL; - } - } -#endif printf("count=%d\r", *count); fflush(stdout); } printf("count=%d\n", *count); - for (i=0;i Date: Thu, 27 Jan 2005 07:08:20 +0000 Subject: r5037: got rid of all of the TALLOC_DEPRECATED stuff. My apologies for the large commit. I thought this was worthwhile to get done for consistency. (This used to be commit ec32b22ed5ec224f6324f5e069d15e92e38e15c0) --- source4/torture/raw/composite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index 38941b8c56..d32c9393c2 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -226,6 +226,6 @@ BOOL torture_raw_composite(void) smbcli_deltree(cli->tree, BASEDIR); torture_close_connection(cli); - talloc_destroy(mem_ctx); + talloc_free(mem_ctx); return ret; } -- cgit From 9a70f446fc4abc2bd1278772810c0e8132f4bea4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 31 Jan 2005 08:30:44 +0000 Subject: r5126: the composite code is no longer client specific or smb specific, so rename the core structure to composite_context and the wait routine to composite_wait() (suggestion from metze) (This used to be commit cf11d05e35179c2c3e51c5ab370cd0a3fb15f24a) --- source4/torture/raw/composite.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index d32c9393c2..98f33bea3e 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -26,7 +26,7 @@ #define BASEDIR "\\composite" -static void loadfile_complete(struct smbcli_composite *c) +static void loadfile_complete(struct composite_context *c) { int *count = talloc_get_type(c->async.private, int); (*count)++; @@ -41,7 +41,7 @@ static BOOL test_loadfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) NTSTATUS status; struct smb_composite_savefile io1; struct smb_composite_loadfile io2; - struct smbcli_composite **c; + struct composite_context **c; char *data; size_t len = random() % 100000; const int num_ops = 50; @@ -68,7 +68,7 @@ static BOOL test_loadfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) printf("testing parallel loadfile with %d ops\n", num_ops); - c = talloc_array(mem_ctx, struct smbcli_composite *, num_ops); + c = talloc_array(mem_ctx, struct composite_context *, num_ops); for (i=0;itree, &io2); @@ -117,7 +117,7 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) NTSTATUS status; struct smb_composite_savefile io1; struct smb_composite_fetchfile io2; - struct smbcli_composite **c; + struct composite_context **c; char *data; int i; size_t len = random() % 10000; @@ -156,7 +156,7 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) printf("testing parallel fetchfile with %d ops\n", torture_numops); event_ctx = event_context_init(mem_ctx); - c = talloc_array(mem_ctx, struct smbcli_composite *, torture_numops); + c = talloc_array(mem_ctx, struct composite_context *, torture_numops); for (i=0; i Date: Thu, 3 Feb 2005 02:35:52 +0000 Subject: r5185: make all the events data structures private to events.c. This will make it possible to add optimisations to the events code such as keeping the next timed event in a sorted list, and using epoll for file descriptor events. I also removed the loop events code, as it wasn't being used anywhere, and changed timed events to always be one-shot (as adding a new timed event in the event handler is so easy to do if needed) (This used to be commit d7b4b6de51342a65bf46fce772d313f92f8d73d3) --- source4/torture/raw/composite.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index 98f33bea3e..49de23713e 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -21,6 +21,7 @@ */ #include "includes.h" +#include "events.h" #include "libcli/raw/libcliraw.h" #include "libcli/composite/composite.h" -- cgit From 131dc76d56df40b3511c47e54f15412a25b491f8 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 3 Feb 2005 11:56:03 +0000 Subject: r5197: moved events code to lib/events/ (suggestion from metze) (This used to be commit 7f54c8a339f36aa43c9340be70ab7f0067593ef2) --- source4/torture/raw/composite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index 49de23713e..9a0f924bfc 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -21,7 +21,7 @@ */ #include "includes.h" -#include "events.h" +#include "lib/events/events.h" #include "libcli/raw/libcliraw.h" #include "libcli/composite/composite.h" -- cgit From 05bc2d7b2c11a3583a6d1221cfbd618eb6730518 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 21 Mar 2005 21:22:07 +0000 Subject: r5928: Use cli_credentials in: - gtk+ (returned by GtkHostBindingDialog as well now) - torture/ - librpc/ - lib/com/dcom/ (This used to be commit ccefd782335e01e8e6ecb2bcd28a4f999c53b1a6) --- source4/torture/raw/composite.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index 9a0f924bfc..b9c7609b5f 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -24,6 +24,7 @@ #include "lib/events/events.h" #include "libcli/raw/libcliraw.h" #include "libcli/composite/composite.h" +#include "lib/cmdline/popt_common.h" #define BASEDIR "\\composite" @@ -149,9 +150,10 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) io2.in.calling_name = lp_netbios_name(); io2.in.service = lp_parm_string(-1, "torture", "share"); io2.in.service_type = "A:"; - io2.in.user = lp_parm_string(-1, "torture", "username"); - io2.in.domain = lp_parm_string(-1, "torture", "userdomain"); - io2.in.password = lp_parm_string(-1, "torture", "password"); + + io2.in.user = cli_credentials_get_username(cmdline_credentials); + io2.in.domain = cli_credentials_get_domain(cmdline_credentials); + io2.in.password = cli_credentials_get_password(cmdline_credentials); io2.in.filename = fname; printf("testing parallel fetchfile with %d ops\n", torture_numops); -- cgit From 2eb3d680625286431a3a60e37b75f47e0738f253 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 24 Mar 2005 04:14:06 +0000 Subject: r6028: A MAJOR update to intergrate the new credentails system fully with GENSEC, and to pull SCHANNEL into GENSEC, by making it less 'special'. GENSEC now no longer has it's own handling of 'set username' etc, instead it uses cli_credentials calls. In order to link the credentails code right though Samba, a lot of interfaces have changed to remove 'username, domain, password' arguments, and these have been replaced with a single 'struct cli_credentials'. In the session setup code, a new parameter 'workgroup' contains the client/server current workgroup, which seems unrelated to the authentication exchange (it was being filled in from the auth info). This allows in particular kerberos to only call back for passwords when it actually needs to perform the kinit. The kerberos code has been modified not to use the SPNEGO provided 'principal name' (in the mechListMIC), but to instead use the name the host was connected to as. This better matches Microsoft behaviour, is more secure and allows better use of standard kerberos functions. To achieve this, I made changes to our socket code so that the hostname (before name resolution) is now recorded on the socket. In schannel, most of the code from librpc/rpc/dcerpc_schannel.c is now in libcli/auth/schannel.c, and it looks much more like a standard GENSEC module. The actual sign/seal code moved to libcli/auth/schannel_sign.c in a previous commit. The schannel credentails structure is now merged with the rest of the credentails, as many of the values (username, workstation, domain) where already present there. This makes handling this in a generic manner much easier, as there is no longer a custom entry-point. The auth_domain module continues to be developed, but is now just as functional as auth_winbind. The changes here are consequential to the schannel changes. The only removed function at this point is the RPC-LOGIN test (simulating the load of a WinXP login), which needs much more work to clean it up (it contains copies of too much code from all over the torture suite, and I havn't been able to penetrate its 'structure'). Andrew Bartlett (This used to be commit 2301a4b38a21aa60917973451687063d83d18d66) --- source4/torture/raw/composite.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index b9c7609b5f..f836e1eb4b 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -147,13 +147,11 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) io2.in.dest_host = lp_parm_string(-1, "torture", "host"); io2.in.port = 0; io2.in.called_name = lp_parm_string(-1, "torture", "host"); - io2.in.calling_name = lp_netbios_name(); io2.in.service = lp_parm_string(-1, "torture", "share"); io2.in.service_type = "A:"; - io2.in.user = cli_credentials_get_username(cmdline_credentials); - io2.in.domain = cli_credentials_get_domain(cmdline_credentials); - io2.in.password = cli_credentials_get_password(cmdline_credentials); + io2.in.credentials = cmdline_credentials; + io2.in.workgroup = lp_workgroup(); io2.in.filename = fname; printf("testing parallel fetchfile with %d ops\n", torture_numops); -- cgit From 9779e6d670d19a5dfdc034084b580653d5ca0670 Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Fri, 15 Apr 2005 14:45:00 +0000 Subject: r6352: Two new composite calls: - qfsinfo (query file system information) - appendacl (append an ACL to existing file's security descriptor and get new full ACL) The second one also includes an improvement to security descriptor handling which allows to copy security descriptor. Written by Peter Novodvorsky Both functions have corresponding torture tests added. Tested under valgrind and work against Samba 4 and Windows XP. ToDo: document composite call creation process in prog_guide.txt (This used to be commit 441cff62ac75ed16851ce7b8daf9d03eb4c3ec79) --- source4/torture/raw/composite.c | 187 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 187 insertions(+) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index f836e1eb4b..98615b7de4 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -25,6 +25,7 @@ #include "libcli/raw/libcliraw.h" #include "libcli/composite/composite.h" #include "lib/cmdline/popt_common.h" +#include "librpc/gen_ndr/ndr_security.h" #define BASEDIR "\\composite" @@ -201,6 +202,190 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) return ret; } +/* + test setfileacl +*/ +static BOOL test_appendacl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) +{ + struct smb_composite_appendacl **io; + struct smb_composite_appendacl **io_orig; + struct composite_context **c; + struct event_context *event_ctx; + + struct security_descriptor *test_sd; + struct security_ace *ace; + struct dom_sid *test_sid; + + const int num_ops = 50; + int *count = talloc_zero(mem_ctx, int); + struct smb_composite_savefile io1; + + NTSTATUS status; + int i; + + io_orig = talloc_array(mem_ctx, struct smb_composite_appendacl *, num_ops); + + printf ("creating %d empty files and getting their acls with appendacl\n", num_ops); + + for (i = 0; i < num_ops; i++) { + io1.in.fname = talloc_asprintf(io_orig, BASEDIR "\\test%d.txt", i); + io1.in.data = NULL; + io1.in.size = 0; + + status = smb_composite_savefile(cli->tree, &io1); + if (!NT_STATUS_IS_OK(status)) { + printf("savefile failed: %s\n", nt_errstr(status)); + return False; + } + + io_orig[i] = talloc (io_orig, struct smb_composite_appendacl); + io_orig[i]->in.fname = talloc_steal(io_orig[i], io1.in.fname); + io_orig[i]->in.sd = security_descriptor_initialise(io_orig[i]); + status = smb_composite_appendacl(cli->tree, io_orig[i], io_orig[i]); + if (!NT_STATUS_IS_OK(status)) { + printf("appendacl failed: %s\n", nt_errstr(status)); + return False; + } + } + + + /* fill Security Descriptor with aces to be added */ + + test_sd = security_descriptor_initialise(mem_ctx); + test_sid = dom_sid_parse_talloc (mem_ctx, "S-1-5-32-1234-5432"); + + ace = talloc_zero(mem_ctx, struct security_ace); + + ace->type = SEC_ACE_TYPE_ACCESS_ALLOWED; + ace->flags = 0; + ace->access_mask = SEC_STD_ALL; + ace->trustee = *test_sid; + + status = security_descriptor_dacl_add(test_sd, ace); + if (!NT_STATUS_IS_OK(status)) { + printf("appendacl failed: %s\n", nt_errstr(status)); + return False; + } + + /* set parameters for appendacl async call */ + + printf("testing parallel appendacl with %d ops\n", num_ops); + + c = talloc_array(mem_ctx, struct composite_context *, num_ops); + io = talloc_array(mem_ctx, struct smb_composite_appendacl *, num_ops); + + for (i=0; i < num_ops; i++) { + io[i] = talloc (io, struct smb_composite_appendacl); + io[i]->in.sd = test_sd; + io[i]->in.fname = talloc_asprintf(io[i], BASEDIR "\\test%d.txt", i); + + c[i] = smb_composite_appendacl_send(cli->tree, io[i]); + c[i]->async.fn = loadfile_complete; + c[i]->async.private = count; + } + + event_ctx = talloc_reference(mem_ctx, cli->tree->session->transport->socket->event.ctx); + printf("waiting for completion\n"); + while (*count != num_ops) { + event_loop_once(event_ctx); + printf("count=%d\r", *count); + fflush(stdout); + } + printf("count=%d\n", *count); + + for (i=0; i < num_ops; i++) { + struct security_descriptor sd; + + status = smb_composite_appendacl_recv(c[i], io[i]); + if (!NT_STATUS_IS_OK(status)) { + printf("appendacl[%d] failed - %s\n", i, nt_errstr(status)); + return False; + } + + security_descriptor_dacl_add(io_orig[i]->out.sd, ace); + if (!security_acl_equal(io_orig[i]->out.sd->dacl, io[i]->out.sd->dacl)) { + printf("appendacl[%d] failed - needed acl isn't set\n", i); + return False; + } + } + + + talloc_free (ace); + talloc_free (test_sid); + talloc_free (test_sd); + + return True; +} + +/* test a query FS info by asking for share's GUID */ +static BOOL test_fsinfo(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) +{ + char *guid = NULL; + NTSTATUS status; + struct smb_composite_fsinfo io1; + struct composite_context **c; + + int i; + extern int torture_numops; + struct event_context *event_ctx; + int *count = talloc_zero(mem_ctx, int); + BOOL ret = True; + + io1.in.dest_host = lp_parm_string(-1, "torture", "host"); + io1.in.port = 0; + io1.in.called_name = lp_parm_string(-1, "torture", "host"); + io1.in.service = lp_parm_string(-1, "torture", "share"); + io1.in.service_type = "A:"; + io1.in.credentials = cmdline_credentials; + io1.in.workgroup = lp_workgroup(); + io1.in.level = RAW_QFS_OBJECTID_INFORMATION; + + printf("testing parallel queryfsinfo [Object ID] with %d ops\n", torture_numops); + + event_ctx = talloc_reference(mem_ctx, cli->tree->session->transport->socket->event.ctx); + c = talloc_array(mem_ctx, struct composite_context *, torture_numops); + + for (i=0; itree,&io1); + c[i]->async.fn = loadfile_complete; + c[i]->async.private = count; + } + + printf("waiting for completion\n"); + + while (*count < torture_numops) { + event_loop_once(event_ctx); + printf("count=%d\r", *count); + fflush(stdout); + } + printf("count=%d\n", *count); + + for (i=0;igeneric.level != RAW_QFS_OBJECTID_INFORMATION) { + printf("wrong level in returned info - %d " + "should be %d\n", + io1.out.fsinfo->generic.level, RAW_QFS_OBJECTID_INFORMATION); + ret = False; + continue; + } + + guid=GUID_string(mem_ctx, &io1.out.fsinfo->objectid_information.out.guid); + printf("[%d] GUID: %s\n", i, guid); + + + } + + return ret; +} + + /* basic testing of libcli composite calls */ @@ -222,6 +407,8 @@ BOOL torture_raw_composite(void) ret &= test_fetchfile(cli, mem_ctx); ret &= test_loadfile(cli, mem_ctx); + ret &= test_appendacl(cli, mem_ctx); + ret &= test_fsinfo(cli, mem_ctx); smb_raw_exit(cli->session); smbcli_deltree(cli->tree, BASEDIR); -- cgit From 78176b7ee0a4a395131ca8899a6e765ee68e389e Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Mon, 9 May 2005 02:29:54 +0000 Subject: r6676: Fix unused variable. (This used to be commit 699e0adf4cba1473b48ff38c8043dbc36bc43560) --- source4/torture/raw/composite.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index 98615b7de4..e78227be16 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -294,8 +294,6 @@ static BOOL test_appendacl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) printf("count=%d\n", *count); for (i=0; i < num_ops; i++) { - struct security_descriptor sd; - status = smb_composite_appendacl_recv(c[i], io[i]); if (!NT_STATUS_IS_OK(status)) { printf("appendacl[%d] failed - %s\n", i, nt_errstr(status)); -- cgit From e835621799647ee70630b389fb53d15b15d68355 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 17 Jul 2005 09:20:52 +0000 Subject: r8520: fixed a pile of warnings from the build farm gcc -Wall output on S390. This is an attempt to avoid the panic we're seeing in the automatic builds. The main fixes are: - assumptions that sizeof(size_t) == sizeof(int), mostly in printf formats - use of NULL format statements to perform dn searches. - assumption that sizeof() returns an int (This used to be commit a58ea6b3854973b694d2b1e22323ed7eb00e3a3f) --- source4/torture/raw/composite.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index e78227be16..457bcea7f9 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -96,7 +96,7 @@ static BOOL test_loadfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) if (io2.out.size != len) { printf("wrong length in returned data - %d should be %d\n", - io2.out.size, len); + io2.out.size, (int)len); return False; } @@ -187,7 +187,7 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) if (io2.out.size != len) { printf("wrong length in returned data - %d " "should be %d\n", - io2.out.size, len); + io2.out.size, (int)len); ret = False; continue; } -- cgit From ab4d635b92b116b02b88843b4ec4f5b7517bab1a Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 26 Sep 2005 11:47:55 +0000 Subject: r10504: - seperate implementation specific stuff, from the generic composite stuff. - don't use SMBCLI_REQUEST_* state's in the genreic composite stuff - move monitor_fn to libnet. NOTE: I have maybe found some bugs, in code that is dirrectly in DONE or ERROR state in the _send() function. I haven't fixed this bugs in this commit! We may need some composite_trigger_*() functions or so. And maybe some other generic helper functions... metze (This used to be commit 4527815a0a9b96e460f301cb1f0c0b3964c166fc) --- source4/torture/raw/composite.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index 457bcea7f9..fafdb90ec3 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -24,6 +24,7 @@ #include "lib/events/events.h" #include "libcli/raw/libcliraw.h" #include "libcli/composite/composite.h" +#include "libcli/smb_composite/smb_composite.h" #include "lib/cmdline/popt_common.h" #include "librpc/gen_ndr/ndr_security.h" @@ -31,7 +32,7 @@ static void loadfile_complete(struct composite_context *c) { - int *count = talloc_get_type(c->async.private, int); + int *count = talloc_get_type(c->async.private_data, int); (*count)++; } @@ -76,7 +77,7 @@ static BOOL test_loadfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) for (i=0;itree, &io2); c[i]->async.fn = loadfile_complete; - c[i]->async.private = count; + c[i]->async.private_data = count; } printf("waiting for completion\n"); @@ -163,7 +164,7 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) for (i=0; iasync.fn = loadfile_complete; - c[i]->async.private = count; + c[i]->async.private_data = count; } printf("waiting for completion\n"); @@ -281,7 +282,7 @@ static BOOL test_appendacl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) c[i] = smb_composite_appendacl_send(cli->tree, io[i]); c[i]->async.fn = loadfile_complete; - c[i]->async.private = count; + c[i]->async.private_data = count; } event_ctx = talloc_reference(mem_ctx, cli->tree->session->transport->socket->event.ctx); @@ -346,7 +347,7 @@ static BOOL test_fsinfo(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) for (i=0; itree,&io1); c[i]->async.fn = loadfile_complete; - c[i]->async.private = count; + c[i]->async.private_data = count; } printf("waiting for completion\n"); -- cgit From 25bb00fbcd409572e1c19c05fdc42c883936780b Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 3 Jan 2006 13:41:17 +0000 Subject: r12693: Move core data structures out of smb.h into core.h torture prototypes in seperate header (This used to be commit 73610639b23ca3743077193fa0b1de7c7f65944d) --- source4/torture/raw/composite.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index fafdb90ec3..f9fe0eb83c 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -21,6 +21,7 @@ */ #include "includes.h" +#include "torture/torture.h" #include "lib/events/events.h" #include "libcli/raw/libcliraw.h" #include "libcli/composite/composite.h" -- cgit From 78c50015bb8bd5a1d831a6e7ec796b3367c73145 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 3 Jan 2006 15:40:05 +0000 Subject: r12694: Move some headers to the directory of the subsystem they belong to. (This used to be commit c722f665c90103f3ed57621c460e32ad33e7a8a3) --- source4/torture/raw/composite.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index f9fe0eb83c..760d464fb5 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -24,6 +24,7 @@ #include "torture/torture.h" #include "lib/events/events.h" #include "libcli/raw/libcliraw.h" +#include "libcli/libcli.h" #include "libcli/composite/composite.h" #include "libcli/smb_composite/smb_composite.h" #include "lib/cmdline/popt_common.h" -- cgit From a920f2f9a8e4ee076471c293765ed0bee13d4cc5 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 18 Jan 2006 16:20:33 +0000 Subject: r13004: fix compiler warnings metze (This used to be commit 833efdf8a943b210ba8e5b219dc754260001bedb) --- source4/torture/raw/composite.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index 760d464fb5..6025c3d1e4 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -48,7 +48,7 @@ static BOOL test_loadfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) struct smb_composite_savefile io1; struct smb_composite_loadfile io2; struct composite_context **c; - char *data; + uint8_t *data; size_t len = random() % 100000; const int num_ops = 50; int i; @@ -124,7 +124,7 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) struct smb_composite_savefile io1; struct smb_composite_fetchfile io2; struct composite_context **c; - char *data; + uint8_t *data; int i; size_t len = random() % 10000; extern int torture_numops; -- cgit From 4ac2be99588b48b0652a524bf12fb1aa9c3f5fbb Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 7 Mar 2006 11:07:23 +0000 Subject: r13924: Split more prototypes out of include/proto.h + initial work on header file dependencies (This used to be commit 122835876748a3eaf5e8d31ad1abddab9acb8781) --- source4/torture/raw/composite.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index 6025c3d1e4..97c47acc7e 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -25,6 +25,7 @@ #include "lib/events/events.h" #include "libcli/raw/libcliraw.h" #include "libcli/libcli.h" +#include "libcli/security/proto.h" #include "libcli/composite/composite.h" #include "libcli/smb_composite/smb_composite.h" #include "lib/cmdline/popt_common.h" -- cgit From 8528016978b084213ef53d66e1b6e831b1a01acc Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 16 Mar 2006 00:23:11 +0000 Subject: r14464: Don't include ndr_BASENAME.h files unless strictly required, instead try to include just the BASENAME.h files (containing only structs) (This used to be commit 3dd477ca5147f28a962b8437e2611a8222d706bd) --- source4/torture/raw/composite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index 97c47acc7e..d8f7a78b11 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -29,7 +29,7 @@ #include "libcli/composite/composite.h" #include "libcli/smb_composite/smb_composite.h" #include "lib/cmdline/popt_common.h" -#include "librpc/gen_ndr/ndr_security.h" +#include "librpc/gen_ndr/security.h" #define BASEDIR "\\composite" -- cgit From d09b70c98b8222eb293bc9d8713ec071188ed01d Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 17 Mar 2006 17:59:58 +0000 Subject: r14527: Fix build problems. (This used to be commit 863ca4014d9b821706ee90f58ab5d5cf3899a4c7) --- source4/torture/raw/composite.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index d8f7a78b11..237136c3f7 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -30,6 +30,7 @@ #include "libcli/smb_composite/smb_composite.h" #include "lib/cmdline/popt_common.h" #include "librpc/gen_ndr/security.h" +#include "torture/util.h" #define BASEDIR "\\composite" -- cgit From 35349a58df5b69446607fbd742a05f57f3515319 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 18 Mar 2006 15:42:57 +0000 Subject: r14542: Remove librpc, libndr and libnbt from includes.h (This used to be commit 51b4270513752d2eafbe77f9de598de16ef84a1f) --- source4/torture/raw/composite.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index 237136c3f7..53b21c2829 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -28,6 +28,7 @@ #include "libcli/security/proto.h" #include "libcli/composite/composite.h" #include "libcli/smb_composite/smb_composite.h" +#include "librpc/gen_ndr/ndr_misc.h" #include "lib/cmdline/popt_common.h" #include "librpc/gen_ndr/security.h" #include "torture/util.h" -- cgit From 909b111f587705a45f63540b39968f1af58a9b5d Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 25 Mar 2006 16:01:28 +0000 Subject: r14720: Add torture_context argument to all torture tests (This used to be commit 3c7a5ce29108dd82210dc3e1f00414f545949e1d) --- source4/torture/raw/composite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index 53b21c2829..2ce827df6a 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -393,7 +393,7 @@ static BOOL test_fsinfo(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) /* basic testing of libcli composite calls */ -BOOL torture_raw_composite(void) +BOOL torture_raw_composite(struct torture_context *torture) { struct smbcli_state *cli; BOOL ret = True; -- cgit From 1af925f394b1084779f5b1b5a10c2ec512d7e5be Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 2 Apr 2006 12:02:01 +0000 Subject: r14860: create libcli/security/security.h metze (This used to be commit 9ec706238c173992dc938d537bdf1103bf519dbf) --- source4/torture/raw/composite.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index 2ce827df6a..8d824d24f2 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -25,12 +25,11 @@ #include "lib/events/events.h" #include "libcli/raw/libcliraw.h" #include "libcli/libcli.h" -#include "libcli/security/proto.h" +#include "libcli/security/security.h" #include "libcli/composite/composite.h" #include "libcli/smb_composite/smb_composite.h" #include "librpc/gen_ndr/ndr_misc.h" #include "lib/cmdline/popt_common.h" -#include "librpc/gen_ndr/security.h" #include "torture/util.h" #define BASEDIR "\\composite" -- cgit From b7c5bc522b286e8e478b6f74a68bc68829e64c3c Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 10 Jul 2006 08:00:06 +0000 Subject: r16907: Add an index parameter to torture_open_connection. Next step is to enable the unclist parameter for all tests that do two connections, to enable cluster testing. Volker (This used to be commit a5d6db09244d444986f8fded3fc6e72c74c8ca1f) --- source4/torture/raw/composite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index 8d824d24f2..2dd079c4b0 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -398,7 +398,7 @@ BOOL torture_raw_composite(struct torture_context *torture) BOOL ret = True; TALLOC_CTX *mem_ctx; - if (!torture_open_connection(&cli)) { + if (!torture_open_connection(&cli, 0)) { return False; } -- cgit From f6274959ba381b6b5d025cb0cee78665107a72a6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 10 Jan 2007 11:16:11 +0000 Subject: r20647: add cluster code (This used to be commit 5870830b99a8d76bda1ff5af3fcf8dda9aba50ec) --- source4/torture/raw/composite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index 2dd079c4b0..2cba5cee89 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -162,7 +162,7 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) printf("testing parallel fetchfile with %d ops\n", torture_numops); - event_ctx = event_context_init(mem_ctx); + event_ctx = event_context_find(mem_ctx); c = talloc_array(mem_ctx, struct composite_context *, torture_numops); for (i=0; i Date: Wed, 10 Jan 2007 11:50:33 +0000 Subject: r20650: revert a bunch of code I didn't mean to commit yet (This used to be commit b3e2d4908781781a487eaeb683d22eb967e5597d) --- source4/torture/raw/composite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index 2cba5cee89..2dd079c4b0 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -162,7 +162,7 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) printf("testing parallel fetchfile with %d ops\n", torture_numops); - event_ctx = event_context_find(mem_ctx); + event_ctx = event_context_init(mem_ctx); c = talloc_array(mem_ctx, struct composite_context *, torture_numops); for (i=0; i Date: Sun, 29 Apr 2007 21:37:29 +0000 Subject: r22579: disable progress printing in the build-farm metze (This used to be commit 93089ad5e8b6e20c4fa92bf13b0137765aeac689) --- source4/torture/raw/composite.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index 2dd079c4b0..b551af00b1 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -87,8 +87,10 @@ static BOOL test_loadfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) printf("waiting for completion\n"); while (*count != num_ops) { event_loop_once(cli->transport->socket->event.ctx); - printf("count=%d\r", *count); - fflush(stdout); + if (lp_parm_bool(-1, "torture", "progress", true)) { + printf("count=%d\r", *count); + fflush(stdout); + } } printf("count=%d\n", *count); @@ -175,8 +177,10 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) while (*count != torture_numops) { event_loop_once(event_ctx); - printf("count=%d\r", *count); - fflush(stdout); + if (lp_parm_bool(-1, "torture", "progress", true)) { + printf("count=%d\r", *count); + fflush(stdout); + } } printf("count=%d\n", *count); @@ -293,8 +297,10 @@ static BOOL test_appendacl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) printf("waiting for completion\n"); while (*count != num_ops) { event_loop_once(event_ctx); - printf("count=%d\r", *count); - fflush(stdout); + if (lp_parm_bool(-1, "torture", "progress", true)) { + printf("count=%d\r", *count); + fflush(stdout); + } } printf("count=%d\n", *count); @@ -358,8 +364,10 @@ static BOOL test_fsinfo(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) while (*count < torture_numops) { event_loop_once(event_ctx); - printf("count=%d\r", *count); - fflush(stdout); + if (lp_parm_bool(-1, "torture", "progress", true)) { + printf("count=%d\r", *count); + fflush(stdout); + } } printf("count=%d\n", *count); -- cgit From c42219d7352bd2e7a6413f7ae1cd0fd5cded1d95 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 17 May 2007 08:47:04 +0000 Subject: r22969: fix some more places where we could end up with more than one event context. We now have an event context on the torture_context, and we can also get one from the cli_credentials structure (This used to be commit c0f65eb6562e13530337c23e3447a6aa6eb8fc17) --- source4/torture/raw/composite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index b551af00b1..e68ebcc824 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -164,7 +164,7 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) printf("testing parallel fetchfile with %d ops\n", torture_numops); - event_ctx = event_context_init(mem_ctx); + event_ctx = cli->transport->socket->event.ctx; c = talloc_array(mem_ctx, struct composite_context *, torture_numops); for (i=0; i Date: Tue, 10 Jul 2007 02:07:03 +0000 Subject: r23792: convert Samba4 to GPLv3 There are still a few tidyups of old FSF addresses to come (in both s3 and s4). More commits soon. (This used to be commit fcf38a38ac691abd0fa51b89dc951a08e89fdafa) --- source4/torture/raw/composite.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index e68ebcc824..0b7644dd03 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -7,7 +7,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -16,8 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #include "includes.h" -- cgit From 919aa6b27e5fe49b70c814210aa026c19be66e8a Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 28 Aug 2007 12:54:27 +0000 Subject: r24735: Use torture API in more places. (This used to be commit 1319d88c099496be29dd9214fa2492c81e848369) --- source4/torture/raw/composite.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index 0b7644dd03..374ff3cb98 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -399,31 +399,22 @@ static BOOL test_fsinfo(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) /* basic testing of libcli composite calls */ -BOOL torture_raw_composite(struct torture_context *torture) +bool torture_raw_composite(struct torture_context *tctx, + struct smbcli_state *cli) { - struct smbcli_state *cli; - BOOL ret = True; - TALLOC_CTX *mem_ctx; - - if (!torture_open_connection(&cli, 0)) { - return False; - } - - mem_ctx = talloc_init("torture_raw_composite"); + bool ret = true; if (!torture_setup_dir(cli, BASEDIR)) { return False; } - ret &= test_fetchfile(cli, mem_ctx); - ret &= test_loadfile(cli, mem_ctx); - ret &= test_appendacl(cli, mem_ctx); - ret &= test_fsinfo(cli, mem_ctx); + ret &= test_fetchfile(cli, tctx); + ret &= test_loadfile(cli, tctx); + ret &= test_appendacl(cli, tctx); + ret &= test_fsinfo(cli, tctx); smb_raw_exit(cli->session); smbcli_deltree(cli->tree, BASEDIR); - torture_close_connection(cli); - talloc_free(mem_ctx); return ret; } -- cgit From cd962355abad90a2161765a7be7d26e63572cab7 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 7 Sep 2007 15:08:14 +0000 Subject: r25000: Fix some more C++ compatibility warnings. (This used to be commit 08bb1ef643ab906f1645cf6f32763dc73b1884e4) --- source4/torture/raw/composite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index 374ff3cb98..e66ebcde02 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -400,7 +400,7 @@ static BOOL test_fsinfo(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) basic testing of libcli composite calls */ bool torture_raw_composite(struct torture_context *tctx, - struct smbcli_state *cli) + struct smbcli_state *cli) { bool ret = true; -- cgit From ffeee68e4b72dd94fee57366bd8d38b8c284c3d4 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 8 Sep 2007 12:42:09 +0000 Subject: r25026: Move param/param.h out of includes.h (This used to be commit abe8349f9b4387961ff3665d8c589d61cd2edf31) --- source4/torture/raw/composite.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index e66ebcde02..ea5c09c335 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -30,6 +30,7 @@ #include "librpc/gen_ndr/ndr_misc.h" #include "lib/cmdline/popt_common.h" #include "torture/util.h" +#include "param/param.h" #define BASEDIR "\\composite" -- cgit From 98b57d5eb61094a9c88e2f7d90d3e21b7e74e9d8 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 8 Sep 2007 16:46:30 +0000 Subject: r25035: Fix some more warnings, use service pointer rather than service number in more places. (This used to be commit df9cebcb97e20564359097148665bd519f31bc6f) --- source4/torture/raw/composite.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index ea5c09c335..370c1f510b 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -87,7 +87,7 @@ static BOOL test_loadfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) printf("waiting for completion\n"); while (*count != num_ops) { event_loop_once(cli->transport->socket->event.ctx); - if (lp_parm_bool(-1, "torture", "progress", true)) { + if (lp_parm_bool(NULL, "torture", "progress", true)) { printf("count=%d\r", *count); fflush(stdout); } @@ -152,10 +152,10 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) return False; } - io2.in.dest_host = lp_parm_string(-1, "torture", "host"); + io2.in.dest_host = lp_parm_string(NULL, "torture", "host"); io2.in.port = 0; - io2.in.called_name = lp_parm_string(-1, "torture", "host"); - io2.in.service = lp_parm_string(-1, "torture", "share"); + io2.in.called_name = lp_parm_string(NULL, "torture", "host"); + io2.in.service = lp_parm_string(NULL, "torture", "share"); io2.in.service_type = "A:"; io2.in.credentials = cmdline_credentials; @@ -177,7 +177,7 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) while (*count != torture_numops) { event_loop_once(event_ctx); - if (lp_parm_bool(-1, "torture", "progress", true)) { + if (lp_parm_bool(NULL, "torture", "progress", true)) { printf("count=%d\r", *count); fflush(stdout); } @@ -297,7 +297,7 @@ static BOOL test_appendacl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) printf("waiting for completion\n"); while (*count != num_ops) { event_loop_once(event_ctx); - if (lp_parm_bool(-1, "torture", "progress", true)) { + if (lp_parm_bool(NULL, "torture", "progress", true)) { printf("count=%d\r", *count); fflush(stdout); } @@ -340,10 +340,10 @@ static BOOL test_fsinfo(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) int *count = talloc_zero(mem_ctx, int); BOOL ret = True; - io1.in.dest_host = lp_parm_string(-1, "torture", "host"); + io1.in.dest_host = lp_parm_string(NULL, "torture", "host"); io1.in.port = 0; - io1.in.called_name = lp_parm_string(-1, "torture", "host"); - io1.in.service = lp_parm_string(-1, "torture", "share"); + io1.in.called_name = lp_parm_string(NULL, "torture", "host"); + io1.in.service = lp_parm_string(NULL, "torture", "share"); io1.in.service_type = "A:"; io1.in.credentials = cmdline_credentials; io1.in.workgroup = lp_workgroup(); @@ -364,7 +364,7 @@ static BOOL test_fsinfo(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) while (*count < torture_numops) { event_loop_once(event_ctx); - if (lp_parm_bool(-1, "torture", "progress", true)) { + if (lp_parm_bool(NULL, "torture", "progress", true)) { printf("count=%d\r", *count); fflush(stdout); } -- cgit From 70b33dc533202cf52433c4e99fe2abb1c63a4f8f Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 22 Sep 2007 09:22:58 +0000 Subject: r25296: Apply patch by Elrond : Put __location__ into a few printfs. Thanks, Volker (This used to be commit b0e323a09e5f888850833dc4532110f8ceebb14b) --- source4/torture/raw/composite.c | 42 ++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index 370c1f510b..283781205f 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -68,7 +68,7 @@ static BOOL test_loadfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) status = smb_composite_savefile(cli->tree, &io1); if (!NT_STATUS_IS_OK(status)) { - printf("savefile failed: %s\n", nt_errstr(status)); + printf("(%s) savefile failed: %s\n", __location__,nt_errstr(status)); return False; } @@ -88,7 +88,7 @@ static BOOL test_loadfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) while (*count != num_ops) { event_loop_once(cli->transport->socket->event.ctx); if (lp_parm_bool(NULL, "torture", "progress", true)) { - printf("count=%d\r", *count); + printf("(%s) count=%d\r", __location__, *count); fflush(stdout); } } @@ -97,18 +97,18 @@ static BOOL test_loadfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) for (i=0;itree, &io1); if (!NT_STATUS_IS_OK(status)) { - printf("savefile failed: %s\n", nt_errstr(status)); + printf("(%s) savefile failed: %s\n",__location__, nt_errstr(status)); return False; } @@ -178,7 +178,7 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) while (*count != torture_numops) { event_loop_once(event_ctx); if (lp_parm_bool(NULL, "torture", "progress", true)) { - printf("count=%d\r", *count); + printf("(%s) count=%d\r", __location__, *count); fflush(stdout); } } @@ -187,22 +187,22 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) for (i=0;itree, &io1); if (!NT_STATUS_IS_OK(status)) { - printf("savefile failed: %s\n", nt_errstr(status)); + printf("(%s) savefile failed: %s\n", __location__, nt_errstr(status)); return False; } @@ -252,7 +252,7 @@ static BOOL test_appendacl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) io_orig[i]->in.sd = security_descriptor_initialise(io_orig[i]); status = smb_composite_appendacl(cli->tree, io_orig[i], io_orig[i]); if (!NT_STATUS_IS_OK(status)) { - printf("appendacl failed: %s\n", nt_errstr(status)); + printf("(%s) appendacl failed: %s\n", __location__, nt_errstr(status)); return False; } } @@ -272,7 +272,7 @@ static BOOL test_appendacl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) status = security_descriptor_dacl_add(test_sd, ace); if (!NT_STATUS_IS_OK(status)) { - printf("appendacl failed: %s\n", nt_errstr(status)); + printf("(%s) appendacl failed: %s\n", __location__, nt_errstr(status)); return False; } @@ -298,7 +298,7 @@ static BOOL test_appendacl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) while (*count != num_ops) { event_loop_once(event_ctx); if (lp_parm_bool(NULL, "torture", "progress", true)) { - printf("count=%d\r", *count); + printf("(%s) count=%d\r", __location__, *count); fflush(stdout); } } @@ -307,13 +307,13 @@ static BOOL test_appendacl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) for (i=0; i < num_ops; i++) { status = smb_composite_appendacl_recv(c[i], io[i]); if (!NT_STATUS_IS_OK(status)) { - printf("appendacl[%d] failed - %s\n", i, nt_errstr(status)); + printf("(%s) appendacl[%d] failed - %s\n", __location__, i, nt_errstr(status)); return False; } security_descriptor_dacl_add(io_orig[i]->out.sd, ace); if (!security_acl_equal(io_orig[i]->out.sd->dacl, io[i]->out.sd->dacl)) { - printf("appendacl[%d] failed - needed acl isn't set\n", i); + printf("(%s) appendacl[%d] failed - needed acl isn't set\n", __location__, i); return False; } } @@ -365,7 +365,7 @@ static BOOL test_fsinfo(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) while (*count < torture_numops) { event_loop_once(event_ctx); if (lp_parm_bool(NULL, "torture", "progress", true)) { - printf("count=%d\r", *count); + printf("(%s) count=%d\r", __location__, *count); fflush(stdout); } } @@ -374,14 +374,14 @@ static BOOL test_fsinfo(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) for (i=0;igeneric.level != RAW_QFS_OBJECTID_INFORMATION) { - printf("wrong level in returned info - %d " - "should be %d\n", + printf("(%s) wrong level in returned info - %d " + "should be %d\n", __location__, io1.out.fsinfo->generic.level, RAW_QFS_OBJECTID_INFORMATION); ret = False; continue; -- cgit From 37d53832a4623653f706e77985a79d84bd7c6694 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 28 Sep 2007 01:17:46 +0000 Subject: r25398: Parse loadparm context to all lp_*() functions. (This used to be commit 3fcc960839c6e5ca4de2c3c042f12f369ac5f238) --- source4/torture/raw/composite.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index 283781205f..ab406f8624 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -159,7 +159,7 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) io2.in.service_type = "A:"; io2.in.credentials = cmdline_credentials; - io2.in.workgroup = lp_workgroup(); + io2.in.workgroup = lp_workgroup(global_loadparm); io2.in.filename = fname; printf("testing parallel fetchfile with %d ops\n", torture_numops); @@ -346,7 +346,7 @@ static BOOL test_fsinfo(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) io1.in.service = lp_parm_string(NULL, "torture", "share"); io1.in.service_type = "A:"; io1.in.credentials = cmdline_credentials; - io1.in.workgroup = lp_workgroup(); + io1.in.workgroup = lp_workgroup(global_loadparm); io1.in.level = RAW_QFS_OBJECTID_INFORMATION; printf("testing parallel queryfsinfo [Object ID] with %d ops\n", torture_numops); -- cgit From 60a1046c5c5783799bd64fe18e03534670f83d82 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 29 Sep 2007 18:00:19 +0000 Subject: r25430: Add the loadparm context to all parametric options. (This used to be commit fd697d77c9fe67a00939a1f04b35c451316fff58) --- source4/torture/raw/composite.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index ab406f8624..d713ff321e 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -87,7 +87,7 @@ static BOOL test_loadfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) printf("waiting for completion\n"); while (*count != num_ops) { event_loop_once(cli->transport->socket->event.ctx); - if (lp_parm_bool(NULL, "torture", "progress", true)) { + if (lp_parm_bool(global_loadparm, NULL, "torture", "progress", true)) { printf("(%s) count=%d\r", __location__, *count); fflush(stdout); } @@ -152,10 +152,10 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) return False; } - io2.in.dest_host = lp_parm_string(NULL, "torture", "host"); + io2.in.dest_host = lp_parm_string(global_loadparm, NULL, "torture", "host"); io2.in.port = 0; - io2.in.called_name = lp_parm_string(NULL, "torture", "host"); - io2.in.service = lp_parm_string(NULL, "torture", "share"); + io2.in.called_name = lp_parm_string(global_loadparm, NULL, "torture", "host"); + io2.in.service = lp_parm_string(global_loadparm, NULL, "torture", "share"); io2.in.service_type = "A:"; io2.in.credentials = cmdline_credentials; @@ -177,7 +177,7 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) while (*count != torture_numops) { event_loop_once(event_ctx); - if (lp_parm_bool(NULL, "torture", "progress", true)) { + if (lp_parm_bool(global_loadparm, NULL, "torture", "progress", true)) { printf("(%s) count=%d\r", __location__, *count); fflush(stdout); } @@ -297,7 +297,7 @@ static BOOL test_appendacl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) printf("waiting for completion\n"); while (*count != num_ops) { event_loop_once(event_ctx); - if (lp_parm_bool(NULL, "torture", "progress", true)) { + if (lp_parm_bool(global_loadparm, NULL, "torture", "progress", true)) { printf("(%s) count=%d\r", __location__, *count); fflush(stdout); } @@ -340,10 +340,10 @@ static BOOL test_fsinfo(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) int *count = talloc_zero(mem_ctx, int); BOOL ret = True; - io1.in.dest_host = lp_parm_string(NULL, "torture", "host"); + io1.in.dest_host = lp_parm_string(global_loadparm, NULL, "torture", "host"); io1.in.port = 0; - io1.in.called_name = lp_parm_string(NULL, "torture", "host"); - io1.in.service = lp_parm_string(NULL, "torture", "share"); + io1.in.called_name = lp_parm_string(global_loadparm, NULL, "torture", "host"); + io1.in.service = lp_parm_string(global_loadparm, NULL, "torture", "share"); io1.in.service_type = "A:"; io1.in.credentials = cmdline_credentials; io1.in.workgroup = lp_workgroup(global_loadparm); @@ -364,7 +364,7 @@ static BOOL test_fsinfo(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) while (*count < torture_numops) { event_loop_once(event_ctx); - if (lp_parm_bool(NULL, "torture", "progress", true)) { + if (lp_parm_bool(global_loadparm, NULL, "torture", "progress", true)) { printf("(%s) count=%d\r", __location__, *count); fflush(stdout); } -- cgit From 2151cde58014ea2e822c13d2f8a369b45dc19ca8 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 6 Oct 2007 22:28:14 +0000 Subject: r25554: Convert last instances of BOOL, True and False to the standard types. (This used to be commit 566aa14139510788548a874e9213d91317f83ca9) --- source4/torture/raw/composite.c | 48 ++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index d713ff321e..c6969574a8 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -43,7 +43,7 @@ static void loadfile_complete(struct composite_context *c) /* test a simple savefile/loadfile combination */ -static BOOL test_loadfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) +static bool test_loadfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { const char *fname = BASEDIR "\\test.txt"; NTSTATUS status; @@ -69,7 +69,7 @@ static BOOL test_loadfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) status = smb_composite_savefile(cli->tree, &io1); if (!NT_STATUS_IS_OK(status)) { printf("(%s) savefile failed: %s\n", __location__,nt_errstr(status)); - return False; + return false; } io2.in.fname = fname; @@ -98,30 +98,30 @@ static BOOL test_loadfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) status = smb_composite_loadfile_recv(c[i], mem_ctx); if (!NT_STATUS_IS_OK(status)) { printf("(%s) loadfile[%d] failed - %s\n", __location__, i, nt_errstr(status)); - return False; + return false; } if (io2.out.size != len) { printf("(%s) wrong length in returned data - %d should be %d\n",__location__, io2.out.size, (int)len); - return False; + return false; } if (memcmp(io2.out.data, data, len) != 0) { printf("(%s) wrong data in loadfile!\n",__location__); - return False; + return false; } } talloc_free(data); - return True; + return true; } /* test a simple savefile/loadfile combination */ -static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) +static bool test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { const char *fname = BASEDIR "\\test.txt"; NTSTATUS status; @@ -134,7 +134,7 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) extern int torture_numops; struct event_context *event_ctx; int *count = talloc_zero(mem_ctx, int); - BOOL ret = True; + bool ret = true; data = talloc_array(mem_ctx, uint8_t, len); @@ -149,7 +149,7 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) status = smb_composite_savefile(cli->tree, &io1); if (!NT_STATUS_IS_OK(status)) { printf("(%s) savefile failed: %s\n",__location__, nt_errstr(status)); - return False; + return false; } io2.in.dest_host = lp_parm_string(global_loadparm, NULL, "torture", "host"); @@ -189,7 +189,7 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) if (!NT_STATUS_IS_OK(status)) { printf("(%s) loadfile[%d] failed - %s\n", __location__, i, nt_errstr(status)); - ret = False; + ret = false; continue; } @@ -197,13 +197,13 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) printf("(%s) wrong length in returned data - %d " "should be %d\n", __location__, io2.out.size, (int)len); - ret = False; + ret = false; continue; } if (memcmp(io2.out.data, data, len) != 0) { printf("(%s) wrong data in loadfile!\n", __location__); - ret = False; + ret = false; continue; } } @@ -214,7 +214,7 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) /* test setfileacl */ -static BOOL test_appendacl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) +static bool test_appendacl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { struct smb_composite_appendacl **io; struct smb_composite_appendacl **io_orig; @@ -244,7 +244,7 @@ static BOOL test_appendacl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) status = smb_composite_savefile(cli->tree, &io1); if (!NT_STATUS_IS_OK(status)) { printf("(%s) savefile failed: %s\n", __location__, nt_errstr(status)); - return False; + return false; } io_orig[i] = talloc (io_orig, struct smb_composite_appendacl); @@ -253,7 +253,7 @@ static BOOL test_appendacl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) status = smb_composite_appendacl(cli->tree, io_orig[i], io_orig[i]); if (!NT_STATUS_IS_OK(status)) { printf("(%s) appendacl failed: %s\n", __location__, nt_errstr(status)); - return False; + return false; } } @@ -273,7 +273,7 @@ static BOOL test_appendacl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) status = security_descriptor_dacl_add(test_sd, ace); if (!NT_STATUS_IS_OK(status)) { printf("(%s) appendacl failed: %s\n", __location__, nt_errstr(status)); - return False; + return false; } /* set parameters for appendacl async call */ @@ -308,13 +308,13 @@ static BOOL test_appendacl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) status = smb_composite_appendacl_recv(c[i], io[i]); if (!NT_STATUS_IS_OK(status)) { printf("(%s) appendacl[%d] failed - %s\n", __location__, i, nt_errstr(status)); - return False; + return false; } security_descriptor_dacl_add(io_orig[i]->out.sd, ace); if (!security_acl_equal(io_orig[i]->out.sd->dacl, io[i]->out.sd->dacl)) { printf("(%s) appendacl[%d] failed - needed acl isn't set\n", __location__, i); - return False; + return false; } } @@ -323,11 +323,11 @@ static BOOL test_appendacl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) talloc_free (test_sid); talloc_free (test_sd); - return True; + return true; } /* test a query FS info by asking for share's GUID */ -static BOOL test_fsinfo(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) +static bool test_fsinfo(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { char *guid = NULL; NTSTATUS status; @@ -338,7 +338,7 @@ static BOOL test_fsinfo(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) extern int torture_numops; struct event_context *event_ctx; int *count = talloc_zero(mem_ctx, int); - BOOL ret = True; + bool ret = true; io1.in.dest_host = lp_parm_string(global_loadparm, NULL, "torture", "host"); io1.in.port = 0; @@ -375,7 +375,7 @@ static BOOL test_fsinfo(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) status = smb_composite_fsinfo_recv(c[i], mem_ctx); if (!NT_STATUS_IS_OK(status)) { printf("(%s) fsinfo[%d] failed - %s\n", __location__, i, nt_errstr(status)); - ret = False; + ret = false; continue; } @@ -383,7 +383,7 @@ static BOOL test_fsinfo(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) printf("(%s) wrong level in returned info - %d " "should be %d\n", __location__, io1.out.fsinfo->generic.level, RAW_QFS_OBJECTID_INFORMATION); - ret = False; + ret = false; continue; } @@ -406,7 +406,7 @@ bool torture_raw_composite(struct torture_context *tctx, bool ret = true; if (!torture_setup_dir(cli, BASEDIR)) { - return False; + return false; } ret &= test_fetchfile(cli, tctx); -- cgit From bbdfbf8d9d486aee51117976b8f825759a4c4a37 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 3 Dec 2007 00:28:22 +0100 Subject: r26238: Add a loadparm context parameter to torture_context, remove more uses of global_loadparm. (This used to be commit a33a5530545086b81a3b205aa109dff11c546926) --- source4/torture/raw/composite.c | 74 ++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 37 deletions(-) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index c6969574a8..5a663fb565 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -43,7 +43,7 @@ static void loadfile_complete(struct composite_context *c) /* test a simple savefile/loadfile combination */ -static bool test_loadfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) +static bool test_loadfile(struct smbcli_state *cli, struct torture_context *tctx) { const char *fname = BASEDIR "\\test.txt"; NTSTATUS status; @@ -54,9 +54,9 @@ static bool test_loadfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) size_t len = random() % 100000; const int num_ops = 50; int i; - int *count = talloc_zero(mem_ctx, int); + int *count = talloc_zero(tctx, int); - data = talloc_array(mem_ctx, uint8_t, len); + data = talloc_array(tctx, uint8_t, len); generate_random_buffer(data, len); @@ -76,7 +76,7 @@ static bool test_loadfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) printf("testing parallel loadfile with %d ops\n", num_ops); - c = talloc_array(mem_ctx, struct composite_context *, num_ops); + c = talloc_array(tctx, struct composite_context *, num_ops); for (i=0;itree, &io2); @@ -87,7 +87,7 @@ static bool test_loadfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) printf("waiting for completion\n"); while (*count != num_ops) { event_loop_once(cli->transport->socket->event.ctx); - if (lp_parm_bool(global_loadparm, NULL, "torture", "progress", true)) { + if (torture_setting_bool(tctx, "progress", true)) { printf("(%s) count=%d\r", __location__, *count); fflush(stdout); } @@ -95,7 +95,7 @@ static bool test_loadfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) printf("count=%d\n", *count); for (i=0;ilp_ctx); io2.in.filename = fname; printf("testing parallel fetchfile with %d ops\n", torture_numops); event_ctx = cli->transport->socket->event.ctx; - c = talloc_array(mem_ctx, struct composite_context *, torture_numops); + c = talloc_array(tctx, struct composite_context *, torture_numops); for (i=0; itype = SEC_ACE_TYPE_ACCESS_ALLOWED; ace->flags = 0; @@ -280,8 +280,8 @@ static bool test_appendacl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) printf("testing parallel appendacl with %d ops\n", num_ops); - c = talloc_array(mem_ctx, struct composite_context *, num_ops); - io = talloc_array(mem_ctx, struct smb_composite_appendacl *, num_ops); + c = talloc_array(tctx, struct composite_context *, num_ops); + io = talloc_array(tctx, struct smb_composite_appendacl *, num_ops); for (i=0; i < num_ops; i++) { io[i] = talloc (io, struct smb_composite_appendacl); @@ -293,11 +293,11 @@ static bool test_appendacl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) c[i]->async.private_data = count; } - event_ctx = talloc_reference(mem_ctx, cli->tree->session->transport->socket->event.ctx); + event_ctx = talloc_reference(tctx, cli->tree->session->transport->socket->event.ctx); printf("waiting for completion\n"); while (*count != num_ops) { event_loop_once(event_ctx); - if (lp_parm_bool(global_loadparm, NULL, "torture", "progress", true)) { + if (torture_setting_bool(tctx, "progress", true)) { printf("(%s) count=%d\r", __location__, *count); fflush(stdout); } @@ -327,7 +327,7 @@ static bool test_appendacl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) } /* test a query FS info by asking for share's GUID */ -static bool test_fsinfo(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) +static bool test_fsinfo(struct smbcli_state *cli, struct torture_context *tctx) { char *guid = NULL; NTSTATUS status; @@ -337,22 +337,22 @@ static bool test_fsinfo(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) int i; extern int torture_numops; struct event_context *event_ctx; - int *count = talloc_zero(mem_ctx, int); + int *count = talloc_zero(tctx, int); bool ret = true; - io1.in.dest_host = lp_parm_string(global_loadparm, NULL, "torture", "host"); + io1.in.dest_host = torture_setting_string(tctx, "host", NULL); io1.in.port = 0; - io1.in.called_name = lp_parm_string(global_loadparm, NULL, "torture", "host"); - io1.in.service = lp_parm_string(global_loadparm, NULL, "torture", "share"); + io1.in.called_name = torture_setting_string(tctx, "host", NULL); + io1.in.service = torture_setting_string(tctx, "share", NULL); io1.in.service_type = "A:"; io1.in.credentials = cmdline_credentials; - io1.in.workgroup = lp_workgroup(global_loadparm); + io1.in.workgroup = lp_workgroup(tctx->lp_ctx); io1.in.level = RAW_QFS_OBJECTID_INFORMATION; printf("testing parallel queryfsinfo [Object ID] with %d ops\n", torture_numops); - event_ctx = talloc_reference(mem_ctx, cli->tree->session->transport->socket->event.ctx); - c = talloc_array(mem_ctx, struct composite_context *, torture_numops); + event_ctx = talloc_reference(tctx, cli->tree->session->transport->socket->event.ctx); + c = talloc_array(tctx, struct composite_context *, torture_numops); for (i=0; itree,&io1); @@ -364,7 +364,7 @@ static bool test_fsinfo(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) while (*count < torture_numops) { event_loop_once(event_ctx); - if (lp_parm_bool(global_loadparm, NULL, "torture", "progress", true)) { + if (torture_setting_bool(tctx, "progress", true)) { printf("(%s) count=%d\r", __location__, *count); fflush(stdout); } @@ -372,7 +372,7 @@ static bool test_fsinfo(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) printf("count=%d\n", *count); for (i=0;iobjectid_information.out.guid); + guid=GUID_string(tctx, &io1.out.fsinfo->objectid_information.out.guid); printf("[%d] GUID: %s\n", i, guid); -- cgit From 4b0199a5493ea2b88558cc40871e63c1dc8dbb56 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 12 Dec 2007 02:15:29 +0100 Subject: r26409: Pass smb ports along. (This used to be commit 2833f320de1f1fd39c710ad0a61c3fa1bb1df31f) --- source4/torture/raw/composite.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index 5a663fb565..0367110ddc 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -153,7 +153,7 @@ static bool test_fetchfile(struct smbcli_state *cli, struct torture_context *tct } io2.in.dest_host = torture_setting_string(tctx, "host", NULL); - io2.in.port = 0; + io2.in.ports = lp_smb_ports(tctx->lp_ctx); io2.in.called_name = torture_setting_string(tctx, "host", NULL); io2.in.service = torture_setting_string(tctx, "share", NULL); io2.in.service_type = "A:"; @@ -341,7 +341,7 @@ static bool test_fsinfo(struct smbcli_state *cli, struct torture_context *tctx) bool ret = true; io1.in.dest_host = torture_setting_string(tctx, "host", NULL); - io1.in.port = 0; + io1.in.dest_ports = lp_smb_ports(tctx->lp_ctx); io1.in.called_name = torture_setting_string(tctx, "host", NULL); io1.in.service = torture_setting_string(tctx, "share", NULL); io1.in.service_type = "A:"; -- cgit From 921b17648456027b6b46a582aa1d13024a5e9a90 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 21 Feb 2008 14:50:57 +0100 Subject: Remove more uses of global_loadparm. (This used to be commit 47d05ecf6fef66c90994f666b8c63e2e7b5a6cd8) --- source4/torture/raw/composite.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index 0367110ddc..7238a2fd46 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -161,6 +161,7 @@ static bool test_fetchfile(struct smbcli_state *cli, struct torture_context *tct io2.in.credentials = cmdline_credentials; io2.in.workgroup = lp_workgroup(tctx->lp_ctx); io2.in.filename = fname; + lp_smbcli_options(tctx->lp_ctx, &io2.in.options); printf("testing parallel fetchfile with %d ops\n", torture_numops); -- cgit From 2946a11dc7d367128d8c002966ac19e3e36450dd Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 28 Feb 2008 20:30:03 +0100 Subject: Remove use of global_loadparm. (This used to be commit 4472d7e1e47d4fe6b1c60e28d168cce99b237979) --- source4/torture/raw/composite.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index 7238a2fd46..1f31fbc515 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -31,6 +31,7 @@ #include "lib/cmdline/popt_common.h" #include "torture/util.h" #include "param/param.h" +#include "libcli/resolve/resolve.h" #define BASEDIR "\\composite" @@ -161,6 +162,7 @@ static bool test_fetchfile(struct smbcli_state *cli, struct torture_context *tct io2.in.credentials = cmdline_credentials; io2.in.workgroup = lp_workgroup(tctx->lp_ctx); io2.in.filename = fname; + io2.in.resolve_ctx = lp_resolve_context(tctx->lp_ctx); lp_smbcli_options(tctx->lp_ctx, &io2.in.options); printf("testing parallel fetchfile with %d ops\n", torture_numops); -- cgit From 4e83011f72ba3df387512755a17760b42a7bf2f2 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 21 Apr 2008 17:58:23 -0400 Subject: Remove more event_context_init() uses from function calls within deep down the code. Make sure we pass around the event_context where we need it instead. All test but a few python ones fail. Jelmer promised to fix them. (This used to be commit 3045d391626fba169aa26be52174883e18d323e9) --- source4/torture/raw/composite.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index 1f31fbc515..d73ac1327e 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -296,7 +296,7 @@ static bool test_appendacl(struct smbcli_state *cli, struct torture_context *tct c[i]->async.private_data = count; } - event_ctx = talloc_reference(tctx, cli->tree->session->transport->socket->event.ctx); + event_ctx = tctx->ev; printf("waiting for completion\n"); while (*count != num_ops) { event_loop_once(event_ctx); @@ -354,7 +354,7 @@ static bool test_fsinfo(struct smbcli_state *cli, struct torture_context *tctx) printf("testing parallel queryfsinfo [Object ID] with %d ops\n", torture_numops); - event_ctx = talloc_reference(tctx, cli->tree->session->transport->socket->event.ctx); + event_ctx = tctx->ev; c = talloc_array(tctx, struct composite_context *, torture_numops); for (i=0; i