diff options
author | Volker Lendecke <vlendec@samba.org> | 2007-08-20 05:24:19 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 15:02:17 -0500 |
commit | 7e43f973c4e3c76369e690707055f233d15fa37d (patch) | |
tree | 4d9e8278d121078883da5cd82156f70fabf4a8de /source4/torture/raw/rename.c | |
parent | 7c9312a885c203328833bb6cbd8cf31454592427 (diff) | |
download | samba-7e43f973c4e3c76369e690707055f233d15fa37d.tar.gz samba-7e43f973c4e3c76369e690707055f233d15fa37d.tar.xz samba-7e43f973c4e3c76369e690707055f233d15fa37d.zip |
r24569: Add two tests
A subtest for rename to check if case-changing renames work
A test that exposes the case insensitivity unix_convert bug
(This used to be commit 786706322a920fd54585bec72d860ed112398f12)
Diffstat (limited to 'source4/torture/raw/rename.c')
-rw-r--r-- | source4/torture/raw/rename.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source4/torture/raw/rename.c b/source4/torture/raw/rename.c index 22e91a44a92..9e997705037 100644 --- a/source4/torture/raw/rename.c +++ b/source4/torture/raw/rename.c @@ -51,6 +51,8 @@ static BOOL test_mv(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) int fnum = -1; const char *fname1 = BASEDIR "\\test1.txt"; const char *fname2 = BASEDIR "\\test2.txt"; + const char *Fname1 = BASEDIR "\\Test1.txt"; + union smb_fileinfo finfo; union smb_open op; printf("Testing SMBmv\n"); @@ -109,6 +111,24 @@ static BOOL test_mv(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) status = smb_raw_rename(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_OK); + printf("Trying case-changing rename\n"); + io.rename.in.pattern1 = fname1; + io.rename.in.pattern2 = Fname1; + status = smb_raw_rename(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OK); + + finfo.generic.level = RAW_FILEINFO_ALL_INFO; + finfo.all_info.in.file.path = fname1; + status = smb_raw_pathinfo(cli->tree, mem_ctx, &finfo); + CHECK_STATUS(status, NT_STATUS_OK); + if (strcmp(finfo.all_info.out.fname.s, Fname1) != 0) { + printf("(%s) Incorrect filename [%s] after case-changing " + "rename, should be [%s]\n", __location__, + finfo.all_info.out.fname.s, Fname1); + ret = False; + goto done; + } + io.rename.in.pattern1 = fname1; io.rename.in.pattern2 = fname2; |