summaryrefslogtreecommitdiff
path: root/source4/torture/raw
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-09-21 04:11:48 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:58:55 -0500
commit6108ead954121c52f1595fb68afe7e96964edf4a (patch)
tree6e0d35d12c2c5560d66914c502c85ae349424223 /source4/torture/raw
parent851e54de66381193c209ed7674c60208d844045f (diff)
downloadsamba-6108ead954121c52f1595fb68afe7e96964edf4a.tar.gz
samba-6108ead954121c52f1595fb68afe7e96964edf4a.tar.bz2
samba-6108ead954121c52f1595fb68afe7e96964edf4a.zip
r2462: added a test for the error code for no matching filename
(This used to be commit 7bfbbc38ed9aac93d288aba183f7a925f170f81e)
Diffstat (limited to 'source4/torture/raw')
-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;
}
}