#include "system/time.h"
#include "system/wait.h"
#include "system/filesys.h"
-#include "ioctl.h"
+#include "libcli/raw/ioctl.h"
+#include "libcli/libcli.h"
+#include "lib/ldb/include/ldb.h"
+#include "librpc/rpc/dcerpc_table.h"
+#include "lib/events/events.h"
+#include "libcli/resolve/resolve.h"
+
+#include "torture/basic/proto.h"
+#include "torture/raw/proto.h"
+#include "torture/smb2/proto.h"
+#include "torture/rpc/proto.h"
+#include "torture/rap/proto.h"
+#include "torture/auth/proto.h"
+#include "torture/local/proto.h"
+#include "torture/nbench/proto.h"
+#include "torture/ldap/proto.h"
+#include "torture/com/proto.h"
+#include "torture/nbt/proto.h"
+#include "torture/libnet/proto.h"
+#include "torture/torture.h"
int torture_nprocs=4;
int torture_numops=10;
printf("Filling send buffer\n");
- for (i=0;i<1000;i++) {
+ for (i=0;i<100;i++) {
struct smbcli_request *req;
req = smb_raw_negotiate_send(cli->transport, PROTOCOL_NT1);
- smbcli_transport_process(cli->transport);
+ event_loop_once(cli->transport->socket->event.ctx);
if (req->state == SMBCLI_REQUEST_ERROR) {
- printf("Failed to fill pipe - %s\n", nt_errstr(req->status));
- torture_close_connection(cli);
- return correct;
+ if (i > 0) {
+ printf("Failed to fill pipe packet[%d] - %s (ignored)\n", i+1, nt_errstr(req->status));
+ break;
+ } else {
+ printf("Failed to fill pipe - %s \n", nt_errstr(req->status));
+ torture_close_connection(cli);
+ return False;
+ }
}
}
printf("Opening secondary connection\n");
if (!torture_open_connection(&cli2)) {
- return False;
- }
-
- if (!torture_close_connection(cli)) {
+ printf("Failed to open secondary connection\n");
correct = False;
}
if (!torture_close_connection(cli2)) {
+ printf("Failed to close secondary connection\n");
correct = False;
}
+ torture_close_connection(cli);
+
printf("finished negprot nowait test\n");
return correct;
}
parms.ioctl.level = RAW_IOCTL_IOCTL;
- parms.ioctl.in.fnum = fnum;
+ parms.ioctl.file.fnum = fnum;
parms.ioctl.in.request = IOCTL_QUERY_JOB_INFO;
status = smb_raw_ioctl(cli->tree, mem_ctx, &parms);
printf("ioctl job info: %s\n", smbcli_errstr(cli->tree));
/* rpc testers */
{"RPC-LSA", torture_rpc_lsa, 0},
+ {"RPC-LSALOOKUP", torture_rpc_lsa_lookup, 0},
{"RPC-SECRETS", torture_rpc_lsa_secrets, 0},
{"RPC-ECHO", torture_rpc_echo, 0},
{"RPC-DFS", torture_rpc_dfs, 0},
{"NBT-REGISTER", torture_nbt_register, 0},
{"NBT-WINS", torture_nbt_wins, 0},
{"NBT-DGRAM", torture_nbt_dgram, 0},
- {"NBT-WINSREPLICATION", torture_nbt_winsreplication, 0},
+ {"NBT-BROWSE", torture_nbt_browse, 0},
+ {"NBT-WINSREPLICATION-SIMPLE", torture_nbt_winsreplication_simple, 0},
+ {"NBT-WINSREPLICATION-REPLICA", torture_nbt_winsreplication_replica, 0},
+ {"NBT-WINSREPLICATION-OWNED", torture_nbt_winsreplication_owned, 0},
/* libnet tests */
{"NET-USERINFO", torture_userinfo, 0},
int argc_new;
char **argv_new;
poptContext pc;
- enum {OPT_LOADFILE=1000,OPT_UNCLIST,OPT_TIMELIMIT,OPT_DNS,OPT_DANGEROUS};
+ enum {OPT_LOADFILE=1000,OPT_UNCLIST,OPT_TIMELIMIT,OPT_DNS,
+ OPT_DANGEROUS,OPT_SMB_PORTS};
+
struct poptOption long_options[] = {
POPT_AUTOHELP
- {"smb-ports", 'p', POPT_ARG_STRING, NULL, 0, "SMB ports", NULL},
+ {"smb-ports", 'p', POPT_ARG_STRING, NULL, OPT_SMB_PORTS, "SMB ports", NULL},
{"seed", 0, POPT_ARG_INT, &torture_seed, 0, "seed", NULL},
{"num-progs", 0, POPT_ARG_INT, &torture_nprocs, 0, "num progs", NULL},
{"num-ops", 0, POPT_ARG_INT, &torture_numops, 0, "num ops", NULL},
setbuffer(stdout, NULL, 0);
#endif
+ /* we are never interested in SIGPIPE */
+ BlockSignals(True,SIGPIPE);
+
pc = poptGetContext("smbtorture", argc, (const char **) argv, long_options,
POPT_CONTEXT_KEEP_FIRST);
case OPT_DANGEROUS:
lp_set_cmdline("torture:dangerous", "Yes");
break;
+ case OPT_SMB_PORTS:
+ lp_set_cmdline("smb ports", poptGetOptArg(pc));
+ break;
default:
d_printf("Invalid option %s: %s\n",
poptBadOption(pc, 0), poptStrerror(opt));
alarm(max_runtime);
}
+ ldb_global_init();
+
dcerpc_init();
dcerpc_table_init();