[SCM] Samba Shared Repository - branch master updated

Tim Prouty tprouty at samba.org
Tue Jun 15 14:49:19 MDT 2010


The branch, master has been updated
       via  6da4875... s4 torture: RAW-SEARCH: break out some of the old search levels
       via  2170a59... s4 torture: RAW-SEARCH: Only test supported info levels
      from  a4a127e... s4-waf: Fix build of libldb_ildap against system ldb.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 6da487580e9fac388ce3f3a2decaae03d5ae99a5
Author: Aravind Srinivasan <aravind.srinivasan at isilon.com>
Date:   Tue Jun 15 11:21:34 2010 -0700

    s4 torture: RAW-SEARCH: break out some of the old search levels
    
    * Added two new parameters: raw_search_search and raw_ea_size which
      can be enabled/disabled based on whether the server supports
      RAW_SEARCH_SEARCH and/or RAW_SEARCH_EA_SIZE levels
    
    * Skip unsupported levels from the server and give a warning rather
      than failing.
    
    Signed-off-by: Tim Prouty <tprouty at samba.org>

commit 2170a59215d00554b97dc2053eeb6dde38ef3e97
Author: Tim Prouty <tprouty at samba.org>
Date:   Mon Jun 14 16:50:29 2010 -0700

    s4 torture: RAW-SEARCH: Only test supported info levels

-----------------------------------------------------------------------

Summary of changes:
 source4/torture/raw/search.c |   76 +++++++++++++++++++++++++++++++++++------
 source4/torture/smbtorture.c |    2 +
 source4/torture/smbtorture.h |   11 ++++++
 3 files changed, 78 insertions(+), 11 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/torture/raw/search.c b/source4/torture/raw/search.c
index 3951605..f5419dc 100644
--- a/source4/torture/raw/search.c
+++ b/source4/torture/raw/search.c
@@ -28,6 +28,23 @@
 
 #define BASEDIR "\\testsearch"
 
+#define CHECK_STATUS_LEVEL(__tctx, __status, __level, __supp)		\
+	do {								\
+		if (NT_STATUS_EQUAL(__status,				\
+			NT_STATUS_NOT_SUPPORTED) ||			\
+		    NT_STATUS_EQUAL(__status,				\
+			NT_STATUS_NOT_IMPLEMENTED)) {			\
+			torture_warning(__tctx, "(%s) Info "		\
+			    "level "#__level" is %s",			\
+			    __location__, nt_errstr(__status));		\
+			__supp = false;					\
+		} else {						\
+			torture_assert_ntstatus_ok_goto(__tctx,		\
+			    __status, ret, done, #__level" failed");	\
+			__supp = true;					\
+		}							\
+	} while (0)
+
 /*
   callback function for single_search
 */
@@ -242,6 +259,8 @@ static bool test_one_file(struct torture_context *tctx,
 	NTSTATUS status;
 	int i;
 	union smb_fileinfo all_info, alt_info, name_info, internal_info;
+	bool all_info_supported, alt_info_supported, name_info_supported,
+	    internal_info_supported;
 	union smb_search_data *s;
 
 	fnum = create_complex_file(cli, tctx, fname);
@@ -265,7 +284,8 @@ static bool test_one_file(struct torture_context *tctx,
 							 &levels[i].data);
 
 		/* see if this server claims to support this level */
-		if ((cap & levels[i].capability_mask) != levels[i].capability_mask) {
+		if (((cap & levels[i].capability_mask) != levels[i].capability_mask)
+		    || NT_STATUS_EQUAL(levels[i].status, NT_STATUS_NOT_SUPPORTED)) {
 			printf("search level %s(%d) not supported by server\n",
 			       levels[i].name, (int)levels[i].level);
 			continue;
@@ -304,22 +324,26 @@ static bool test_one_file(struct torture_context *tctx,
 	all_info.generic.level = RAW_FILEINFO_ALL_INFO;
 	all_info.generic.in.file.path = fname;
 	status = smb_raw_pathinfo(cli->tree, tctx, &all_info);
-	torture_assert_ntstatus_ok(tctx, status, "RAW_FILEINFO_ALL_INFO failed");
+	CHECK_STATUS_LEVEL(tctx, status, "RAW_FILEINFO_ALL_INFO",
+	    all_info_supported);
 
 	alt_info.generic.level = RAW_FILEINFO_ALT_NAME_INFO;
 	alt_info.generic.in.file.path = fname;
 	status = smb_raw_pathinfo(cli->tree, tctx, &alt_info);
-	torture_assert_ntstatus_ok(tctx, status, "RAW_FILEINFO_ALT_NAME_INFO failed");
+	CHECK_STATUS_LEVEL(tctx, status, "RAW_FILEINFO_ALT_NAME_INFO",
+	    alt_info_supported);
 
 	internal_info.generic.level = RAW_FILEINFO_INTERNAL_INFORMATION;
 	internal_info.generic.in.file.path = fname;
 	status = smb_raw_pathinfo(cli->tree, tctx, &internal_info);
-	torture_assert_ntstatus_ok(tctx, status, "RAW_FILEINFO_INTERNAL_INFORMATION failed");
+	CHECK_STATUS_LEVEL(tctx, status, "RAW_FILEINFO_INTERNAL_INFORMATION",
+	    internal_info_supported);
 
 	name_info.generic.level = RAW_FILEINFO_NAME_INFO;
 	name_info.generic.in.file.path = fname;
 	status = smb_raw_pathinfo(cli->tree, tctx, &name_info);
-	torture_assert_ntstatus_ok(tctx, status, "RAW_FILEINFO_NAME_INFO failed");
+	CHECK_STATUS_LEVEL(tctx, status, "RAW_FILEINFO_NAME_INFO",
+	    name_info_supported);
 
 #define CHECK_VAL(name, sname1, field1, v, sname2, field2) do { \
 	s = find(name); \
@@ -477,21 +501,34 @@ static bool test_one_file(struct torture_context *tctx,
 	CHECK_VAL("ID_FULL_DIRECTORY_INFO", id_full_directory_info,           ea_size, all_info, all_info, ea_size);
 	CHECK_VAL("ID_BOTH_DIRECTORY_INFO", id_both_directory_info,           ea_size, all_info, all_info, ea_size);
 
-	CHECK_STR("SEARCH", search, name, alt_info, alt_name_info, fname);
-	CHECK_WSTR("BOTH_DIRECTORY_INFO", both_directory_info, short_name, alt_info, alt_name_info, fname, STR_UNICODE);
+	if (alt_info_supported) {
+		CHECK_STR("SEARCH", search, name, alt_info, alt_name_info,
+		    fname);
+		CHECK_WSTR("BOTH_DIRECTORY_INFO", both_directory_info,
+		    short_name, alt_info, alt_name_info, fname, STR_UNICODE);
+	}
 
 	CHECK_NAME("STANDARD",            standard,            name, fname+1, 0);
 	CHECK_NAME("EA_SIZE",             ea_size,             name, fname+1, 0);
 	CHECK_NAME("DIRECTORY_INFO",      directory_info,      name, fname+1, STR_TERMINATE_ASCII);
 	CHECK_NAME("FULL_DIRECTORY_INFO", full_directory_info, name, fname+1, STR_TERMINATE_ASCII);
-	CHECK_NAME("NAME_INFO",           name_info,           name, fname+1, STR_TERMINATE_ASCII);
+
+	if (name_info_supported) {
+		CHECK_NAME("NAME_INFO", name_info, name, fname+1,
+		    STR_TERMINATE_ASCII);
+	}
+
 	CHECK_NAME("BOTH_DIRECTORY_INFO", both_directory_info, name, fname+1, STR_TERMINATE_ASCII);
 	CHECK_NAME("ID_FULL_DIRECTORY_INFO", id_full_directory_info,           name, fname+1, STR_TERMINATE_ASCII);
 	CHECK_NAME("ID_BOTH_DIRECTORY_INFO", id_both_directory_info,           name, fname+1, STR_TERMINATE_ASCII);
 	CHECK_UNIX_NAME("UNIX_INFO",           unix_info,           name, fname+1, STR_TERMINATE_ASCII);
 
-	CHECK_VAL("ID_FULL_DIRECTORY_INFO", id_full_directory_info, file_id, internal_info, internal_information, file_id);
-	CHECK_VAL("ID_BOTH_DIRECTORY_INFO", id_both_directory_info, file_id, internal_info, internal_information, file_id);
+	if (internal_info_supported) {
+		CHECK_VAL("ID_FULL_DIRECTORY_INFO", id_full_directory_info,
+		    file_id, internal_info, internal_information, file_id);
+		CHECK_VAL("ID_BOTH_DIRECTORY_INFO", id_both_directory_info,
+		    file_id, internal_info, internal_information, file_id);
+	}
 
 done:
 	smb_raw_exit(cli->session);
@@ -728,7 +765,12 @@ static bool test_many_files(struct torture_context *tctx,
 					 search_types[t].data_level,
 					 search_types[t].cont_type,
 					 &result);
-	
+		if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_SUPPORTED)) {
+			torture_warning(tctx, "search level %s not supported "
+					"by server",
+					search_types[t].name);
+			continue;
+		}
 		torture_assert_ntstatus_ok(tctx, status, "search failed");
 		CHECK_VALUE(result.count, num_files);
 
@@ -990,6 +1032,11 @@ static bool test_many_dirs(struct torture_context *tctx,
 	NTSTATUS status;
 	union smb_search_data *file, *file2, *file3;
 
+	if (!torture_setting_bool(tctx, "raw_search_search", true)) {
+		torture_comment(tctx, "Skipping these tests as the server "
+			"doesn't support old style search calls\n");
+		return true;
+	}
 	if (!torture_setup_dir(cli, BASEDIR)) {
 		return false;
 	}
@@ -1159,6 +1206,13 @@ static bool test_os2_delete(struct torture_context *tctx,
 	union smb_search_next io2;
 	struct multiple_result result;
 
+	if (!torture_setting_bool(tctx, "search_ea_size", true)){
+		torture_comment(tctx,
+				"Server does not support RAW_SEARCH_EA_SIZE "
+				"level. Skipping this test\n");
+		return true;
+	}
+
 	if (!torture_setup_dir(cli, BASEDIR)) {
 		return false;
 	}
diff --git a/source4/torture/smbtorture.c b/source4/torture/smbtorture.c
index d86e8df..4b5eef6 100644
--- a/source4/torture/smbtorture.c
+++ b/source4/torture/smbtorture.c
@@ -533,6 +533,8 @@ int main(int argc,char *argv[])
 		lp_set_cmdline(cmdline_lp_ctx, "torture:writeclose_support", "false");
 		lp_set_cmdline(cmdline_lp_ctx, "torture:resume_key_support", "false");
 		lp_set_cmdline(cmdline_lp_ctx, "torture:rewind_support", "false");
+		lp_set_cmdline(cmdline_lp_ctx, "torture:raw_search_search", "false");
+		lp_set_cmdline(cmdline_lp_ctx, "torture:search_ea_size", "false");
 	}
 
 	if (max_runtime) {
diff --git a/source4/torture/smbtorture.h b/source4/torture/smbtorture.h
index 5b12f4e..b45ce65 100644
--- a/source4/torture/smbtorture.h
+++ b/source4/torture/smbtorture.h
@@ -133,4 +133,15 @@ bool torture_register_suite(struct torture_suite *suite);
  * rather than NT_STATUS_ACCESS_DENIED when trying to open one of these files.
  */
 
+/* torture:raw_search_search
+ *
+ * Server supports RAW_SEARCH_SEARCH level.
+ */
+
+/* torture:search_ea_size
+ *
+ * Server supports RAW_SEARCH_DATA_EA_SIZE - This flag disables
+ * the appropriate test.
+ */
+
 #endif /* __SMBTORTURE_H__ */


-- 
Samba Shared Repository


More information about the samba-cvs mailing list