enumeration tests (files, sessions, shares, connections).
authorLuke Leighton <lkcl@samba.org>
Thu, 22 Oct 1998 22:54:00 +0000 (22:54 +0000)
committerLuke Leighton <lkcl@samba.org>
Thu, 22 Oct 1998 22:54:00 +0000 (22:54 +0000)
hey, you can see how many connections succeed while the rpctorture
command is running!
(This used to be commit c1bf8f109932a3387fa7b8b4265a3eda52d3e0a3)

source3/utils/rpctorture.c

index d1f0063a437f44cb05f9ede4a49cdcd8e489b7b5..118be4d598389d9986063bbf244e6b1adbeb15d2 100644 (file)
@@ -94,6 +94,36 @@ static void rpcclient_stop(void)
        cli_shutdown(smb_cli);
 }
 
+/****************************************************************************
+  log in as an nt user, log out again. 
+****************************************************************************/
+void run_enums_test(int num_ops, struct client_info *cli_info, struct cli_state *cli)
+{
+       int i;
+
+       /* establish connections.  nothing to stop these being re-established. */
+       rpcclient_connect(cli_info);
+
+       DEBUG(5,("rpcclient_connect: cli->fd:%d\n", cli->fd));
+       if (cli->fd <= 0)
+       {
+               fprintf(out_hnd, "warning: connection could not be established to %s<%02x>\n",
+                                cli_info->dest_host, cli_info->name_type);
+               return;
+       }
+       
+       for (i = 0; i < num_ops; i++)
+       {
+               cmd_srv_enum_sess(cli_info);
+               cmd_srv_enum_shares(cli_info);
+               cmd_srv_enum_files(cli_info);
+               cmd_srv_enum_conn(cli_info);
+       }
+
+       rpcclient_stop();
+
+}
+
 /****************************************************************************
   log in as an nt user, log out again. 
 ****************************************************************************/
@@ -509,6 +539,8 @@ enum client_action
                pwd_make_lm_nt_16(&(smb_cli->pwd), password); /* generate 16 byte hashes */
        }
 
+       create_procs(nprocs, numops, &cli_info, smb_cli, run_enums_test);
+
        if (password[0] != 0)
        {
                create_procs(nprocs, numops, &cli_info, smb_cli, run_ntlogin_test);