summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-05-18 15:43:31 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-05-18 09:35:13 +0200
commit45082a88c7aaaa928ca36003ade071aafe4de54d (patch)
tree2800e5aaff2da77f5156e12a8bba5e765e794e35
parent8c52d1b8ac7d56eb728e4cc4ed2a560365d374b5 (diff)
downloadsamba-45082a88c7aaaa928ca36003ade071aafe4de54d.tar.gz
samba-45082a88c7aaaa928ca36003ade071aafe4de54d.tar.bz2
samba-45082a88c7aaaa928ca36003ade071aafe4de54d.zip
s4-torture: Improve torture test boilerplate, use torture_assert()
This ensures that if this fails, it is reported as a subunit error correctly. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Fri May 18 09:35:13 CEST 2012 on sn-devel-104
-rw-r--r--source4/torture/basic/delaywrite.c64
-rw-r--r--source4/torture/basic/disconnect.c4
-rw-r--r--source4/torture/basic/locking.c4
-rw-r--r--source4/torture/raw/chkpath.c4
-rw-r--r--source4/torture/raw/context.c24
-rw-r--r--source4/torture/raw/eas.c8
-rw-r--r--source4/torture/raw/ioctl.c4
-rw-r--r--source4/torture/raw/lock.c44
-rw-r--r--source4/torture/raw/mkdir.c4
-rw-r--r--source4/torture/raw/mux.c4
-rw-r--r--source4/torture/raw/open.c64
-rw-r--r--source4/torture/raw/oplock.c8
-rw-r--r--source4/torture/raw/read.c20
-rw-r--r--source4/torture/raw/rename.c16
-rw-r--r--source4/torture/raw/search.c28
-rw-r--r--source4/torture/raw/setfileinfo.c12
-rw-r--r--source4/torture/raw/streams.c52
-rw-r--r--source4/torture/raw/unlink.c8
18 files changed, 93 insertions, 279 deletions
diff --git a/source4/torture/basic/delaywrite.c b/source4/torture/basic/delaywrite.c
index 939827ec3c..15482d8bc0 100644
--- a/source4/torture/basic/delaywrite.c
+++ b/source4/torture/basic/delaywrite.c
@@ -54,9 +54,7 @@ static bool test_delayed_write_update(struct torture_context *tctx, struct smbcl
torture_comment(tctx, "\nRunning test_delayed_write_update\n");
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
fnum1 = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
if (fnum1 == -1) {
@@ -148,9 +146,7 @@ static bool test_delayed_write_update1(struct torture_context *tctx, struct smbc
torture_comment(tctx, "\nRunning test_delayed_write_update1\n");
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
fnum1 = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
if (fnum1 == -1) {
@@ -339,9 +335,7 @@ static bool test_delayed_write_update1a(struct torture_context *tctx, struct smb
torture_comment(tctx, "\nRunning test_delayed_write_update1a\n");
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
fnum1 = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
if (fnum1 == -1) {
@@ -521,9 +515,7 @@ static bool test_delayed_write_update1b(struct torture_context *tctx, struct smb
torture_comment(tctx, "\nRunning test_delayed_write_update1b\n");
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
fnum1 = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
if (fnum1 == -1) {
@@ -696,9 +688,7 @@ static bool test_delayed_write_update1c(struct torture_context *tctx, struct smb
torture_comment(tctx, "\nRunning test_delayed_write_update1c\n");
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
fnum1 = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
if (fnum1 == -1) {
@@ -878,9 +868,7 @@ static bool test_delayed_write_update2(struct torture_context *tctx, struct smbc
torture_comment(tctx, "\nRunning test_delayed_write_update2\n");
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
fnum1 = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
if (fnum1 == -1) {
@@ -1237,9 +1225,7 @@ static bool test_finfo_after_write(struct torture_context *tctx, struct smbcli_s
torture_comment(tctx, "\nRunning test_finfo_after_write\n");
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
fnum1 = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
if (fnum1 == -1) {
@@ -1511,9 +1497,7 @@ static bool test_delayed_write_update3(struct torture_context *tctx,
torture_comment(tctx, "\nRunning test_delayed_write_update3\n");
- 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, "Open the file handle\n");
fnum1 = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
@@ -1665,9 +1649,7 @@ static bool test_delayed_write_update3a(struct torture_context *tctx,
torture_comment(tctx, "\nRunning test_delayed_write_update3a\n");
- 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, "Open the file handle\n");
fnum1 = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
@@ -1878,9 +1860,7 @@ static bool test_delayed_write_update3b(struct torture_context *tctx,
torture_comment(tctx, "\nRunning test_delayed_write_update3b\n");
- 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, "Open the file handle\n");
fnum1 = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
@@ -2044,9 +2024,7 @@ static bool test_delayed_write_update3c(struct torture_context *tctx,
torture_comment(tctx, "\nRunning test_delayed_write_update3c\n");
- 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, "Open the file handle\n");
fnum1 = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
@@ -2254,9 +2232,7 @@ static bool test_delayed_write_update4(struct torture_context *tctx,
torture_comment(tctx, "\nRunning test_delayed_write_update4\n");
- 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, "Open the file handle\n");
fnum1 = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
@@ -2413,9 +2389,7 @@ static bool test_delayed_write_update5(struct torture_context *tctx,
torture_comment(tctx, "\nRunning test_delayed_write_update5\n");
- 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, "Open the file handle\n");
fnum1 = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
@@ -2575,9 +2549,7 @@ static bool test_delayed_write_update5b(struct torture_context *tctx,
torture_comment(tctx, "\nRunning test_delayed_write_update5b\n");
- 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, "Open the file handle\n");
fnum1 = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
@@ -2743,9 +2715,7 @@ static bool test_delayed_write_update6(struct torture_context *tctx,
torture_comment(tctx, "\nRunning test_delayed_write_update6\n");
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
again:
torture_comment(tctx, "Open the file handle\n");
fnum1 = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
@@ -3001,9 +2971,7 @@ static bool test_delayed_write_update7(struct torture_context *tctx, struct smbc
ZERO_STRUCT(finfo3);
ZERO_STRUCT(open_parms);
- 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 file. */
fnum1 = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
diff --git a/source4/torture/basic/disconnect.c b/source4/torture/basic/disconnect.c
index 17fbc61d2f..7fb87d81fc 100644
--- a/source4/torture/basic/disconnect.c
+++ b/source4/torture/basic/disconnect.c
@@ -151,9 +151,7 @@ bool torture_disconnect(struct torture_context *torture)
return false;
}
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(torture, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
for (i=0;i<torture_numops;i++) {
ret &= test_disconnect_lock(cli, mem_ctx);
diff --git a/source4/torture/basic/locking.c b/source4/torture/basic/locking.c
index 1c0a94e591..98def5c09c 100644
--- a/source4/torture/basic/locking.c
+++ b/source4/torture/basic/locking.c
@@ -646,9 +646,7 @@ static bool torture_locktest6(struct torture_context *tctx,
int fnum;
NTSTATUS status;
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
for (i=0;i<1;i++) {
torture_comment(tctx, "Testing %s\n", fname[i]);
diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c
index ed7b5b2917..2afd7ea478 100644
--- a/source4/torture/raw/chkpath.c
+++ b/source4/torture/raw/chkpath.c
@@ -354,9 +354,7 @@ bool torture_raw_chkpath(struct torture_context *torture,
bool ret = true;
int fnum;
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(torture, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
if (NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR "\\nt"))) {
printf("Failed to create " BASEDIR " - %s\n", smbcli_errstr(cli->tree));
diff --git a/source4/torture/raw/context.c b/source4/torture/raw/context.c
index 386ba34ae5..d9d7820e5f 100644
--- a/source4/torture/raw/context.c
+++ b/source4/torture/raw/context.c
@@ -73,9 +73,7 @@ static bool test_session(struct torture_context *tctx,
torture_comment(tctx, "TESTING SESSION HANDLING\n");
- 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, "create a second security context on the same transport\n");
@@ -285,9 +283,7 @@ static bool test_tree(struct torture_context *tctx, struct smbcli_state *cli)
torture_comment(tctx, "TESTING TREE HANDLING\n");
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
share = torture_setting_string(tctx, "share", NULL);
host = torture_setting_string(tctx, "host", NULL);
@@ -394,9 +390,7 @@ static bool test_tree_ulogoff(struct torture_context *tctx, struct smbcli_state
torture_comment(tctx, "TESTING TREE with ulogoff\n");
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
share = torture_setting_string(tctx, "share", NULL);
host = torture_setting_string(tctx, "host", NULL);
@@ -545,9 +539,7 @@ static bool test_pid_exit_only_sees_open(struct torture_context *tctx,
torture_comment(tctx, "TESTING PID HANDLING exit() only cares about open() PID\n");
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
pid1 = cli->session->pid;
pid2 = pid1 + 1;
@@ -657,9 +649,7 @@ static bool test_pid_2sess(struct torture_context *tctx,
torture_comment(tctx, "TESTING PID HANDLING WITH 2 SESSIONS\n");
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
lpcfg_smbcli_session_options(tctx->lp_ctx, &options);
@@ -766,9 +756,7 @@ static bool test_pid_2tcon(struct torture_context *tctx,
torture_comment(tctx, "TESTING PID HANDLING WITH 2 TCONS\n");
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
share = torture_setting_string(tctx, "share", NULL);
host = torture_setting_string(tctx, "host", NULL);
diff --git a/source4/torture/raw/eas.c b/source4/torture/raw/eas.c
index d173cf7ea5..a0ba06f415 100644
--- a/source4/torture/raw/eas.c
+++ b/source4/torture/raw/eas.c
@@ -446,9 +446,7 @@ bool torture_raw_eas(struct torture_context *torture, struct smbcli_state *cli)
{
bool ret = true;
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(torture, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
ret &= test_eas(cli, torture);
ret &= test_nttrans_create(cli, torture);
@@ -470,9 +468,7 @@ bool torture_max_eas(struct torture_context *torture)
return false;
}
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(torture, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
ret &= test_max_eas(cli, torture);
diff --git a/source4/torture/raw/ioctl.c b/source4/torture/raw/ioctl.c
index a062d0bd2a..0dc0ac9a27 100644
--- a/source4/torture/raw/ioctl.c
+++ b/source4/torture/raw/ioctl.c
@@ -179,9 +179,7 @@ bool torture_raw_ioctl(struct torture_context *torture,
{
bool ret = true;
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(torture, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
ret &= test_ioctl(cli, torture);
ret &= test_fsctl(cli, torture);
diff --git a/source4/torture/raw/lock.c b/source4/torture/raw/lock.c
index e90b8346aa..0092a94c12 100644
--- a/source4/torture/raw/lock.c
+++ b/source4/torture/raw/lock.c
@@ -103,9 +103,7 @@ static bool test_lock(struct torture_context *tctx, struct smbcli_state *cli)
if (!TARGET_SUPPORTS_SMBLOCK(tctx))
torture_skip(tctx, "Target does not support the SMBlock PDU");
- 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 RAW_LOCK_LOCK\n");
io.generic.level = RAW_LOCK_LOCK;
@@ -237,9 +235,7 @@ static bool test_lockx(struct torture_context *tctx, struct smbcli_state *cli)
int fnum;
const char *fname = BASEDIR "\\test.txt";
- 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 RAW_LOCK_LOCKX\n");
io.generic.level = RAW_LOCK_LOCKX;
@@ -419,9 +415,7 @@ static bool test_pidhigh(struct torture_context *tctx,
const char *fname = BASEDIR "\\test.txt";
uint8_t c = 1;
- 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 high pid\n");
io.generic.level = RAW_LOCK_LOCKX;
@@ -510,9 +504,7 @@ static bool test_async(struct torture_context *tctx,
struct smbcli_request *req, *req2;
struct smbcli_session_options options;
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
lpcfg_smbcli_session_options(tctx->lp_ctx, &options);
@@ -999,9 +991,7 @@ static bool test_errorcode(struct torture_context *tctx,
int delay;
uint16_t deny_mode = 0;
- 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 LOCK_NOT_GRANTED vs. FILE_LOCK_CONFLICT\n");
@@ -1486,9 +1476,7 @@ static bool test_changetype(struct torture_context *tctx,
uint8_t c = 0;
const char *fname = BASEDIR "\\test.txt";
- 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 LOCKING_ANDX_CHANGE_LOCKTYPE\n");
io.generic.level = RAW_LOCK_LOCKX;
@@ -1587,9 +1575,7 @@ static bool test_zerobytelocks(struct torture_context *tctx, struct smbcli_state
torture_comment(tctx, "Testing zero length byte range locks:\n");
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
io.generic.level = RAW_LOCK_LOCKX;
@@ -1679,9 +1665,7 @@ static bool test_unlock(struct torture_context *tctx, struct smbcli_state *cli)
torture_comment(tctx, "Testing LOCKX unlock:\n");
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
fnum1 = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
torture_assert(tctx,(fnum1 != -1), talloc_asprintf(tctx,
@@ -1863,9 +1847,7 @@ static bool test_multiple_unlock(struct torture_context *tctx, struct smbcli_sta
torture_comment(tctx, "Testing LOCKX multiple unlock:\n");
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
fnum1 = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE);
torture_assert(tctx,(fnum1 != -1), talloc_asprintf(tctx,
@@ -2043,9 +2025,7 @@ static bool test_stacking(struct torture_context *tctx, struct smbcli_state *cli
torture_comment(tctx, "Testing stacking:\n");
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
io.generic.level = RAW_LOCK_LOCKX;
@@ -2129,9 +2109,7 @@ static bool test_zerobyteread(struct torture_context *tctx,
struct smb_lock_entry lock1;
uint8_t c = 1;
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
io.generic.level = RAW_LOCK_LOCKX;
diff --git a/source4/torture/raw/mkdir.c b/source4/torture/raw/mkdir.c
index 40952e0d99..477501644a 100644
--- a/source4/torture/raw/mkdir.c
+++ b/source4/torture/raw/mkdir.c
@@ -44,9 +44,7 @@ static bool test_mkdir(struct smbcli_state *cli, struct torture_context *tctx)
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);
/*
basic mkdir
diff --git a/source4/torture/raw/mux.c b/source4/torture/raw/mux.c
index 1b11c29573..c82a6c3636 100644
--- a/source4/torture/raw/mux.c
+++ b/source4/torture/raw/mux.c
@@ -347,9 +347,7 @@ bool torture_raw_mux(struct torture_context *torture, struct smbcli_state *cli)
{
bool ret = true;
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(torture, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
ret &= test_mux_open(cli, torture);
ret &= test_mux_write(cli, torture);
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;
diff --git a/source4/torture/raw/oplock.c b/source4/torture/raw/oplock.c
index 7b67c528a7..7eb88a4abe 100644
--- a/source4/torture/raw/oplock.c
+++ b/source4/torture/raw/oplock.c
@@ -3493,9 +3493,7 @@ static bool test_raw_oplock_doc(struct torture_context *tctx,
union smb_open io;
uint16_t fnum=0;
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
/* cleanup */
smbcli_unlink(cli->tree, fname);
@@ -4138,9 +4136,7 @@ bool torture_hold_oplock(struct torture_context *torture,
printf("Setting up open files with oplocks in %s\n", BASEDIR);
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(torture, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
smbcli_oplock_handler(cli->transport, oplock_handler_hold, cli->tree);
diff --git a/source4/torture/raw/read.c b/source4/torture/raw/read.c
index 9bb626f3cd..6586177e3e 100644
--- a/source4/torture/raw/read.c
+++ b/source4/torture/raw/read.c
@@ -100,9 +100,7 @@ static bool test_read(struct torture_context *tctx, struct smbcli_state *cli)
return true;
}
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
printf("Testing RAW_READ_READ\n");
io.generic.level = RAW_READ_READ;
@@ -232,9 +230,7 @@ static bool test_lockread(struct torture_context *tctx,
buf = talloc_zero_array(tctx, uint8_t, maxsize);
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
printf("Testing RAW_READ_LOCKREAD\n");
io.generic.level = RAW_READ_LOCKREAD;
@@ -377,9 +373,7 @@ static bool test_readx(struct torture_context *tctx, struct smbcli_state *cli)
buf = talloc_zero_array(tctx, uint8_t, maxsize);
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
printf("Testing RAW_READ_READX\n");
@@ -665,9 +659,7 @@ static bool test_readbraw(struct torture_context *tctx,
buf = talloc_zero_array(tctx, uint8_t, maxsize);
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
printf("Testing RAW_READ_READBRAW\n");
@@ -839,9 +831,7 @@ static bool test_read_for_execute(struct torture_context *tctx,
buf = talloc_zero_array(tctx, uint8_t, maxsize);
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
printf("Testing RAW_READ_READX with read_for_execute\n");
diff --git a/source4/torture/raw/rename.c b/source4/torture/raw/rename.c
index b9f2039ff2..63e13c0546 100644
--- a/source4/torture/raw/rename.c
+++ b/source4/torture/raw/rename.c
@@ -59,9 +59,7 @@ static bool test_mv(struct torture_context *tctx,
torture_comment(tctx, "Testing SMBmv\n");
- 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, "Trying simple rename\n");
@@ -203,9 +201,7 @@ static bool test_osxrename(struct torture_context *tctx,
union smb_open op;
torture_comment(tctx, "\nTesting OSX Rename\n");
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
op.generic.level = RAW_OPEN_NTCREATEX;
op.ntcreatex.in.root_fid.fnum = 0;
op.ntcreatex.in.flags = 0;
@@ -288,9 +284,7 @@ static bool test_ntrename(struct torture_context *tctx,
torture_comment(tctx, "Testing SMBntrename\n");
- 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, "Trying simple rename\n");
@@ -557,9 +551,7 @@ static bool test_dir_rename(struct torture_context *tctx, struct smbcli_state *c
torture_comment(tctx, "Checking rename on a directory containing an open file.\n");
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
/* create a directory */
smbcli_rmdir(cli->tree, dname1);
diff --git a/source4/torture/raw/search.c b/source4/torture/raw/search.c
index e93d2a10f7..0736c41d0c 100644
--- a/source4/torture/raw/search.c
+++ b/source4/torture/raw/search.c
@@ -730,9 +730,7 @@ static bool test_many_files(struct torture_context *tctx,
{"ID_BOTH_DIRECTORY_INFO", "KEY", RAW_SEARCH_DATA_ID_BOTH_DIRECTORY_INFO, CONT_RESUME_KEY}
};
- 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 with %d files\n", num_files);
@@ -850,9 +848,7 @@ static bool test_modify_search(struct torture_context *tctx,
union smb_search_next io2;
union smb_setfileinfo sfinfo;
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
printf("Creating %d files\n", num_files);
@@ -969,9 +965,7 @@ static bool test_sorted(struct torture_context *tctx, struct smbcli_state *cli)
NTSTATUS status;
struct multiple_result result;
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
printf("Creating %d files\n", num_files);
@@ -1038,9 +1032,7 @@ static bool test_many_dirs(struct torture_context *tctx,
"doesn't support old style search calls\n");
return true;
}
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
printf("Creating %d dirs\n", num_dirs);
@@ -1214,9 +1206,7 @@ static bool test_os2_delete(struct torture_context *tctx,
return true;
}
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
printf("Testing OS/2 style delete on %d files\n", num_files);
@@ -1323,9 +1313,7 @@ static bool test_ea_list(struct torture_context *tctx,
struct multiple_result result;
union smb_setfileinfo setfile;
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
printf("Testing RAW_SEARCH_EA_LIST level\n");
@@ -1446,9 +1434,7 @@ static bool test_max_count(struct torture_context *tctx,
union smb_search_first io;
union smb_search_next io2;
- 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, "Creating %d files\n", num_files);
diff --git a/source4/torture/raw/setfileinfo.c b/source4/torture/raw/setfileinfo.c
index 45414cbf94..95ce060177 100644
--- a/source4/torture/raw/setfileinfo.c
+++ b/source4/torture/raw/setfileinfo.c
@@ -52,9 +52,7 @@ torture_raw_sfileinfo_base(struct torture_context *torture, struct smbcli_state
asprintf(&fnum_fname, BASEDIR "\\fnum_test_%d.txt", n);
asprintf(&fnum_fname_new, BASEDIR "\\fnum_test_new_%d.txt", n);
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(torture, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
#define RECREATE_FILE(fname) do { \
if (fnum != -1) smbcli_close(cli->tree, fnum); \
@@ -491,9 +489,7 @@ torture_raw_sfileinfo_rename(struct torture_context *torture,
asprintf(&path_dname, BASEDIR "\\dname_test_%d", n);
asprintf(&path_dname_new, BASEDIR "\\dname_test_new_%d", n);
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(torture, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
RECREATE_BOTH;
@@ -1003,9 +999,7 @@ torture_raw_sfileinfo_archive(struct torture_context *tctx,
union smb_fileinfo finfo;
uint16_t fnum=0;
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
/* cleanup */
smbcli_unlink(cli->tree, fname);
diff --git a/source4/torture/raw/streams.c b/source4/torture/raw/streams.c
index ae3bc2a713..2aace2bd35 100644
--- a/source4/torture/raw/streams.c
+++ b/source4/torture/raw/streams.c
@@ -198,9 +198,7 @@ static bool test_stream_dir(struct torture_context *tctx,
bool ret = true;
const char *basedir_data;
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
basedir_data = talloc_asprintf(tctx, "%s::$DATA", BASEDIR);
sname1 = talloc_asprintf(tctx, "%s:%s", fname, "Stream One");
@@ -279,9 +277,7 @@ static bool test_stream_io(struct torture_context *tctx,
const char *three[] = { "::$DATA", ":Stream One:$DATA",
":Second Stream:$DATA" };
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
sname1 = talloc_asprintf(tctx, "%s:%s", fname, "Stream One");
sname2 = talloc_asprintf(tctx, "%s:%s:$DaTa", fname, "Second Stream");
@@ -416,9 +412,7 @@ static bool test_stream_sharemodes(struct torture_context *tctx,
int fnum1 = -1;
int fnum2 = -1;
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
sname1 = talloc_asprintf(tctx, "%s:%s", fname, "Stream One");
sname2 = talloc_asprintf(tctx, "%s:%s:$DaTa", fname, "Second Stream");
@@ -511,9 +505,7 @@ static bool test_stream_delete(struct torture_context *tctx,
ssize_t retsize;
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);
sname1 = talloc_asprintf(tctx, "%s:%s", fname, "Stream One");
@@ -687,9 +679,7 @@ static bool test_stream_names(struct torture_context *tctx,
":?Stream*:$DATA"
};
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
sname1 = talloc_asprintf(tctx, "%s:%s", fname, "\x05Stream\n One");
sname1b = talloc_asprintf(tctx, "%s:", sname1);
@@ -996,9 +986,7 @@ static bool test_stream_names2(struct torture_context *tctx,
int fnum1 = -1;
uint8_t i;
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
printf("(%s) testing stream names\n", __location__);
io.generic.level = RAW_OPEN_NTCREATEX;
@@ -1091,9 +1079,7 @@ static bool test_stream_rename(struct torture_context *tctx,
bool check_fnum;
const char *call_name;
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
sname1 = talloc_asprintf(tctx, "%s:%s", fname, "Stream One");
sname2 = talloc_asprintf(tctx, "%s:%s:$DaTa", fname, "Second Stream");
@@ -1172,9 +1158,7 @@ static bool test_stream_rename2(struct torture_context *tctx,
union smb_setfileinfo sinfo;
union smb_rename rio;
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
sname1 = talloc_asprintf(tctx, "%s:%s", fname1, "Stream One");
sname2 = talloc_asprintf(tctx, "%s:%s", fname1, "Stream Two");
@@ -1371,9 +1355,7 @@ static bool test_stream_rename3(struct torture_context *tctx,
bool check_fnum;
const char *call_name;
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
sname1 = talloc_asprintf(tctx, "%s:%s", fname, "MStream Two:$DATA");
sname2 = talloc_asprintf(tctx, "%s:%s:$DaTa", fname, "Second Stream");
@@ -1489,9 +1471,7 @@ static bool test_stream_create_disposition(struct torture_context *tctx,
bool ret = false;
int fnum = -1;
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
fname_stream = talloc_asprintf(tctx, "%s:%s", fname, stream);
@@ -1643,9 +1623,7 @@ static bool test_stream_large_streaminfo(struct torture_context *tctx,
int i;
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);
lstream_name = talloc_array(tctx, char, LONG_STREAM_SIZE);
@@ -1692,9 +1670,7 @@ static bool test_stream_attributes(struct torture_context *tctx,
union smb_setfileinfo sfinfo;
time_t basetime = (time(NULL) - 86400) & ~1;
- 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, "(%s) testing attribute setting on stream\n", __location__);
@@ -1815,9 +1791,7 @@ static bool test_stream_summary_tab(struct torture_context *tctx,
union smb_rename rio;
ssize_t retsize;
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
fname_stream = talloc_asprintf(tctx, "%s%s", fname, stream);
fname_tmp_stream = talloc_asprintf(tctx, "%s%s", fname,
diff --git a/source4/torture/raw/unlink.c b/source4/torture/raw/unlink.c
index ee8f7c8ba3..4ca5406793 100644
--- a/source4/torture/raw/unlink.c
+++ b/source4/torture/raw/unlink.c
@@ -46,9 +46,7 @@ static bool test_unlink(struct torture_context *tctx, struct smbcli_state *cli)
bool ret = true;
const char *fname = BASEDIR "\\test.txt";
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
printf("Trying non-existant file\n");
io.unlink.in.pattern = fname;
@@ -215,9 +213,7 @@ static bool test_delete_on_close(struct torture_context *tctx,
const char *inside = BASEDIR "\\test.dir\\test.txt";
union smb_setfileinfo sfinfo;
- if (!torture_setup_dir(cli, BASEDIR)) {
- return false;
- }
+ torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
dio.in.path = dname;