From 4815480bb6ed44081076bac5471267609f7668cf Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 9 Nov 2004 09:26:47 +0000 Subject: r3633: - moved module init functions to after smb.conf and command line parsing, so that module init can take account of lp_ parms (thats why gensec:krb5=no wasn't working) - added a BASE-DISCONNECT torture test that tests server response to clients disconnecting with open lock and open requests pending (This used to be commit 5205f598b8c0be6985e61cc842cc5da109ba5b7e) --- source4/torture/basic/disconnect.c | 163 +++++++++++++++++++++++++++++++++++++ 1 file changed, 163 insertions(+) create mode 100644 source4/torture/basic/disconnect.c (limited to 'source4/torture/basic/disconnect.c') diff --git a/source4/torture/basic/disconnect.c b/source4/torture/basic/disconnect.c new file mode 100644 index 0000000000..b5f6eb5311 --- /dev/null +++ b/source4/torture/basic/disconnect.c @@ -0,0 +1,163 @@ +/* + Unix SMB/CIFS implementation. + + test server handling of unexpected client disconnects + + Copyright (C) Andrew Tridgell 2004 + + 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" + +#define BASEDIR "\\test_disconnect" + +#define CHECK_STATUS(status, correct) do { \ + if (!NT_STATUS_EQUAL(status, correct)) { \ + printf("(%s) Incorrect status %s - should be %s\n", \ + __location__, nt_errstr(status), nt_errstr(correct)); \ + talloc_free(cli); \ + return False; \ + }} while (0) + +/* + test disconnect after async open +*/ +static BOOL test_disconnect_open(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) +{ + union smb_open io; + NTSTATUS status; + struct smbcli_request *req1, *req2; + + printf("trying open/disconnect\n"); + + io.generic.level = RAW_OPEN_NTCREATEX; + io.ntcreatex.in.root_fid = 0; + io.ntcreatex.in.flags = 0; + io.ntcreatex.in.access_mask = SA_RIGHT_FILE_READ_DATA; + io.ntcreatex.in.create_options = 0; + io.ntcreatex.in.file_attr = FILE_ATTRIBUTE_NORMAL; + io.ntcreatex.in.share_access = NTCREATEX_SHARE_ACCESS_READ; + io.ntcreatex.in.alloc_size = 0; + io.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN_IF; + io.ntcreatex.in.impersonation = NTCREATEX_IMPERSONATION_ANONYMOUS; + io.ntcreatex.in.security_flags = 0; + io.ntcreatex.in.fname = BASEDIR "\\open.dat"; + status = smb_raw_open(cli->tree, mem_ctx, &io); + CHECK_STATUS(status, NT_STATUS_OK); + + req1 = smb_raw_open_send(cli->tree, &io); + req2 = smb_raw_open_send(cli->tree, &io); + + talloc_free(cli); + + return True; +} + + +/* + test disconnect with timed lock +*/ +static BOOL test_disconnect_lock(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) +{ + union smb_lock io; + NTSTATUS status; + int fnum; + struct smbcli_request *req; + struct smb_lock_entry lock[1]; + + printf("trying disconnect with async lock\n"); + + fnum = smbcli_open(cli->tree, BASEDIR "\\write.dat", + O_RDWR | O_CREAT, DENY_NONE); + if (fnum == -1) { + printf("open failed in mux_write - %s\n", smbcli_errstr(cli->tree)); + return False; + } + + io.lockx.level = RAW_LOCK_LOCKX; + io.lockx.in.fnum = fnum; + io.lockx.in.mode = 0; + io.lockx.in.timeout = 0; + io.lockx.in.lock_cnt = 1; + io.lockx.in.ulock_cnt = 0; + lock[0].pid = 1; + lock[0].offset = 0; + lock[0].count = 4; + io.lockx.in.locks = &lock[0]; + + status = smb_raw_lock(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OK); + + lock[0].pid = 2; + io.lockx.in.timeout = 3000; + req = smb_raw_lock_send(cli->tree, &io); + + talloc_free(cli); + + return True; +} + + + +/* + basic testing of disconnects +*/ +BOOL torture_disconnect(void) +{ + struct smbcli_state *cli; + BOOL ret = True; + TALLOC_CTX *mem_ctx; + int i; + + mem_ctx = talloc_init("torture_raw_mux"); + + if (!torture_open_connection(&cli)) { + return False; + } + + /* cleanup */ + if (smbcli_deltree(cli->tree, BASEDIR) == -1) { + printf("(%s) Failed to cleanup " BASEDIR "\n", __location__); + ret = False; + goto done; + } + + if (NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR))) { + printf("Failed to create %s\n", BASEDIR); + ret = False; + goto done; + } + + for (i=0;i<100;i++) { + ret &= test_disconnect_lock(cli, mem_ctx); + if (!torture_open_connection(&cli)) { + return False; + } + + ret &= test_disconnect_open(cli, mem_ctx); + if (!torture_open_connection(&cli)) { + return False; + } + } + +done: + smb_raw_exit(cli->session); + smbcli_deltree(cli->tree, BASEDIR); + torture_close_connection(cli); + talloc_destroy(mem_ctx); + return ret; +} -- cgit From 77ff35de861388d80146505bc07682c7da11adfe Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 9 Nov 2004 09:35:45 +0000 Subject: r3634: - fixed BASE-DISCONNECT test to force the async packets to be sent by waiting for a chkpath response - fixed open async send in BASE-DISCONNECT with these changes BASE-DISCONNECT crashes Samba4, as it was designed to do. I'll work on a fix :) (This used to be commit 25e01384647116d8ea0f20a6988fb8fe63218840) --- source4/torture/basic/disconnect.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source4/torture/basic/disconnect.c') diff --git a/source4/torture/basic/disconnect.c b/source4/torture/basic/disconnect.c index b5f6eb5311..683cdb81c8 100644 --- a/source4/torture/basic/disconnect.c +++ b/source4/torture/basic/disconnect.c @@ -59,8 +59,12 @@ static BOOL test_disconnect_open(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) status = smb_raw_open(cli->tree, mem_ctx, &io); CHECK_STATUS(status, NT_STATUS_OK); + io.ntcreatex.in.share_access = 0; req1 = smb_raw_open_send(cli->tree, &io); req2 = smb_raw_open_send(cli->tree, &io); + + status = smbcli_chkpath(cli->tree, "\\"); + CHECK_STATUS(status, NT_STATUS_OK); talloc_free(cli); @@ -106,6 +110,9 @@ static BOOL test_disconnect_lock(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) io.lockx.in.timeout = 3000; req = smb_raw_lock_send(cli->tree, &io); + status = smbcli_chkpath(cli->tree, "\\"); + CHECK_STATUS(status, NT_STATUS_OK); + talloc_free(cli); return True; -- cgit From 0e255bb542b1f79c32e9295617199ea8d60753d4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 12 Nov 2004 09:37:59 +0000 Subject: r3699: - split the delayed write testing out of RAW-WRITE, as it is not yet clear what the correct behaviour is for delayed stat info update. - use a common torture_setup_dir() function for setting up a test directory in torture tests. (This used to be commit f7fb34715b7d6ea3c35ddd684cfb27459a420339) --- source4/torture/basic/disconnect.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'source4/torture/basic/disconnect.c') diff --git a/source4/torture/basic/disconnect.c b/source4/torture/basic/disconnect.c index 683cdb81c8..a225178b96 100644 --- a/source4/torture/basic/disconnect.c +++ b/source4/torture/basic/disconnect.c @@ -136,17 +136,8 @@ BOOL torture_disconnect(void) return False; } - /* cleanup */ - if (smbcli_deltree(cli->tree, BASEDIR) == -1) { - printf("(%s) Failed to cleanup " BASEDIR "\n", __location__); - ret = False; - goto done; - } - - if (NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR))) { - printf("Failed to create %s\n", BASEDIR); - ret = False; - goto done; + if (!torture_setup_dir(cli, BASEDIR)) { + return False; } for (i=0;i<100;i++) { @@ -161,7 +152,6 @@ BOOL torture_disconnect(void) } } -done: smb_raw_exit(cli->session); smbcli_deltree(cli->tree, BASEDIR); torture_close_connection(cli); -- cgit From fdc9f417d89fdf9dd6afbc22843d70585e195c9d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 30 Nov 2004 04:33:27 +0000 Subject: r4011: get rid of rpc_secdes.h and replace it with a single sane set of definitions for security access masks, in security.idl The previous definitions were inconsistently named, and contained many duplicate and misleading entries. I kept finding myself tripping up while using them. (This used to be commit 01c0fa722f80ceeb3f81f01987de95f365a2ed3d) --- source4/torture/basic/disconnect.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source4/torture/basic/disconnect.c') diff --git a/source4/torture/basic/disconnect.c b/source4/torture/basic/disconnect.c index a225178b96..898fc41b4e 100644 --- a/source4/torture/basic/disconnect.c +++ b/source4/torture/basic/disconnect.c @@ -22,6 +22,7 @@ #include "includes.h" #include "libcli/raw/libcliraw.h" +#include "librpc/gen_ndr/ndr_security.h" #define BASEDIR "\\test_disconnect" @@ -47,7 +48,7 @@ static BOOL test_disconnect_open(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) io.generic.level = RAW_OPEN_NTCREATEX; io.ntcreatex.in.root_fid = 0; io.ntcreatex.in.flags = 0; - io.ntcreatex.in.access_mask = SA_RIGHT_FILE_READ_DATA; + io.ntcreatex.in.access_mask = SEC_FILE_READ_DATA; io.ntcreatex.in.create_options = 0; io.ntcreatex.in.file_attr = FILE_ATTRIBUTE_NORMAL; io.ntcreatex.in.share_access = NTCREATEX_SHARE_ACCESS_READ; -- cgit From 759da3b915e2006d4c87b5ace47f399accd9ce91 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell 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/basic/disconnect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/basic/disconnect.c') diff --git a/source4/torture/basic/disconnect.c b/source4/torture/basic/disconnect.c index 898fc41b4e..2a302ae3f6 100644 --- a/source4/torture/basic/disconnect.c +++ b/source4/torture/basic/disconnect.c @@ -156,6 +156,6 @@ BOOL torture_disconnect(void) smb_raw_exit(cli->session); smbcli_deltree(cli->tree, BASEDIR); torture_close_connection(cli); - talloc_destroy(mem_ctx); + talloc_free(mem_ctx); return ret; } -- cgit From e82aad1ce39a6b7a2e51b9e2cb494d74ec70e158 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 10 Feb 2005 05:09:35 +0000 Subject: r5298: - got rid of pstring.h from includes.h. This at least makes it a bit less likely that anyone will use pstring for new code - got rid of winbind_client.h from includes.h. This one triggered a huge change, as winbind_client.h was including system/filesys.h and defining the old uint32 and uint16 types, as well as its own pstring and fstring. (This used to be commit 9db6c79e902ec538108d6b7d3324039aabe1704f) --- source4/torture/basic/disconnect.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/torture/basic/disconnect.c') diff --git a/source4/torture/basic/disconnect.c b/source4/torture/basic/disconnect.c index 2a302ae3f6..fab9733eb0 100644 --- a/source4/torture/basic/disconnect.c +++ b/source4/torture/basic/disconnect.c @@ -21,6 +21,7 @@ */ #include "includes.h" +#include "system/filesys.h" #include "libcli/raw/libcliraw.h" #include "librpc/gen_ndr/ndr_security.h" -- cgit From 0f7f08565ce307c7bd8dbbb748ae445e894576a1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 26 Jul 2005 12:40:26 +0000 Subject: r8780: make numops controllable in BASE-DISCONNECT (This used to be commit 1cb91a11d46b49ae296abae9c8304e267e922df4) --- source4/torture/basic/disconnect.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source4/torture/basic/disconnect.c') diff --git a/source4/torture/basic/disconnect.c b/source4/torture/basic/disconnect.c index fab9733eb0..423135008e 100644 --- a/source4/torture/basic/disconnect.c +++ b/source4/torture/basic/disconnect.c @@ -131,6 +131,7 @@ BOOL torture_disconnect(void) BOOL ret = True; TALLOC_CTX *mem_ctx; int i; + extern int torture_numops; mem_ctx = talloc_init("torture_raw_mux"); @@ -142,7 +143,7 @@ BOOL torture_disconnect(void) return False; } - for (i=0;i<100;i++) { + for (i=0;i Date: Fri, 30 Dec 2005 13:16:54 +0000 Subject: r12608: Remove some unused #include lines. (This used to be commit 70e7449318aa0e9d2639c76730a7d1683b2f4981) --- source4/torture/basic/disconnect.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source4/torture/basic/disconnect.c') diff --git a/source4/torture/basic/disconnect.c b/source4/torture/basic/disconnect.c index 423135008e..b585b40bc4 100644 --- a/source4/torture/basic/disconnect.c +++ b/source4/torture/basic/disconnect.c @@ -23,7 +23,6 @@ #include "includes.h" #include "system/filesys.h" #include "libcli/raw/libcliraw.h" -#include "librpc/gen_ndr/ndr_security.h" #define BASEDIR "\\test_disconnect" -- 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/basic/disconnect.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/torture/basic/disconnect.c') diff --git a/source4/torture/basic/disconnect.c b/source4/torture/basic/disconnect.c index b585b40bc4..fca5d1968a 100644 --- a/source4/torture/basic/disconnect.c +++ b/source4/torture/basic/disconnect.c @@ -21,6 +21,7 @@ */ #include "includes.h" +#include "torture/torture.h" #include "system/filesys.h" #include "libcli/raw/libcliraw.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/basic/disconnect.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/torture/basic/disconnect.c') diff --git a/source4/torture/basic/disconnect.c b/source4/torture/basic/disconnect.c index fca5d1968a..61b1750b92 100644 --- a/source4/torture/basic/disconnect.c +++ b/source4/torture/basic/disconnect.c @@ -24,6 +24,7 @@ #include "torture/torture.h" #include "system/filesys.h" #include "libcli/raw/libcliraw.h" +#include "libcli/libcli.h" #define BASEDIR "\\test_disconnect" -- cgit From 307e43bb5628e8b53a930c2928279af994281ba5 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 10 Mar 2006 20:49:20 +0000 Subject: r14173: change smb interface structures to always use a union smb_file, to abtract - const char *path fot qpathinfo and setpathinfo - uint16_t fnum for SMB - smb2_handle handle for SMB2 the idea is to later add a struct ntvfs_handle *ntvfs so that the ntvfs subsystem don't need to know the difference between SMB and SMB2 metze (This used to be commit 2ef3f5970901b5accdb50f0d0115b5d46b0c788f) --- source4/torture/basic/disconnect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/basic/disconnect.c') diff --git a/source4/torture/basic/disconnect.c b/source4/torture/basic/disconnect.c index 61b1750b92..8ad11ccb6c 100644 --- a/source4/torture/basic/disconnect.c +++ b/source4/torture/basic/disconnect.c @@ -96,7 +96,7 @@ static BOOL test_disconnect_lock(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) } io.lockx.level = RAW_LOCK_LOCKX; - io.lockx.in.fnum = fnum; + io.lockx.file.fnum = fnum; io.lockx.in.mode = 0; io.lockx.in.timeout = 0; io.lockx.in.lock_cnt = 1; -- cgit From a1b295ed4823ce8d06f830b8db9a5d965c934b54 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 12 Mar 2006 22:48:25 +0000 Subject: r14256: - rename smb_file -> smb_handle - move it into the in/out substructs again - allow file.path only on smb_fileinfo/smb_setfileinfo metze (This used to be commit be6d5298a2cdb7e7c61d70471bad445645af5963) --- source4/torture/basic/disconnect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/basic/disconnect.c') diff --git a/source4/torture/basic/disconnect.c b/source4/torture/basic/disconnect.c index 8ad11ccb6c..bc892120e3 100644 --- a/source4/torture/basic/disconnect.c +++ b/source4/torture/basic/disconnect.c @@ -96,7 +96,7 @@ static BOOL test_disconnect_lock(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) } io.lockx.level = RAW_LOCK_LOCKX; - io.lockx.file.fnum = fnum; + io.lockx.in.file.fnum = fnum; io.lockx.in.mode = 0; io.lockx.in.timeout = 0; io.lockx.in.lock_cnt = 1; -- 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/basic/disconnect.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/torture/basic/disconnect.c') diff --git a/source4/torture/basic/disconnect.c b/source4/torture/basic/disconnect.c index bc892120e3..d21807aa83 100644 --- a/source4/torture/basic/disconnect.c +++ b/source4/torture/basic/disconnect.c @@ -25,6 +25,7 @@ #include "system/filesys.h" #include "libcli/raw/libcliraw.h" #include "libcli/libcli.h" +#include "torture/util.h" #define BASEDIR "\\test_disconnect" -- 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/basic/disconnect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/basic/disconnect.c') diff --git a/source4/torture/basic/disconnect.c b/source4/torture/basic/disconnect.c index d21807aa83..7284f3c959 100644 --- a/source4/torture/basic/disconnect.c +++ b/source4/torture/basic/disconnect.c @@ -127,7 +127,7 @@ static BOOL test_disconnect_lock(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) /* basic testing of disconnects */ -BOOL torture_disconnect(void) +BOOL torture_disconnect(struct torture_context *torture) { struct smbcli_state *cli; BOOL ret = True; -- 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/basic/disconnect.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source4/torture/basic/disconnect.c') diff --git a/source4/torture/basic/disconnect.c b/source4/torture/basic/disconnect.c index 7284f3c959..4712dfdda9 100644 --- a/source4/torture/basic/disconnect.c +++ b/source4/torture/basic/disconnect.c @@ -137,7 +137,7 @@ BOOL torture_disconnect(struct torture_context *torture) mem_ctx = talloc_init("torture_raw_mux"); - if (!torture_open_connection(&cli)) { + if (!torture_open_connection(&cli, 0)) { return False; } @@ -147,12 +147,12 @@ BOOL torture_disconnect(struct torture_context *torture) for (i=0;i Date: Sat, 5 Aug 2006 08:21:31 +0000 Subject: r17417: Try to fix random failures in the build farm for 3_0. Volker (This used to be commit 5cffd35fecb85e3c1407f6e6d91e846b17a7c917) --- source4/torture/basic/disconnect.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source4/torture/basic/disconnect.c') diff --git a/source4/torture/basic/disconnect.c b/source4/torture/basic/disconnect.c index 4712dfdda9..92cb828606 100644 --- a/source4/torture/basic/disconnect.c +++ b/source4/torture/basic/disconnect.c @@ -155,6 +155,16 @@ BOOL torture_disconnect(struct torture_context *torture) if (!torture_open_connection(&cli, 0)) { return False; } + + if (lp_parm_bool(-1, "target", "samba3", False)) { + /* + * In Samba3 it might happen that the old smbd from + * test_disconnect_lock is not scheduled before the + * new process comes in. Try to get rid of the random + * failures in the build farm. + */ + msleep(200); + } } smb_raw_exit(cli->session); -- cgit From 8773e743c518578584d07d35ffdafdd598af88b0 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 16 Oct 2006 13:06:41 +0000 Subject: r19339: Merge my 4.0-unittest branch. This adds an API for more fine-grained output in the testsuite rather than just True or False for a set of tests. The aim is to use this for: * known failure lists (run all tests and detect tests that started working or started failing). This would allow us to get rid of the RPC-SAMBA3-* tests * nicer torture output * simplification of the testsuite system * compatibility with other unit testing systems * easier usage of smbtorture (being able to run one test and automatically set up the environment for that) This is still a work-in-progress; expect more updates over the next couple of days. (This used to be commit 0eb6097305776325c75081356309115f445a7218) --- source4/torture/basic/disconnect.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source4/torture/basic/disconnect.c') diff --git a/source4/torture/basic/disconnect.c b/source4/torture/basic/disconnect.c index 92cb828606..348f59d057 100644 --- a/source4/torture/basic/disconnect.c +++ b/source4/torture/basic/disconnect.c @@ -129,11 +129,11 @@ static BOOL test_disconnect_lock(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) */ BOOL torture_disconnect(struct torture_context *torture) { - struct smbcli_state *cli; BOOL ret = True; TALLOC_CTX *mem_ctx; int i; extern int torture_numops; + struct smbcli_state *cli; mem_ctx = talloc_init("torture_raw_mux"); @@ -169,7 +169,6 @@ BOOL torture_disconnect(struct torture_context *torture) smb_raw_exit(cli->session); smbcli_deltree(cli->tree, BASEDIR); - torture_close_connection(cli); talloc_free(mem_ctx); return ret; } -- cgit From a39f239cb28e4ac6be207d4179bacffce97f1b3e Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 18 Oct 2006 14:23:19 +0000 Subject: r19392: Use torture_setting_* rather than lp_parm_* where possible. (This used to be commit b28860978fe29c5b10abfb8c59d7182864e21dd6) --- source4/torture/basic/disconnect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/basic/disconnect.c') diff --git a/source4/torture/basic/disconnect.c b/source4/torture/basic/disconnect.c index 348f59d057..5bc7d997ed 100644 --- a/source4/torture/basic/disconnect.c +++ b/source4/torture/basic/disconnect.c @@ -156,7 +156,7 @@ BOOL torture_disconnect(struct torture_context *torture) return False; } - if (lp_parm_bool(-1, "target", "samba3", False)) { + if (torture_setting_bool(torture, "samba3", False)) { /* * In Samba3 it might happen that the old smbd from * test_disconnect_lock is not scheduled before the -- cgit From 0479a2f1cbae51fcd8dbdc3c148c808421fb4d25 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell 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/basic/disconnect.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/torture/basic/disconnect.c') diff --git a/source4/torture/basic/disconnect.c b/source4/torture/basic/disconnect.c index 5bc7d997ed..e05e3ef082 100644 --- a/source4/torture/basic/disconnect.c +++ b/source4/torture/basic/disconnect.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 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/basic/disconnect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/basic/disconnect.c') diff --git a/source4/torture/basic/disconnect.c b/source4/torture/basic/disconnect.c index e05e3ef082..1dab4b0cae 100644 --- a/source4/torture/basic/disconnect.c +++ b/source4/torture/basic/disconnect.c @@ -126,7 +126,7 @@ static BOOL test_disconnect_lock(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) /* basic testing of disconnects */ -BOOL torture_disconnect(struct torture_context *torture) +bool torture_disconnect(struct torture_context *torture) { BOOL ret = True; TALLOC_CTX *mem_ctx; -- 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/basic/disconnect.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'source4/torture/basic/disconnect.c') diff --git a/source4/torture/basic/disconnect.c b/source4/torture/basic/disconnect.c index 1dab4b0cae..cb77bfe984 100644 --- a/source4/torture/basic/disconnect.c +++ b/source4/torture/basic/disconnect.c @@ -33,13 +33,13 @@ printf("(%s) Incorrect status %s - should be %s\n", \ __location__, nt_errstr(status), nt_errstr(correct)); \ talloc_free(cli); \ - return False; \ + return false; \ }} while (0) /* test disconnect after async open */ -static BOOL test_disconnect_open(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) +static bool test_disconnect_open(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { union smb_open io; NTSTATUS status; @@ -71,14 +71,14 @@ static BOOL test_disconnect_open(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) talloc_free(cli); - return True; + return true; } /* test disconnect with timed lock */ -static BOOL test_disconnect_lock(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) +static bool test_disconnect_lock(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { union smb_lock io; NTSTATUS status; @@ -92,7 +92,7 @@ static BOOL test_disconnect_lock(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) O_RDWR | O_CREAT, DENY_NONE); if (fnum == -1) { printf("open failed in mux_write - %s\n", smbcli_errstr(cli->tree)); - return False; + return false; } io.lockx.level = RAW_LOCK_LOCKX; @@ -118,7 +118,7 @@ static BOOL test_disconnect_lock(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) talloc_free(cli); - return True; + return true; } @@ -128,7 +128,7 @@ static BOOL test_disconnect_lock(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) */ bool torture_disconnect(struct torture_context *torture) { - BOOL ret = True; + bool ret = true; TALLOC_CTX *mem_ctx; int i; extern int torture_numops; @@ -137,25 +137,25 @@ bool torture_disconnect(struct torture_context *torture) mem_ctx = talloc_init("torture_raw_mux"); if (!torture_open_connection(&cli, 0)) { - return False; + return false; } if (!torture_setup_dir(cli, BASEDIR)) { - return False; + return false; } for (i=0;i Date: Mon, 3 Dec 2007 15:53:07 +0100 Subject: r26249: Remove a couple more uses of global_loadparm. (This used to be commit 80a61200508a00d5b16a3e748ce92d54b9fefcd2) --- source4/torture/basic/disconnect.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source4/torture/basic/disconnect.c') diff --git a/source4/torture/basic/disconnect.c b/source4/torture/basic/disconnect.c index cb77bfe984..09f54ed6a7 100644 --- a/source4/torture/basic/disconnect.c +++ b/source4/torture/basic/disconnect.c @@ -136,7 +136,7 @@ bool torture_disconnect(struct torture_context *torture) mem_ctx = talloc_init("torture_raw_mux"); - if (!torture_open_connection(&cli, 0)) { + if (!torture_open_connection(&cli, torture, 0)) { return false; } @@ -146,12 +146,12 @@ bool torture_disconnect(struct torture_context *torture) for (i=0;i Date: Wed, 2 Apr 2008 04:53:27 +0200 Subject: Install public header files again and include required prototypes. (This used to be commit 47ffbbf67435904754469544390b67d34c958343) --- source4/torture/basic/disconnect.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/torture/basic/disconnect.c') diff --git a/source4/torture/basic/disconnect.c b/source4/torture/basic/disconnect.c index 09f54ed6a7..89e05d6839 100644 --- a/source4/torture/basic/disconnect.c +++ b/source4/torture/basic/disconnect.c @@ -23,6 +23,7 @@ #include "torture/torture.h" #include "system/filesys.h" #include "libcli/raw/libcliraw.h" +#include "libcli/raw/raw_proto.h" #include "libcli/libcli.h" #include "torture/util.h" -- cgit