summaryrefslogtreecommitdiff
path: root/source4/torture/gentest.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/torture/gentest.c')
-rw-r--r--source4/torture/gentest.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/source4/torture/gentest.c b/source4/torture/gentest.c
index 176fc035e7..3bf3ad8b1b 100644
--- a/source4/torture/gentest.c
+++ b/source4/torture/gentest.c
@@ -214,7 +214,9 @@ static bool connect_servers(struct event_context *ev,
for (j=0;j<NINSTANCES;j++) {
NTSTATUS status;
struct smbcli_options smb_options;
+ struct smbcli_session_options smb_session_options;
lp_smbcli_options(lp_ctx, &smb_options);
+ lp_smbcli_session_options(lp_ctx, &smb_session_options);
printf("Connecting to \\\\%s\\%s as %s - instance %d\n",
servers[i].server_name, servers[i].share_name,
@@ -238,7 +240,8 @@ static bool connect_servers(struct event_context *ev,
servers[i].share_name, "A:",
servers[i].credentials,
lp_resolve_context(lp_ctx), ev,
- &smb_options);
+ &smb_options,
+ &smb_session_options);
}
if (!NT_STATUS_IS_OK(status)) {
printf("Failed to connect to \\\\%s\\%s - %s\n",
@@ -1165,6 +1168,8 @@ static void idle_func_smb2(struct smb2_transport *transport, void *private)
*/
static bool compare_status(NTSTATUS status1, NTSTATUS status2)
{
+ char *s;
+
if (NT_STATUS_EQUAL(status1, status2)) return true;
/* one code being an error and the other OK is always an error */
@@ -1178,6 +1183,17 @@ static bool compare_status(NTSTATUS status1, NTSTATUS status2)
ignore_pattern(nt_errstr(status2))) {
return true;
}
+
+ /* also support ignore patterns of the form NT_STATUS_XX:NT_STATUS_YY
+ meaning that the first server returns NT_STATUS_XX and the 2nd
+ returns NT_STATUS_YY */
+ s = talloc_asprintf(current_op.mem_ctx, "%s:%s",
+ nt_errstr(status1),
+ nt_errstr(status2));
+ if (ignore_pattern(s)) {
+ return true;
+ }
+
current_op.mismatch = nt_errstr(status1);
return false;
}
@@ -1348,7 +1364,7 @@ again:
} \
current_op.status = status[0]; \
for (i=1;i<NSERVERS;i++) { \
- if (!compare_status(status[i], status[0])) { \
+ if (!compare_status(status[0], status[1])) { \
printf("status different in %s - %s %s\n", #call, \
nt_errstr(status[0]), nt_errstr(status[i])); \
current_op.mismatch = nt_errstr(status[0]); \
@@ -2379,9 +2395,8 @@ static bool handler_smb_spathinfo(int instance)
union smb_setfileinfo parm[NSERVERS];
NTSTATUS status[NSERVERS];
- parm[0].generic.in.file.path = gen_fname_open(instance);
-
gen_setfileinfo(instance, &parm[0]);
+ parm[0].generic.in.file.path = gen_fname_open(instance);
GEN_COPY_PARM;
@@ -2750,9 +2765,8 @@ static bool handler_smb2_sfileinfo(int instance)
union smb_setfileinfo parm[NSERVERS];
NTSTATUS status[NSERVERS];
- parm[0].generic.in.file.fnum = gen_fnum(instance);
-
gen_setfileinfo(instance, &parm[0]);
+ parm[0].generic.in.file.fnum = gen_fnum(instance);
GEN_COPY_PARM;
GEN_SET_FNUM_SMB2(generic.in.file.handle);