#include "libcli/raw/libcliraw.h"
#include "system/time.h"
#include "system/wait.h"
+#include "system/filesys.h"
#include "ioctl.h"
#include "librpc/gen_ndr/ndr_security.h"
const char *sharename)
{
NTSTATUS status;
- const char *username = lp_parm_string(-1, "torture", "username");
- const char *userdomain = lp_parm_string(-1, "torture", "userdomain");
- const char *password = lp_parm_string(-1, "torture", "password");
+ const char *username = cli_credentials_get_username(cmdline_credentials);
+ const char *userdomain = cli_credentials_get_domain(cmdline_credentials);
+ const char *password = cli_credentials_get_password(cmdline_credentials);
status = smbcli_full_connection(NULL,
c, lp_netbios_name(),
return ret;
}
-/* initialise a DCOM context */
-NTSTATUS torture_dcom_init(struct dcom_context **ctx)
-{
- dcom_init(ctx, lp_parm_string(-1, "torture", "userdomain"),
- lp_parm_string(-1, "torture", "username"),
- lp_parm_string(-1, "torture", "password"));
-
- return NT_STATUS_OK;
-}
-
/* open a rpc connection to the chosen binding string */
NTSTATUS torture_rpc_connection(struct dcerpc_pipe **p,
const char *pipe_name,
}
status = dcerpc_pipe_connect(p, binding, pipe_uuid, pipe_version,
- lp_parm_string(-1, "torture", "userdomain"),
- lp_parm_string(-1, "torture", "username"),
- lp_parm_string(-1, "torture", "password"));
+ cmdline_credentials);
return status;
}
{
NTSTATUS status;
const char *binding = lp_parm_string(-1, "torture", "binding");
- struct dcerpc_binding b;
+ struct dcerpc_binding *b;
TALLOC_CTX *mem_ctx = talloc_init("torture_rpc_connection_smb");
if (!binding) {
status = dcerpc_parse_binding(mem_ctx, binding, &b);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("Failed to parse dcerpc binding '%s'\n", binding));
- talloc_destroy(mem_ctx);
+ talloc_free(mem_ctx);
return status;
}
- b.transport = transport;
+ b->transport = transport;
- status = dcerpc_pipe_connect_b(p, &b, pipe_uuid, pipe_version,
- lp_parm_string(-1, "torture", "userdomain"),
- lp_parm_string(-1, "torture", "username"),
- lp_parm_string(-1, "torture", "password"));
+ status = dcerpc_pipe_connect_b(p, b, pipe_uuid, pipe_version,
+ cmdline_credentials);
+
return status;
}
for (i=0;i<torture_numops;i++) {
- uint_t n = (uint_t)sys_random()%10;
+ uint_t n = (uint_t)random()%10;
if (i % 10 == 0) {
printf("%d\r", i); fflush(stdout);
}
for (i = 0; i < sizeof(buf); i += sizeof(uint32_t))
{
- SIVAL(buf, i, sys_random());
+ SIVAL(buf, i, random());
}
if (procnum == 0)
if (procnum == 0)
{
- sent = ((uint_t)sys_random()%(20))+ 1;
+ sent = ((uint_t)random()%(20))+ 1;
if (sent > sizeof(buf) - count)
{
sent = sizeof(buf) - count;
for (i=0;i<torture_numops;i++)
{
- size_t buf_size = ((uint_t)sys_random()%(sizeof(buf)-1))+ 1;
+ size_t buf_size = ((uint_t)random()%(sizeof(buf)-1))+ 1;
if (i % 10 == 0) {
printf("%d\r", i); fflush(stdout);
}
return correct;
}
+#define BOOLSTR(b) ((b) ? "Yes" : "No")
+
static BOOL run_readwritetest(void)
{
struct smbcli_state *cli1, *cli2;
BOOL ret = True;
const char *host = lp_parm_string(-1, "torture", "host");
const char *share = lp_parm_string(-1, "torture", "share");
- const char *username = lp_parm_string(-1, "torture", "username");
- const char *userdomain = lp_parm_string(-1, "torture", "userdomain");
- const char *password = lp_parm_string(-1, "torture", "password");
+ const char *username = cli_credentials_get_username(cmdline_credentials);
+ const char *userdomain = cli_credentials_get_domain(cmdline_credentials);
+ const char *password = cli_credentials_get_password(cmdline_credentials);
status = smbcli_full_connection(NULL,
&cli1, lp_netbios_name(),
const char *hostname=NULL, *sharename;
pid_t mypid = getpid();
- sys_srandom(((int)mypid) ^ ((int)time(NULL)));
+ srandom(((int)mypid) ^ ((int)time(NULL)));
asprintf(&myname, "CLIENT%d", i);
lp_set_cmdline("netbios name", myname);
{"BENCH-HOLDCON", torture_holdcon, 0},
{"BENCH-NBENCH", torture_nbench, 0},
{"BENCH-TORTURE", NULL, run_torture},
+ {"BENCH-NBT", torture_bench_nbt, 0},
+ {"BENCH-WINS", torture_bench_wins, 0},
/* RAW smb tests */
{"RAW-QFSINFO", torture_raw_qfsinfo, 0},
{"SCAN-CASETABLE", torture_casetable, 0},
{"SCAN-PIPE_NUMBER", run_pipe_number, 0},
{"SCAN-IOCTL", torture_ioctl_test, 0},
+ {"SCAN-RAP", torture_rap_scan, 0},
/* rpc testers */
{"RPC-LSA", torture_rpc_lsa, 0},
{"RPC-EVENTLOG", torture_rpc_eventlog, 0},
{"RPC-EPMAPPER", torture_rpc_epmapper, 0},
{"RPC-WINREG", torture_rpc_winreg, 0},
+ {"RPC-INITSHUTDOWN", torture_rpc_initshutdown, 0},
{"RPC-OXIDRESOLVE", torture_rpc_oxidresolve, 0},
{"RPC-REMACT", torture_rpc_remact, 0},
{"RPC-MGMT", torture_rpc_mgmt, 0},
{"RPC-DSSETUP", torture_rpc_dssetup, 0},
{"RPC-ALTERCONTEXT", torture_rpc_alter_context, 0},
- /* Distributed COM testers */
- {"DCOM-SIMPLE", torture_dcom_simple, 0},
-
/* local (no server) testers */
{"LOCAL-NTLMSSP", torture_ntlmssp_self_check, 0},
{"LOCAL-ICONV", torture_local_iconv, 0},
{"LOCAL-IDTREE", torture_local_idtree, 0},
{"LOCAL-SOCKET", torture_local_socket, 0},
+ /* COM (Component Object Model) testers */
+ {"COM-SIMPLE", torture_com_simple, 0 },
+
/* ldap testers */
{"LDAP-BASIC", torture_ldap_basic, 0},
+ /* nbt tests */
+ {"NBT-REGISTER", torture_nbt_register, 0},
+ {"NBT-WINS", torture_nbt_wins, 0},
+ {"NBT-WINSREPLICATION", torture_nbt_winsreplication, 0},
+
+ /* libnet tests */
+ {"NET-USERINFO", torture_userinfo, 0},
+
{NULL, NULL, 0}};
static BOOL is_binding_string(const char *binding_string)
{
TALLOC_CTX *mem_ctx = talloc_init("is_binding_string");
- struct dcerpc_binding binding_struct;
+ struct dcerpc_binding *binding_struct;
NTSTATUS status;
status = dcerpc_parse_binding(mem_ctx, binding_string, &binding_struct);
- talloc_destroy(mem_ctx);
+ talloc_free(mem_ctx);
return NT_STATUS_IS_OK(status);
}
lp_set_cmdline("torture:binding", binding);
}
- if (!lp_parm_string(-1,"torture","username")) {
- lp_set_cmdline("torture:username", cmdline_get_username());
- }
- if (!lp_parm_string(-1,"torture","userdomain")) {
- /*
- * backward compatibility
- * maybe we should remove this to make this consistent
- * for all cmdline tools
- * --metze
- */
- if (strequal(lp_netbios_name(),cmdline_get_userdomain())) {
- cmdline_set_userdomain(lp_workgroup());
- }
- lp_set_cmdline("torture:userdomain", cmdline_get_userdomain());
- }
- if (!lp_parm_string(-1,"torture","password")) {
- lp_set_cmdline("torture:password", cmdline_get_userpassword());
- }
-
if (argc_new == 0) {
printf("You must specify a test to run, or 'ALL'\n");
} else {