summaryrefslogtreecommitdiff
path: root/source4/torture/raw
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-06-10 01:08:54 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:56:38 -0500
commit02079ccc2eb83eec3c81aad29c15532c121dfb4c (patch)
tree7517fdde58378a510a7df1903ebdfc819953d1cb /source4/torture/raw
parent73c077d37b69267646986ea3fc2ed99d7ef15d4c (diff)
downloadsamba-02079ccc2eb83eec3c81aad29c15532c121dfb4c.tar.gz
samba-02079ccc2eb83eec3c81aad29c15532c121dfb4c.tar.bz2
samba-02079ccc2eb83eec3c81aad29c15532c121dfb4c.zip
r1098: Extended raw chkpath to catch regressions.
Jeremy. (This used to be commit 37d1fa1684b4cca125ae2cf6039f8b12e7ae1b89)
Diffstat (limited to 'source4/torture/raw')
-rw-r--r--source4/torture/raw/chkpath.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c
index 1b24f1c02f..71309fd5fb 100644
--- a/source4/torture/raw/chkpath.c
+++ b/source4/torture/raw/chkpath.c
@@ -105,6 +105,21 @@ static BOOL test_chkpath(struct cli_state *cli, TALLOC_CTX *mem_ctx)
status = smb_raw_chkpath(cli->tree, &io);
CHECK_STATUS(status, NT_STATUS_OK);
+ io.in.path = BASEDIR "\\nt\\Visual Studio\\VB98\\vb600";
+ printf("testing %s\n", io.in.path);
+ status = smb_raw_chkpath(cli->tree, &io);
+ CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_NOT_FOUND);
+
+ io.in.path = BASEDIR "\\nt\\Visual Studio\\VB98\\vb6.exe";
+ printf("testing %s\n", io.in.path);
+ status = smb_raw_chkpath(cli->tree, &io);
+ CHECK_STATUS(status, NT_STATUS_NOT_A_DIRECTORY);
+
+ io.in.path = BASEDIR "\\nt\\Visual Studio\\VB98\\vb6.exe\\3";
+ printf("testing %s\n", io.in.path);
+ status = smb_raw_chkpath(cli->tree, &io);
+ CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND);
+
done:
cli_close(cli->tree, fnum);
return ret;
@@ -117,6 +132,7 @@ BOOL torture_raw_chkpath(int dummy)
{
struct cli_state *cli;
BOOL ret = True;
+ int fnum;
TALLOC_CTX *mem_ctx;
if (!torture_open_connection(&cli)) {
@@ -134,10 +150,34 @@ BOOL torture_raw_chkpath(int dummy)
return False;
}
+ if (NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR "\\nt"))) {
+ printf("Failed to create " BASEDIR " - %s\n", cli_errstr(cli->tree));
+ return False;
+ }
+
+ if (NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR "\\nt\\Visual Studio"))) {
+ printf("Failed to create " BASEDIR " - %s\n", cli_errstr(cli->tree));
+ return False;
+ }
+
+ if (NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR "\\nt\\Visual Studio\\VB98"))) {
+ printf("Failed to create " BASEDIR " - %s\n", cli_errstr(cli->tree));
+ return False;
+ }
+
+ fnum = create_complex_file(cli, mem_ctx, BASEDIR "\\nt\\Visual Studio\\VB98\\vb6.exe");
+ if (fnum == -1) {
+ printf("failed to open \\nt\\Visual Studio\\VB98\\vb6.exe - %s\n", cli_errstr(cli->tree));
+ ret = False;
+ goto done;
+ }
+
if (!test_chkpath(cli, mem_ctx)) {
ret = False;
}
+ done:
+
smb_raw_exit(cli->session);
cli_deltree(cli->tree, BASEDIR);