RE: [SCM] Samba Shared Repository - branch master updated- release-4-0-0alpha8-349-g5334b79
Hey Metze, No one at Isilon is working on SMB2 server side implementation currently, but we are front loading a lot of test work so there will be a reasonable set of correctness tests already available when new code is written. Right now we're working on porting most of the RAW SMB tests to SMB2, including open, streams, share modes, acls, brl, and change notify. All of our testing has been against a W2K8 server, though I'll include a W2K8R2 server as well. Sorry, I made some last minute changes before pushing this patch and didn't re-run them. I'll be more careful next time. Though, several of the tests will fail against current HEAD because the features aren't implemented yet. Is it acceptable for the make test TESTS=smb2 to fail for a bit? -Steven -Original Message- From: samba-technical-boun...@lists.samba.org [mailto:samba-technical- boun...@lists.samba.org] On Behalf Of Stefan (metze) Metzmacher Sent: Wednesday, July 15, 2009 3:45 AM To: samba-techni...@lists.samba.org Cc: samba-...@samba.org Subject: Re: [SCM] Samba Shared Repository - branch master updated- release-4-0-0alpha8-349-g5334b79 Hi Steven, The branch, master has been updated via 5334b79142e32c39c56cea2e9c0d5b08e2f217ca (commit) from 4b6401ab2cce8319abe0f8176bb460d51bd4a390 (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 5334b79142e32c39c56cea2e9c0d5b08e2f217ca Author: Aravind aravind.sriniva...@isilon.com Date: Tue Jul 7 07:11:56 2009 -0700 torture/smb2: Adding SMB2 Directory enumeration torture tests. Could you please do runtime tests before you push such patches? See 8cb44830e0356804e21d9973382e0070f20b15be and f49129e59225f6ea84add8e845ffaeb03dc6c8da for the reasons. It would be also nice to run 'make test' or 'make test TESTS=smb2' in s4. metze
RE: [SCM] Samba Shared Repository - branch master updated- release-4-0-0alpha8-349-g5334b79
Sorry, I made some last minute changes before pushing this patch and didn't re-run them. I'll be more careful next time. Though, several of the tests will fail against current HEAD because the features aren't implemented yet. Is it acceptable for the make test TESTS=smb2 to fail for a bit? Not without corresponding notations in the source{3,4}/selftest/knownfail files. Thanks. I'll add references to the tests without implemented features there. -Steven
RE: [SCM] Samba Shared Repository - branch master updated- release-4-0-0alpha8-349-g5334b79
Yes, please make sure you use torture_comment() instead of printf() and all torture_assert* functions instead of just returning false in a test. Then make test reports them as failures instead of errors and it's easy to mark them as known failures. This makes sure that the server doesn't crash when the test runs against it. metze Excellent, thanks Metze. Do we have any kind of document that describes best practices for writing torture tests? If not I can start a wiki page. Thus, far I have mostly copied style from other tests, but obviously there is a mix of several different approaches added over the years. -Steven
Re: [SCM] Samba Shared Repository - branch master updated- release-4-0-0alpha8-349-g5334b79
Hi Steven, On Wed, Jul 15, 2009 at 11:10:17PM -0700, Steven Danneman wrote: Yes, please make sure you use torture_comment() instead of printf() and all torture_assert* functions instead of just returning false in a test. Then make test reports them as failures instead of errors and it's easy to mark them as known failures. This makes sure that the server doesn't crash when the test runs against it. metze Excellent, thanks Metze. Do we have any kind of document that describes best practices for writing torture tests? If not I can start a wiki page. http://wiki.samba.org/index.php/Writing_Torture_Tests. Cheers, Karolin -- Samba http://www.samba.org SerNet http://www.sernet.de sambaXP http://www.sambaxp.org pgplOeFyPBUOn.pgp Description: PGP signature
Re: [SCM] Samba Shared Repository - branch master updated- release-4-0-0alpha8-349-g5334b79
Steven Danneman schrieb: Yes, please make sure you use torture_comment() instead of printf() and all torture_assert* functions instead of just returning false in a test. Then make test reports them as failures instead of errors and it's easy to mark them as known failures. This makes sure that the server doesn't crash when the test runs against it. metze Excellent, thanks Metze. Do we have any kind of document that describes best practices for writing torture tests? If not I can start a wiki page. That would be great. Thus, far I have mostly copied style from other tests, but obviously there is a mix of several different approaches added over the years. Yes, there's a lot of old stuff there: I started to clean it up for some tests... see 4ab243bcabefdcc044c6d517bb4d0e628227d5ac. In the end I'd like to have a #define printf __donnot_use_printf__ in lib/torture/torture.h, but he have a long way to go... metze signature.asc Description: OpenPGP digital signature
Re: [SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-349-g5334b79
Hi Steven, - Log - commit 5334b79142e32c39c56cea2e9c0d5b08e2f217ca Author: Aravind aravind.sriniva...@isilon.com Date: Tue Jul 7 07:11:56 2009 -0700 torture/smb2: Adding SMB2 Directory enumeration torture tests. Is there anyone working on the server side of this? metze signature.asc Description: OpenPGP digital signature
Re: [SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-349-g5334b79
Hi Steven, The branch, master has been updated via 5334b79142e32c39c56cea2e9c0d5b08e2f217ca (commit) from 4b6401ab2cce8319abe0f8176bb460d51bd4a390 (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 5334b79142e32c39c56cea2e9c0d5b08e2f217ca Author: Aravind aravind.sriniva...@isilon.com Date: Tue Jul 7 07:11:56 2009 -0700 torture/smb2: Adding SMB2 Directory enumeration torture tests. Could you please do runtime tests before you push such patches? See 8cb44830e0356804e21d9973382e0070f20b15be and f49129e59225f6ea84add8e845ffaeb03dc6c8da for the reasons. It would be also nice to run 'make test' or 'make test TESTS=smb2' in s4. metze signature.asc Description: OpenPGP digital signature
Re: [SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-349-g5334b79
On Wed, Jul 15, 2009 at 09:03:14AM +0200, Stefan (metze) Metzmacher wrote: Hi Steven, - Log - commit 5334b79142e32c39c56cea2e9c0d5b08e2f217ca Author: Aravind aravind.sriniva...@isilon.com Date: Tue Jul 7 07:11:56 2009 -0700 torture/smb2: Adding SMB2 Directory enumeration torture tests. Is there anyone working on the server side of this? On my list of things to do. Not got to it yet :-). If someone else does it first I won't be upset :-).
RE: [SCM] Samba Shared Repository - branch master updated- release-4-0-0alpha8-349-g5334b79
On Wed, 2009-07-15 at 17:11 -0700, Steven Danneman wrote: Hey Metze, No one at Isilon is working on SMB2 server side implementation currently, but we are front loading a lot of test work so there will be a reasonable set of correctness tests already available when new code is written. Right now we're working on porting most of the RAW SMB tests to SMB2, including open, streams, share modes, acls, brl, and change notify. All of our testing has been against a W2K8 server, though I'll include a W2K8R2 server as well. Sorry, I made some last minute changes before pushing this patch and didn't re-run them. I'll be more careful next time. Though, several of the tests will fail against current HEAD because the features aren't implemented yet. Is it acceptable for the make test TESTS=smb2 to fail for a bit? Not without corresponding notations in the source{3,4}/selftest/knownfail files. Andrew Bartlett -- Andrew Bartlett http://samba.org/~abartlet/ Authentication Developer, Samba Team http://samba.org Samba Developer, Cisco Inc. signature.asc Description: This is a digitally signed message part
Re: [SCM] Samba Shared Repository - branch master updated- release-4-0-0alpha8-349-g5334b79
Hey Steven, No one at Isilon is working on SMB2 server side implementation currently, but we are front loading a lot of test work so there will be a reasonable set of correctness tests already available when new code is written. Right now we're working on porting most of the RAW SMB tests to SMB2, including open, streams, share modes, acls, brl, and change notify. All of our testing has been against a W2K8 server, though I'll include a W2K8R2 server as well. Sorry, I made some last minute changes before pushing this patch and didn't re-run them. I'll be more careful next time. Though, several of the tests will fail against current HEAD because the features aren't implemented yet. Is it acceptable for the make test TESTS=smb2 to fail for a bit? Not without corresponding notations in the source{3,4}/selftest/knownfail files. Yes, please make sure you use torture_comment() instead of printf() and all torture_assert* functions instead of just returning false in a test. Then make test reports them as failures instead of errors and it's easy to mark them as known failures. This makes sure that the server doesn't crash when the test runs against it. metze signature.asc Description: OpenPGP digital signature
[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-349-g5334b79
The branch, master has been updated via 5334b79142e32c39c56cea2e9c0d5b08e2f217ca (commit) from 4b6401ab2cce8319abe0f8176bb460d51bd4a390 (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 5334b79142e32c39c56cea2e9c0d5b08e2f217ca Author: Aravind aravind.sriniva...@isilon.com Date: Tue Jul 7 07:11:56 2009 -0700 torture/smb2: Adding SMB2 Directory enumeration torture tests. * Most of the tests were ported from SMB torture tests. * Added one new tests which checks the behavior of the file_index field present in SMB2_FIND struct. * Added one new test to check the enumeration of directories containing lots of files (~2000 files) with name lengths varying from 1 to 200 char. --- Summary of changes: source4/torture/smb2/config.mk |1 + source4/torture/smb2/dir.c | 1289 +++- source4/torture/smb2/smb2.c|1 + 3 files changed, 1265 insertions(+), 26 deletions(-) Changeset truncated at 500 lines: diff --git a/source4/torture/smb2/config.mk b/source4/torture/smb2/config.mk index bc4fc15..b321b41 100644 --- a/source4/torture/smb2/config.mk +++ b/source4/torture/smb2/config.mk @@ -22,6 +22,7 @@ TORTURE_SMB2_OBJ_FILES = $(addprefix $(torturesrcdir)/smb2/, \ smb2.o \ durable_open.o \ oplocks.o \ + dir.o \ lease.o \ create.o \ read.o \ diff --git a/source4/torture/smb2/dir.c b/source4/torture/smb2/dir.c index 58cf222..79672ef 100644 --- a/source4/torture/smb2/dir.c +++ b/source4/torture/smb2/dir.c @@ -1,20 +1,22 @@ -/* +/* Unix SMB/CIFS implementation. SMB2 dir list test suite Copyright (C) Andrew Tridgell 2005 - + Copyright (C) Zachary Loafman 2009 + Copyright (C) Aravind Srinivasan 2009 + 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 3 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, see http://www.gnu.org/licenses/. */ @@ -22,72 +24,1307 @@ #include includes.h #include libcli/smb2/smb2.h #include libcli/smb2/smb2_calls.h +#include libcli/smb_composite/smb_composite.h +#include libcli/raw/libcliraw.h +#include libcli/raw/raw_proto.h +#include libcli/libcli.h #include torture/torture.h #include torture/smb2/proto.h +#include torture/util.h + +#include system/filesys.h + +#define CHECK_STATUS(status, correct) do { \ + if (!NT_STATUS_EQUAL(status, correct)) { \ + torture_result(tctx, TORTURE_FAIL, __location__: \ + Incorrect status %s - should be %s, \ + nt_errstr(status), nt_errstr(correct)); \ + ret = false; \ + goto done; \ + }} while (0) + +#define CHECK_VALUE(v, correct) torture_assert_int_equal(tctx, (v), \ + (correct), incorrect value); + +#define DNAME smb2_dir +#define NFILES 100 + +struct file_elem { + char *name; + bool found; +}; + +static NTSTATUS populate_tree(struct torture_context *tctx, + TALLOC_CTX *mem_ctx, + struct smb2_tree *tree, + struct file_elem *files, + int nfiles, + struct smb2_handle *h_out) +{ + struct smb2_create create; + NTSTATUS status; + bool ret; + int i; + + smb2_deltree(tree, DNAME); + + ZERO_STRUCT(create); + create.in.desired_access = SEC_RIGHTS_DIR_ALL; + create.in.create_options = NTCREATEX_OPTIONS_DIRECTORY; + create.in.file_attributes = FILE_ATTRIBUTE_DIRECTORY; + create.in.share_access = NTCREATEX_SHARE_ACCESS_READ | +NTCREATEX_SHARE_ACCESS_WRITE | +NTCREATEX_SHARE_ACCESS_DELETE; + create.in.create_disposition = NTCREATEX_DISP_CREATE; + create.in.fname = DNAME; + + status = smb2_create(tree, mem_ctx, create); + CHECK_STATUS(status, NT_STATUS_OK); + *h_out = create.out.file.handle; + + ZERO_STRUCT(create); + create.in.desired_access = SEC_RIGHTS_FILE_ALL; + create.in.file_attributes = FILE_ATTRIBUTE_NORMAL; + create.in.create_disposition = NTCREATEX_DISP_CREATE; + + for (i = 0; i nfiles; i++) { +