summaryrefslogtreecommitdiff
path: root/source4/torture/raw
diff options
context:
space:
mode:
authorAravind Srinivasan <aravind.srinivasan@isilon.com>2010-01-21 18:18:03 +0000
committerTim Prouty <tprouty@samba.org>2010-06-21 17:08:41 -0700
commitc668b21cd6460e3baa12f8ef0375a58ee6b2d1d2 (patch)
treef3045f25186d9f352d2ca9b3422da16ead77ca4d /source4/torture/raw
parentf5709975c1671dc23471a81b2a6523138d98a74b (diff)
downloadsamba-c668b21cd6460e3baa12f8ef0375a58ee6b2d1d2.tar.gz
samba-c668b21cd6460e3baa12f8ef0375a58ee6b2d1d2.tar.bz2
samba-c668b21cd6460e3baa12f8ef0375a58ee6b2d1d2.zip
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 <tprouty@samba.org>
Diffstat (limited to 'source4/torture/raw')
-rw-r--r--source4/torture/raw/setfileinfo.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/source4/torture/raw/setfileinfo.c b/source4/torture/raw/setfileinfo.c
index 3b6de674ec..1973e7db3e 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);