summaryrefslogtreecommitdiff
path: root/source4/torture/raw/search.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/torture/raw/search.c')
-rw-r--r--source4/torture/raw/search.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/source4/torture/raw/search.c b/source4/torture/raw/search.c
index 081bbe8b3a..d1619d9191 100644
--- a/source4/torture/raw/search.c
+++ b/source4/torture/raw/search.c
@@ -107,6 +107,7 @@ static BOOL test_one_file(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
BOOL ret = True;
int fnum;
const char *fname = "\\torture_search.txt";
+ const char *fname2 = "\\torture_search-NOTEXIST.txt";
NTSTATUS status;
int i;
union smb_fileinfo all_info, alt_info, name_info, internal_info;
@@ -123,6 +124,7 @@ static BOOL test_one_file(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
/* call all the levels */
for (i=0;i<ARRAY_SIZE(levels);i++) {
+ NTSTATUS expected_status;
uint32_t cap = cli->transport->negotiate.capabilities;
printf("testing %s\n", levels[i].name);
@@ -142,6 +144,22 @@ static BOOL test_one_file(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
levels[i].name, (int)levels[i].level,
nt_errstr(levels[i].status));
ret = False;
+ continue;
+ }
+
+ status = single_search(cli, mem_ctx, fname2,
+ levels[i].level, &levels[i].data);
+
+ expected_status = NT_STATUS_NO_SUCH_FILE;
+ if (levels[i].level == RAW_SEARCH_SEARCH) {
+ expected_status = STATUS_NO_MORE_FILES;
+ }
+ if (!NT_STATUS_EQUAL(status, expected_status)) {
+ printf("search level %s(%d) should fail with %s - %s\n",
+ levels[i].name, (int)levels[i].level,
+ nt_errstr(expected_status),
+ nt_errstr(status));
+ ret = False;
}
}