mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
s3: Add a quick test for bug 8042
Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Sun Apr 3 16:13:21 CEST 2011 on sn-devel-104
This commit is contained in:
parent
2b94169cda
commit
32296a2c36
@ -1213,6 +1213,7 @@ SMBTORTURE_OBJ1 = torture/torture.o torture/nbio.o torture/scanner.o torture/uta
|
|||||||
torture/test_async_echo.o \
|
torture/test_async_echo.o \
|
||||||
torture/test_smbsock_any_connect.o \
|
torture/test_smbsock_any_connect.o \
|
||||||
torture/test_addrchange.o \
|
torture/test_addrchange.o \
|
||||||
|
torture/test_case_insensitive.o \
|
||||||
torture/test_posix_append.o
|
torture/test_posix_append.o
|
||||||
|
|
||||||
SMBTORTURE_OBJ = $(SMBTORTURE_OBJ1) $(PARAM_OBJ) $(TLDAP_OBJ) \
|
SMBTORTURE_OBJ = $(SMBTORTURE_OBJ1) $(PARAM_OBJ) $(TLDAP_OBJ) \
|
||||||
|
@ -59,6 +59,7 @@ tests=[ "FDPASS", "LOCK1", "LOCK2", "LOCK3", "LOCK4", "LOCK5", "LOCK6", "LOCK7",
|
|||||||
"TCON2", "IOCTL", "CHKPATH", "FDSESS", "LOCAL-SUBSTITUTE", "CHAIN1",
|
"TCON2", "IOCTL", "CHKPATH", "FDSESS", "LOCAL-SUBSTITUTE", "CHAIN1",
|
||||||
"GETADDRINFO", "POSIX", "UID-REGRESSION-TEST", "SHORTNAME-TEST",
|
"GETADDRINFO", "POSIX", "UID-REGRESSION-TEST", "SHORTNAME-TEST",
|
||||||
"LOCAL-BASE64", "LOCAL-GENCACHE", "POSIX-APPEND",
|
"LOCAL-BASE64", "LOCAL-GENCACHE", "POSIX-APPEND",
|
||||||
|
"CASE-INSENSITIVE-CREATE",
|
||||||
"LOCAL-string_to_sid", "LOCAL-CONVERT-STRING" ]
|
"LOCAL-string_to_sid", "LOCAL-CONVERT-STRING" ]
|
||||||
|
|
||||||
for t in tests:
|
for t in tests:
|
||||||
|
@ -81,6 +81,7 @@ bool torture_casetable(int dummy);
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
bool run_posix_append(int dummy);
|
bool run_posix_append(int dummy);
|
||||||
|
bool run_case_insensitive_create(int dummy);
|
||||||
|
|
||||||
bool run_nbench2(int dummy);
|
bool run_nbench2(int dummy);
|
||||||
bool run_async_echo(int dummy);
|
bool run_async_echo(int dummy);
|
||||||
|
79
source3/torture/test_case_insensitive.c
Normal file
79
source3/torture/test_case_insensitive.c
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
/*
|
||||||
|
Unix SMB/CIFS implementation.
|
||||||
|
reproducer for bug 8042
|
||||||
|
Copyright (C) Volker Lendecke 2011
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "includes.h"
|
||||||
|
#include "torture/proto.h"
|
||||||
|
#include "system/filesys.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Regression test file creates on case insensitive file systems (e.g. OS/X)
|
||||||
|
* https://bugzilla.samba.org/show_bug.cgi?id=8042
|
||||||
|
*/
|
||||||
|
|
||||||
|
bool run_case_insensitive_create(int dummy)
|
||||||
|
{
|
||||||
|
struct cli_state *cli;
|
||||||
|
uint16_t fnum;
|
||||||
|
NTSTATUS status;
|
||||||
|
|
||||||
|
printf("Starting case_insensitive_create\n");
|
||||||
|
|
||||||
|
if (!torture_open_connection(&cli, 0)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
status = cli_mkdir(cli, "x");
|
||||||
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
|
printf("cli_mkdir failed: %s\n", nt_errstr(status));
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
status = cli_chkpath(cli, "X");
|
||||||
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
|
printf("cli_chkpath failed: %s\n", nt_errstr(status));
|
||||||
|
goto rmdir;
|
||||||
|
}
|
||||||
|
status = cli_open(cli, "x\\y", O_RDWR|O_CREAT, 0, &fnum);
|
||||||
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
|
printf("cli_open failed: %s\n", nt_errstr(status));
|
||||||
|
|
||||||
|
if (NT_STATUS_EQUAL(status, NT_STATUS_FILE_IS_A_DIRECTORY)) {
|
||||||
|
printf("Bug 8042 reappeared!!\n");
|
||||||
|
}
|
||||||
|
goto unlink;
|
||||||
|
}
|
||||||
|
status = cli_close(cli, fnum);
|
||||||
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
|
printf("cli_close failed: %s\n", nt_errstr(status));
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
unlink:
|
||||||
|
status = cli_unlink(cli, "x\\y", 0);
|
||||||
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
|
printf("cli_unlink failed: %s\n", nt_errstr(status));
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
rmdir:
|
||||||
|
status = cli_rmdir(cli, "x");
|
||||||
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
|
printf("cli_close failed: %s\n", nt_errstr(status));
|
||||||
|
}
|
||||||
|
done:
|
||||||
|
torture_close_connection(cli);
|
||||||
|
return NT_STATUS_IS_OK(status);
|
||||||
|
}
|
@ -8224,6 +8224,7 @@ static struct {
|
|||||||
{"OPEN", run_opentest, 0},
|
{"OPEN", run_opentest, 0},
|
||||||
{"POSIX", run_simple_posix_open_test, 0},
|
{"POSIX", run_simple_posix_open_test, 0},
|
||||||
{"POSIX-APPEND", run_posix_append, 0},
|
{"POSIX-APPEND", run_posix_append, 0},
|
||||||
|
{"CASE-INSENSITIVE-CREATE", run_case_insensitive_create, 0},
|
||||||
{"ASYNC-ECHO", run_async_echo, 0},
|
{"ASYNC-ECHO", run_async_echo, 0},
|
||||||
{ "UID-REGRESSION-TEST", run_uid_regression_test, 0},
|
{ "UID-REGRESSION-TEST", run_uid_regression_test, 0},
|
||||||
{ "SHORTNAME-TEST", run_shortname_test, 0},
|
{ "SHORTNAME-TEST", run_shortname_test, 0},
|
||||||
|
@ -562,6 +562,7 @@ SMBTORTURE_SRC1 = '''torture/torture.c torture/nbio.c torture/scanner.c torture/
|
|||||||
torture/test_async_echo.c
|
torture/test_async_echo.c
|
||||||
torture/test_addrchange.c
|
torture/test_addrchange.c
|
||||||
torture/test_posix_append.c
|
torture/test_posix_append.c
|
||||||
|
torture/test_case_insensitive.c
|
||||||
torture/test_smbsock_any_connect.c'''
|
torture/test_smbsock_any_connect.c'''
|
||||||
|
|
||||||
SMBTORTURE_SRC = '''${SMBTORTURE_SRC1}
|
SMBTORTURE_SRC = '''${SMBTORTURE_SRC1}
|
||||||
|
Loading…
Reference in New Issue
Block a user