torture_suite_add_suite(suite, torture_raw_streams(suite));
torture_suite_add_suite(suite, torture_raw_acls(suite));
torture_suite_add_suite(suite, torture_raw_composite(suite));
- torture_suite_add_simple_test(suite, "samba3hide", torture_samba3_hide);
- torture_suite_add_simple_test(suite, "samba3closeerr", torture_samba3_closeerr);
- torture_suite_add_simple_test(suite, "samba3rootdirfid",
+ torture_suite_add_1smb_test(suite, "samba3hide", torture_samba3_hide);
+ torture_suite_add_1smb_test(suite, "samba3closeerr", torture_samba3_closeerr);
+ torture_suite_add_1smb_test(suite, "samba3rootdirfid",
torture_samba3_rootdirfid);
- torture_suite_add_simple_test(suite, "samba3checkfsp", torture_samba3_checkfsp);
- torture_suite_add_simple_test(suite, "samba3oplocklogoff", torture_samba3_oplock_logoff);
+ torture_suite_add_1smb_test(suite, "samba3checkfsp", torture_samba3_checkfsp);
+ torture_suite_add_1smb_test(suite, "samba3oplocklogoff", torture_samba3_oplock_logoff);
torture_suite_add_simple_test(suite, "samba3badpath", torture_samba3_badpath);
- torture_suite_add_simple_test(suite, "samba3caseinsensitive",
+ torture_suite_add_1smb_test(suite, "samba3caseinsensitive",
torture_samba3_caseinsensitive);
- torture_suite_add_simple_test(suite, "samba3posixtimedlock",
+ torture_suite_add_1smb_test(suite, "samba3posixtimedlock",
torture_samba3_posixtimedlock);
torture_suite_add_simple_test(suite, "scan-eamax", torture_max_eas);
return smb_raw_setpathinfo(tree, &sfinfo);
}
-bool torture_samba3_hide(struct torture_context *torture)
+bool torture_samba3_hide(struct torture_context *torture, struct smbcli_state *cli)
{
- struct smbcli_state *cli;
const char *fname = "test.txt";
int fnum;
NTSTATUS status;
struct smbcli_tree *hideunread;
struct smbcli_tree *hideunwrite;
- if (!torture_open_connection_share(
- torture, &cli, torture, torture_setting_string(torture, "host", NULL),
- torture_setting_string(torture, "share", NULL), torture->ev)) {
- torture_fail(torture, "torture_open_connection_share failed\n");
- }
-
status = smbcli_setup_unix(cli->tree);
if (!NT_STATUS_IS_OK(status)) {
torture_fail(torture,
* close. smb_close should return NT_STATUS_ACCESS_DENIED.
*/
-bool torture_samba3_closeerr(struct torture_context *tctx)
+bool torture_samba3_closeerr(struct torture_context *tctx, struct smbcli_state *cli)
{
- struct smbcli_state *cli = NULL;
bool result = false;
NTSTATUS status;
const char *dname = "closeerr.dir";
const char *fname = "closeerr.dir\\closerr.txt";
int fnum;
- if (!torture_open_connection(&cli, tctx, 0)) {
- goto fail;
- }
-
smbcli_deltree(cli->tree, dname);
torture_assert_ntstatus_ok(
result = true;
- fail:
- if (cli) {
- torture_close_connection(cli);
- }
return result;
}
} \
} 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;
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,
done:
smbcli_deltree(cli->tree, dirname);
- torture_close_connection(cli);
talloc_free(mem_ctx);
return ret;
*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";
return false;
}
- if (!torture_open_connection(&cli, torture, 0)) {
- goto done;
- }
-
smbcli_deltree(cli->tree, dirname);
status = smbcli_mkdir(cli->tree, dirname);
* 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";
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);
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);
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;
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);