From c668b21cd6460e3baa12f8ef0375a58ee6b2d1d2 Mon Sep 17 00:00:00 2001 From: Aravind Srinivasan Date: Thu, 21 Jan 2010 18:18:03 +0000 Subject: 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 --- source4/torture/raw/setfileinfo.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'source4/torture/raw/setfileinfo.c') 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); -- cgit