From 02079ccc2eb83eec3c81aad29c15532c121dfb4c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 10 Jun 2004 01:08:54 +0000 Subject: r1098: Extended raw chkpath to catch regressions. Jeremy. (This used to be commit 37d1fa1684b4cca125ae2cf6039f8b12e7ae1b89) --- source4/torture/raw/chkpath.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'source4') 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); -- cgit