From 6da487580e9fac388ce3f3a2decaae03d5ae99a5 Mon Sep 17 00:00:00 2001 From: Aravind Srinivasan Date: Tue, 15 Jun 2010 11:21:34 -0700 Subject: 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 --- source4/torture/raw/search.c | 22 ++++++++++++++++++++-- source4/torture/smbtorture.c | 2 ++ source4/torture/smbtorture.h | 11 +++++++++++ 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/source4/torture/raw/search.c b/source4/torture/raw/search.c index 50f6e76193..f5419dc672 100644 --- a/source4/torture/raw/search.c +++ b/source4/torture/raw/search.c @@ -284,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; @@ -764,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); @@ -1026,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; } @@ -1195,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 d86e8dfe48..4b5eef63f1 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 5b12f4e3f5..b45ce65f50 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__ */ -- cgit