summaryrefslogtreecommitdiff
path: root/source4/torture/raw/samba3misc.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-04-30 14:05:19 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-04-30 07:00:05 +0200
commit7e9ed052778d22e4d70bed444b226461dced01b6 (patch)
tree6eb7ef5e5e326d996749ae43b22d51d20503e9af /source4/torture/raw/samba3misc.c
parent773304ec8b52d718bd3ca9e1b2543a50d7f4843e (diff)
downloadsamba-7e9ed052778d22e4d70bed444b226461dced01b6.tar.gz
samba-7e9ed052778d22e4d70bed444b226461dced01b6.tar.bz2
samba-7e9ed052778d22e4d70bed444b226461dced01b6.zip
s4-torture: Move various samba3 tests to the torture_suite_add_1smb_test wrapper
Diffstat (limited to 'source4/torture/raw/samba3misc.c')
-rw-r--r--source4/torture/raw/samba3misc.c43
1 files changed, 5 insertions, 38 deletions
diff --git a/source4/torture/raw/samba3misc.c b/source4/torture/raw/samba3misc.c
index 07669ed28b..9a10272aec 100644
--- a/source4/torture/raw/samba3misc.c
+++ b/source4/torture/raw/samba3misc.c
@@ -37,9 +37,8 @@
} \
} while (0)
-bool torture_samba3_checkfsp(struct torture_context *torture)
+bool torture_samba3_checkfsp(struct torture_context *torture, struct smbcli_state *cli)
{
- struct smbcli_state *cli;
const char *fname = "test.txt";
const char *dirname = "testdir";
int fnum;
@@ -55,14 +54,6 @@ bool torture_samba3_checkfsp(struct torture_context *torture)
return false;
}
- if (!torture_open_connection_share(
- torture, &cli, torture, torture_setting_string(torture, "host", NULL),
- torture_setting_string(torture, "share", NULL), torture->ev)) {
- d_printf("torture_open_connection_share failed\n");
- ret = false;
- goto done;
- }
-
smbcli_deltree(cli->tree, dirname);
status = torture_second_tcon(torture, cli->session,
@@ -154,7 +145,6 @@ bool torture_samba3_checkfsp(struct torture_context *torture)
done:
smbcli_deltree(cli->tree, dirname);
- torture_close_connection(cli);
talloc_free(mem_ctx);
return ret;
@@ -611,9 +601,8 @@ static void count_fn(struct clilist_file_info *info, const char *name,
*counter += 1;
}
-bool torture_samba3_caseinsensitive(struct torture_context *torture)
+bool torture_samba3_caseinsensitive(struct torture_context *torture, struct smbcli_state *cli)
{
- struct smbcli_state *cli;
TALLOC_CTX *mem_ctx;
NTSTATUS status;
const char *dirname = "insensitive";
@@ -629,10 +618,6 @@ bool torture_samba3_caseinsensitive(struct torture_context *torture)
return false;
}
- if (!torture_open_connection(&cli, torture, 0)) {
- goto done;
- }
-
smbcli_deltree(cli->tree, dirname);
status = smbcli_mkdir(cli->tree, dirname);
@@ -710,9 +695,8 @@ static void receive_lock_result(struct smbcli_request *req)
* Note: To run this test, use "--option=torture:localdir=<LOCALDIR>"
*/
-bool torture_samba3_posixtimedlock(struct torture_context *tctx)
+bool torture_samba3_posixtimedlock(struct torture_context *tctx, struct smbcli_state *cli)
{
- struct smbcli_state *cli;
NTSTATUS status;
bool ret = true;
const char *dirname = "posixlock";
@@ -732,11 +716,6 @@ bool torture_samba3_posixtimedlock(struct torture_context *tctx)
struct tevent_timer *te;
- if (!torture_open_connection(&cli, tctx, 0)) {
- ret = false;
- goto done;
- }
-
smbcli_deltree(cli->tree, dirname);
status = smbcli_mkdir(cli->tree, dirname);
@@ -870,20 +849,14 @@ bool torture_samba3_posixtimedlock(struct torture_context *tctx)
return ret;
}
-bool torture_samba3_rootdirfid(struct torture_context *tctx)
+bool torture_samba3_rootdirfid(struct torture_context *tctx, struct smbcli_state *cli)
{
- struct smbcli_state *cli;
NTSTATUS status;
uint16_t dnum;
union smb_open io;
const char *fname = "testfile";
bool ret = false;
- if (!torture_open_connection(&cli, tctx, 0)) {
- ret = false;
- goto done;
- }
-
smbcli_unlink(cli->tree, fname);
ZERO_STRUCT(io);
@@ -942,9 +915,8 @@ bool torture_samba3_rootdirfid(struct torture_context *tctx)
return ret;
}
-bool torture_samba3_oplock_logoff(struct torture_context *tctx)
+bool torture_samba3_oplock_logoff(struct torture_context *tctx, struct smbcli_state *cli)
{
- struct smbcli_state *cli;
NTSTATUS status;
uint16_t fnum1;
union smb_open io;
@@ -953,11 +925,6 @@ bool torture_samba3_oplock_logoff(struct torture_context *tctx)
struct smbcli_request *req;
struct smb_echo echo_req;
- if (!torture_open_connection(&cli, tctx, 0)) {
- ret = false;
- goto done;
- }
-
smbcli_unlink(cli->tree, fname);
ZERO_STRUCT(io);