/*****************************************************
connect to the servers
*******************************************************/
-static bool connect_servers(struct event_context *ev,
+static bool connect_servers(struct tevent_context *ev,
struct loadparm_context *lp_ctx)
{
int i, j;
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,
if (options.smb2) {
status = smb2_connect(NULL, servers[i].server_name,
+ lp_smb_ports(lp_ctx),
servers[i].share_name,
lp_resolve_context(lp_ctx),
servers[i].credentials,
&servers[i].smb2_tree[j],
- ev, &smb_options);
+ ev, &smb_options,
+ lp_socket_options(lp_ctx),
+ lp_gensec_settings(lp_ctx, lp_ctx)
+ );
} else {
status = smbcli_tree_full_connection(NULL,
&servers[i].smb_tree[j],
servers[i].server_name,
lp_smb_ports(lp_ctx),
servers[i].share_name, "A:",
+ lp_socket_options(lp_ctx),
servers[i].credentials,
lp_resolve_context(lp_ctx), ev,
- &smb_options);
+ &smb_options,
+ &smb_session_options,
+ lp_iconv_convenience(lp_ctx),
+ lp_gensec_settings(lp_ctx, lp_ctx));
}
if (!NT_STATUS_IS_OK(status)) {
printf("Failed to connect to \\\\%s\\%s - %s\n",
*/
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 */
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;
}
} \
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]); \
} while(0)
#define CHECK_BLOB_EQUAL(field) do { \
- if (memcmp(parm[0].field.data, parm[1].field.data, parm[0].field.length) != 0 && !ignore_pattern(#field)) { \
+ if (((parm[0].field.data == NULL && parm[1].field.data != NULL) || \
+ (parm[1].field.data == NULL && parm[0].field.data != NULL) || \
+ (memcmp(parm[0].field.data, parm[1].field.data, parm[0].field.length) != 0)) && !ignore_pattern(#field)) { \
current_op.mismatch = #field; \
printf("Mismatch in %s\n", #field); \
return false; \
case RAW_SFILEINFO_MODE_INFORMATION:
info->mode_information.in.mode = gen_bits_mask(0xFFFFFFFF);
break;
+ case RAW_SFILEINFO_FULL_EA_INFORMATION:
+ info->full_ea_information.in.eas = gen_ea_list();
+ break;
case RAW_SFILEINFO_GENERIC:
case RAW_SFILEINFO_SEC_DESC:
case RAW_SFILEINFO_UNIX_BASIC:
do {
i = gen_int_range(0, num_levels-1);
} while (ignore_pattern(levels[i].name));
-
+
+ ZERO_STRUCTP(info);
info->generic.level = levels[i].level;
switch (info->generic.level) {
case RAW_SFILEINFO_MODE_INFORMATION:
info->mode_information.in.mode = gen_bits_mask(0xFFFFFFFF);
break;
+ case RAW_SFILEINFO_FULL_EA_INFORMATION:
+ info->full_ea_information.in.eas = gen_ea_list();
+ break;
case RAW_SFILEINFO_GENERIC:
case RAW_SFILEINFO_SEC_DESC:
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;
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);
run the test with the current set of op_parms parameters
return the number of operations that completed successfully
*/
-static int run_test(struct event_context *ev, struct loadparm_context *lp_ctx)
+static int run_test(struct tevent_context *ev, struct loadparm_context *lp_ctx)
{
int op, i;
current_op.opnum = op;
current_op.name = gen_ops[which_op].name;
current_op.status = NT_STATUS_OK;
+ talloc_free(current_op.mem_ctx);
current_op.mem_ctx = talloc_named(NULL, 0, "%s", current_op.name);
ret = gen_ops[which_op].handler(instance);
- talloc_free(current_op.mem_ctx);
-
gen_ops[which_op].count++;
if (NT_STATUS_IS_OK(current_op.status)) {
gen_ops[which_op].success_count++;
perform a backtracking analysis of the minimal set of operations
to generate an error
*/
-static void backtrack_analyze(struct event_context *ev,
+static void backtrack_analyze(struct tevent_context *ev,
struct loadparm_context *lp_ctx)
{
int chunk, ret;
/*
start the main gentest process
*/
-static bool start_gentest(struct event_context *ev,
+static bool start_gentest(struct tevent_context *ev,
struct loadparm_context *lp_ctx)
{
int op;
/* generate the seeds - after this everything is deterministic */
if (options.use_preset_seeds) {
int numops;
- char **preset = file_lines_load(options.seeds_file, &numops, NULL);
+ char **preset = file_lines_load(options.seeds_file, &numops, 0, NULL);
if (!preset) {
printf("Failed to load %s - %s\n", options.seeds_file, strerror(errno));
exit(1);
int i, username_count=0;
bool ret;
char *ignore_file=NULL;
- struct event_context *ev;
+ struct tevent_context *ev;
struct loadparm_context *lp_ctx;
poptContext pc;
int argc_new;
}
if (ignore_file) {
- options.ignore_patterns = file_lines_load(ignore_file, NULL, NULL);
+ options.ignore_patterns = file_lines_load(ignore_file, NULL, 0, NULL);
}
argv_new = discard_const_p(char *, poptGetArgs(pc));
printf("seed=%u\n", options.seed);
- ev = event_context_init(talloc_autofree_context());
+ ev = s4_event_context_init(talloc_autofree_context());
gensec_init(lp_ctx);