From 6108ead954121c52f1595fb68afe7e96964edf4a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 21 Sep 2004 04:11:48 +0000 Subject: r2462: added a test for the error code for no matching filename (This used to be commit 7bfbbc38ed9aac93d288aba183f7a925f170f81e) --- source4/torture/raw/search.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'source4/torture') 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;itransport->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; } } -- cgit