s4 torture: RAW-SEARCH: break out some of the old search levels
authorAravind Srinivasan <aravind.srinivasan@isilon.com>
Tue, 15 Jun 2010 18:21:34 +0000 (11:21 -0700)
committerTim Prouty <tprouty@samba.org>
Tue, 15 Jun 2010 20:48:15 +0000 (13:48 -0700)
* 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@samba.org>
source4/torture/raw/search.c
source4/torture/smbtorture.c
source4/torture/smbtorture.h

index 50f6e76193db485d0a8da050c6aa3c663feb80cf..f5419dc672d024ea0b52cc137f459a598b5e2747 100644 (file)
@@ -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;
        }
index d86e8dfe4868ff001a11e795a64f9c9e21cf7191..4b5eef63f186d1c96ef9d6f1dd38f95638046f3e 100644 (file)
@@ -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) {
index 5b12f4e3f5c4a78d3eff2c5ce661c1c675cf951e..b45ce65f5087665c94342fa825c5cc3517bd6edf 100644 (file)
@@ -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__ */