summaryrefslogtreecommitdiff
path: root/source4/torture/raw/open.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/torture/raw/open.c')
-rw-r--r--source4/torture/raw/open.c64
1 files changed, 16 insertions, 48 deletions
diff --git a/source4/torture/raw/open.c b/source4/torture/raw/open.c
index 3460a172b6..21cc32eb09 100644
--- a/source4/torture/raw/open.c
+++ b/source4/torture/raw/open.c
@@ -167,9 +167,7 @@ static bool test_open(struct torture_context *tctx, struct smbcli_state *cli)
int fnum = -1, fnum2;
bool ret = true;
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
io.openold.level = RAW_OPEN_OPEN;
io.openold.in.fname = fname;
@@ -301,9 +299,7 @@ static bool test_openx(struct torture_context *tctx, struct smbcli_state *cli)
{ OPENX_OPEN_FUNC_TRUNC | OPENX_OPEN_FUNC_CREATE, false, NT_STATUS_OK },
};
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
io.openx.level = RAW_OPEN_OPENX;
io.openx.in.fname = fname;
@@ -539,9 +535,7 @@ static bool test_t2open(struct torture_context *tctx, struct smbcli_state *cli)
{ OPENX_OPEN_FUNC_TRUNC | OPENX_OPEN_FUNC_CREATE, false, NT_STATUS_OK },
};
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
fnum = create_complex_file(cli, tctx, fname1);
if (fnum == -1) {
@@ -714,9 +708,7 @@ static bool test_ntcreatex(struct torture_context *tctx, struct smbcli_state *cl
{ 6, false, NT_STATUS_INVALID_PARAMETER },
};
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
/* reasonable default parameters */
io.generic.level = RAW_OPEN_NTCREATEX;
@@ -897,9 +889,7 @@ static bool test_nttrans_create(struct torture_context *tctx, struct smbcli_stat
{ 6, false, NT_STATUS_INVALID_PARAMETER },
};
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
/* reasonable default parameters */
io.generic.level = RAW_OPEN_NTTRANS_CREATE;
@@ -1151,9 +1141,7 @@ static bool test_ntcreatex_brlocked(struct torture_context *tctx, struct smbcli_
NTSTATUS status;
bool ret = true;
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
torture_comment(tctx, "Testing ntcreatex with a byte range locked file\n");
@@ -1226,9 +1214,7 @@ static bool test_mknew(struct torture_context *tctx, struct smbcli_state *cli)
time_t basetime = (time(NULL) + 3600*24*3) & ~1;
union smb_fileinfo finfo;
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
io.mknew.level = RAW_OPEN_MKNEW;
io.mknew.in.attrib = 0;
@@ -1283,9 +1269,7 @@ static bool test_create(struct torture_context *tctx, struct smbcli_state *cli)
time_t basetime = (time(NULL) + 3600*24*3) & ~1;
union smb_fileinfo finfo;
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
io.create.level = RAW_OPEN_CREATE;
io.create.in.attrib = 0;
@@ -1341,9 +1325,7 @@ static bool test_ctemp(struct torture_context *tctx, struct smbcli_state *cli)
union smb_fileinfo finfo;
const char *name, *fname = NULL;
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
io.ctemp.level = RAW_OPEN_CTEMP;
io.ctemp.in.attrib = FILE_ATTRIBUTE_HIDDEN;
@@ -1384,9 +1366,7 @@ static bool test_chained(struct torture_context *tctx, struct smbcli_state *cli)
const char *buf = "test";
char buf2[4];
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
fnum = create_complex_file(cli, tctx, fname);
@@ -1442,9 +1422,7 @@ static bool test_no_leading_slash(struct torture_context *tctx, struct smbcli_st
bool ret = true;
const char *buf = "test";
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
smbcli_unlink(cli->tree, fname);
@@ -1491,9 +1469,7 @@ static bool test_openx_over_dir(struct torture_context *tctx, struct smbcli_stat
int fnum = -1;
bool ret = true;
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
/* Create the Directory */
status = create_directory_handle(cli->tree, fname, &d_fnum);
@@ -1663,9 +1639,7 @@ static bool test_open_for_delete(struct torture_context *tctx, struct smbcli_sta
int fnum = -1;
bool ret = true;
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
/* reasonable default parameters */
io.generic.level = RAW_OPEN_NTCREATEX;
@@ -1726,9 +1700,7 @@ static bool test_chained_ntcreatex_readx(struct torture_context *tctx, struct sm
const char *buf = "test";
char buf2[4];
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
torture_comment(tctx, "Checking RAW_NTCREATEX_READX chained on "
"non-existant file \n");
@@ -1826,9 +1798,7 @@ static bool test_ntcreatex_opendisp_dir(struct torture_context *tctx,
io.ntcreatex.in.create_options = NTCREATEX_OPTIONS_DIRECTORY;
io.ntcreatex.in.fname = dname;
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
smbcli_rmdir(cli->tree, dname);
smbcli_unlink(cli->tree, dname);
@@ -1921,9 +1891,7 @@ static bool test_ntcreatexdir(struct torture_context *tctx,
};
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
/* setup some base params. */
io.generic.level = RAW_OPEN_NTCREATEX;