The branch, master has been updated
       via  c668b21... s4 torture: RAW-SFILEINFO display warning instead of 
error on unsupported info level
      from  f570997... smbtorture: Fix missing includes.

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


- Log -----------------------------------------------------------------
commit c668b21cd6460e3baa12f8ef0375a58ee6b2d1d2
Author: Aravind Srinivasan <aravind.sriniva...@isilon.com>
Date:   Thu Jan 21 18:18:03 2010 +0000

    s4 torture: RAW-SFILEINFO display warning instead of error on unsupported 
info level
    
    Also add a test to make sure setting the directory attribute is
    disallowed.
    
    Signed-off-by: Tim Prouty <tpro...@samba.org>

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

Summary of changes:
 source4/torture/raw/setfileinfo.c |   28 ++++++++++++++++++++++++----
 1 files changed, 24 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/torture/raw/setfileinfo.c 
b/source4/torture/raw/setfileinfo.c
index 3b6de67..1973e7d 100644
--- a/source4/torture/raw/setfileinfo.c
+++ b/source4/torture/raw/setfileinfo.c
@@ -79,7 +79,11 @@ torture_raw_sfileinfo_base(struct torture_context *torture, 
struct smbcli_state
        sfinfo.generic.level = RAW_SFILEINFO_ ## call; \
        sfinfo.generic.in.file.fnum = fnum; \
        status = smb_raw_setfileinfo(cli->tree, &sfinfo); \
-       if (!NT_STATUS_EQUAL(status, rightstatus)) { \
+       if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_SUPPORTED)) { \
+                torture_warning(torture, \
+                       "(%s) %s - %s", __location__, #call, \
+                        nt_errstr(status)); \
+        } else if (!NT_STATUS_EQUAL(status, rightstatus)) { \
                printf("(%s) %s - %s (should be %s)\n", __location__, #call, \
                        nt_errstr(status), nt_errstr(rightstatus)); \
                ret = false; \
@@ -87,7 +91,11 @@ torture_raw_sfileinfo_base(struct torture_context *torture, 
struct smbcli_state
        finfo1.generic.level = RAW_FILEINFO_ALL_INFO; \
        finfo1.generic.in.file.fnum = fnum; \
        status2 = smb_raw_fileinfo(cli->tree, torture, &finfo1); \
-       if (!NT_STATUS_IS_OK(status2)) { \
+       if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_SUPPORTED)) { \
+                torture_warning(torture, \
+                       "(%s) %s - %s", __location__, #call, \
+                        nt_errstr(status)); \
+        } else if (!NT_STATUS_IS_OK(status2)) { \
                printf("(%s) %s pathinfo - %s\n", __location__, #call, 
nt_errstr(status)); \
                ret = false; \
        }} while (0)
@@ -102,7 +110,11 @@ torture_raw_sfileinfo_base(struct torture_context 
*torture, struct smbcli_state
                sfinfo.generic.in.file.path = path_fname_new; \
                status = smb_raw_setpathinfo(cli->tree, &sfinfo); \
        } \
-       if (!NT_STATUS_EQUAL(status, rightstatus)) { \
+       if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_SUPPORTED)) { \
+                torture_warning(torture, \
+                       "(%s) %s - %s", __location__, #call, \
+                        nt_errstr(status)); \
+        } else if (!NT_STATUS_EQUAL(status, rightstatus)) { \
                printf("(%s) %s - %s (should be %s)\n", __location__, #call, \
                        nt_errstr(status), nt_errstr(rightstatus)); \
                ret = false; \
@@ -114,7 +126,11 @@ torture_raw_sfileinfo_base(struct torture_context 
*torture, struct smbcli_state
                finfo1.generic.in.file.path = path_fname_new; \
                status2 = smb_raw_pathinfo(cli->tree, torture, &finfo1); \
        } \
-       if (!NT_STATUS_IS_OK(status2)) { \
+       if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_SUPPORTED)) { \
+                torture_warning(torture, \
+                       "(%s) %s - %s", __location__, #call, \
+                        nt_errstr(status)); \
+        } else if (!NT_STATUS_IS_OK(status2)) { \
                printf("(%s) %s pathinfo - %s\n", __location__, #call, 
nt_errstr(status2)); \
                ret = false; \
        }} while (0)
@@ -277,6 +293,10 @@ torture_raw_sfileinfo_base(struct torture_context 
*torture, struct smbcli_state
        CHECK_TIME(ALL_INFO, all_info, change_time, basetime + 400);
        CHECK_VALUE(ALL_INFO, all_info, attrib,     FILE_ATTRIBUTE_NORMAL);
 
+       torture_comment(torture, "try to change a file to a directory\n");
+       sfinfo.basic_info.in.attrib = FILE_ATTRIBUTE_DIRECTORY;
+       CHECK_CALL_FNUM(BASIC_INFO, NT_STATUS_INVALID_PARAMETER);
+
        printf("a zero time means don't change\n");
        unix_to_nt_time(&sfinfo.basic_info.in.create_time, 0);
        unix_to_nt_time(&sfinfo.basic_info.in.access_time, 0);


-- 
Samba Shared Repository

Reply via email to