[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-109-gec5c83c

Günther Deschner gd at samba.org
Mon Jun 29 10:44:28 GMT 2009


The branch, master has been updated
       via  ec5c83c0dba28516d5c92f57dd7c88c99b17d4ab (commit)
      from  595d07d0ab494e3749c71caf86887ad1cebda229 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit ec5c83c0dba28516d5c92f57dd7c88c99b17d4ab
Author: Günther Deschner <gd at samba.org>
Date:   Fri Jun 26 16:51:53 2009 +0200

    s4-smbtorture: add torture_suite_add_machine_workstation_rpc_iface_tcase.
    
    Unlike torture_suite_add_machine_bdc_rpc_iface_tcase() which joins as a BDC
    (ACB_SRVTRUST) this joins as a member workstation (ACB_WSTRUST).
    
    Guenther

-----------------------------------------------------------------------

Summary of changes:
 source4/torture/rpc/netlogon.c   |    2 +-
 source4/torture/rpc/remote_pac.c |    2 +-
 source4/torture/rpc/rpc.c        |   58 +++++++++++++++++++++++++++++++++++--
 source4/torture/rpc/rpc.h        |    7 ++++-
 source4/torture/rpc/samr.c       |    6 ++--
 5 files changed, 65 insertions(+), 10 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c
index 57bfcbf..2fd8b94 100644
--- a/source4/torture/rpc/netlogon.c
+++ b/source4/torture/rpc/netlogon.c
@@ -2337,7 +2337,7 @@ struct torture_suite *torture_rpc_netlogon(TALLOC_CTX *mem_ctx)
 	struct torture_rpc_tcase *tcase;
 	struct torture_test *test;
 
-	tcase = torture_suite_add_machine_rpc_iface_tcase(suite, "netlogon", 
+	tcase = torture_suite_add_machine_bdc_rpc_iface_tcase(suite, "netlogon",
 						  &ndr_table_netlogon, TEST_MACHINE_NAME);
 
 	torture_rpc_tcase_add_test(tcase, "LogonUasLogon", test_LogonUasLogon);
diff --git a/source4/torture/rpc/remote_pac.c b/source4/torture/rpc/remote_pac.c
index 6d638d1..cae98d9 100644
--- a/source4/torture/rpc/remote_pac.c
+++ b/source4/torture/rpc/remote_pac.c
@@ -330,7 +330,7 @@ struct torture_suite *torture_rpc_remote_pac(TALLOC_CTX *mem_ctx)
 	struct torture_suite *suite = torture_suite_create(mem_ctx, "PAC");
 	struct torture_rpc_tcase *tcase;
 
-	tcase = torture_suite_add_machine_rpc_iface_tcase(suite, "netlogon", 
+	tcase = torture_suite_add_machine_bdc_rpc_iface_tcase(suite, "netlogon",
 						  &ndr_table_netlogon, TEST_MACHINE_NAME);
 	torture_rpc_tcase_add_test_creds(tcase, "verify", test_PACVerify);
 
diff --git a/source4/torture/rpc/rpc.c b/source4/torture/rpc/rpc.c
index 19b223b..d7aafef 100644
--- a/source4/torture/rpc/rpc.c
+++ b/source4/torture/rpc/rpc.c
@@ -124,8 +124,40 @@ NTSTATUS torture_rpc_connection_transport(struct torture_context *tctx,
         return status;
 }
 
-static bool torture_rpc_setup_machine(struct torture_context *tctx,
-				      void **data)
+static bool torture_rpc_setup_machine_workstation(struct torture_context *tctx,
+						  void **data)
+{
+	NTSTATUS status;
+	struct dcerpc_binding *binding;
+	struct torture_rpc_tcase *tcase = talloc_get_type(tctx->active_tcase,
+						struct torture_rpc_tcase);
+	struct torture_rpc_tcase_data *tcase_data;
+
+	status = torture_rpc_binding(tctx, &binding);
+	if (NT_STATUS_IS_ERR(status))
+		return false;
+
+	*data = tcase_data = talloc_zero(tctx, struct torture_rpc_tcase_data);
+	tcase_data->credentials = cmdline_credentials;
+	tcase_data->join_ctx = torture_join_domain(tctx, tcase->machine_name,
+						   ACB_WSTRUST,
+						   &tcase_data->credentials);
+	if (tcase_data->join_ctx == NULL)
+	    torture_fail(tctx, "Failed to join as WORKSTATION");
+
+	status = dcerpc_pipe_connect_b(tctx,
+				&(tcase_data->pipe),
+				binding,
+				tcase->table,
+				tcase_data->credentials, tctx->ev, tctx->lp_ctx);
+
+	torture_assert_ntstatus_ok(tctx, status, "Error connecting to server");
+
+	return true;
+}
+
+static bool torture_rpc_setup_machine_bdc(struct torture_context *tctx,
+					  void **data)
 {
 	NTSTATUS status;
 	struct dcerpc_binding *binding;
@@ -156,7 +188,25 @@ static bool torture_rpc_setup_machine(struct torture_context *tctx,
 	return true;
 }
 
-_PUBLIC_ struct torture_rpc_tcase *torture_suite_add_machine_rpc_iface_tcase(
+_PUBLIC_ struct torture_rpc_tcase *torture_suite_add_machine_workstation_rpc_iface_tcase(
+				struct torture_suite *suite,
+				const char *name,
+				const struct ndr_interface_table *table,
+				const char *machine_name)
+{
+	struct torture_rpc_tcase *tcase = talloc(suite,
+						 struct torture_rpc_tcase);
+
+	torture_suite_init_rpc_tcase(suite, tcase, name, table);
+
+	tcase->machine_name = talloc_strdup(tcase, machine_name);
+	tcase->tcase.setup = torture_rpc_setup_machine_workstation;
+	tcase->tcase.teardown = torture_rpc_teardown;
+
+	return tcase;
+}
+
+_PUBLIC_ struct torture_rpc_tcase *torture_suite_add_machine_bdc_rpc_iface_tcase(
 				struct torture_suite *suite, 
 				const char *name,
 				const struct ndr_interface_table *table,
@@ -168,7 +218,7 @@ _PUBLIC_ struct torture_rpc_tcase *torture_suite_add_machine_rpc_iface_tcase(
 	torture_suite_init_rpc_tcase(suite, tcase, name, table);
 
 	tcase->machine_name = talloc_strdup(tcase, machine_name);
-	tcase->tcase.setup = torture_rpc_setup_machine;
+	tcase->tcase.setup = torture_rpc_setup_machine_bdc;
 	tcase->tcase.teardown = torture_rpc_teardown;
 
 	return tcase;
diff --git a/source4/torture/rpc/rpc.h b/source4/torture/rpc/rpc.h
index 9fd64f1..ddb737c 100644
--- a/source4/torture/rpc/rpc.h
+++ b/source4/torture/rpc/rpc.h
@@ -69,7 +69,12 @@ struct torture_test *torture_rpc_tcase_add_test_ex(
 					bool (*fn) (struct torture_context *, struct dcerpc_pipe *,
 								void *),
 					void *userdata);
-struct torture_rpc_tcase *torture_suite_add_machine_rpc_iface_tcase(
+struct torture_rpc_tcase *torture_suite_add_machine_bdc_rpc_iface_tcase(
+				struct torture_suite *suite,
+				const char *name,
+				const struct ndr_interface_table *table,
+				const char *machine_name);
+struct torture_rpc_tcase *torture_suite_add_machine_workstation_rpc_iface_tcase(
 				struct torture_suite *suite, 
 				const char *name,
 				const struct ndr_interface_table *table,
diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c
index e3d1245..be2bfef 100644
--- a/source4/torture/rpc/samr.c
+++ b/source4/torture/rpc/samr.c
@@ -6867,7 +6867,7 @@ struct torture_suite *torture_rpc_samr_passwords_pwdlastset(TALLOC_CTX *mem_ctx)
 	struct torture_suite *suite = torture_suite_create(mem_ctx, "SAMR-PASSWORDS-PWDLASTSET");
 	struct torture_rpc_tcase *tcase;
 
-	tcase = torture_suite_add_machine_rpc_iface_tcase(suite, "samr",
+	tcase = torture_suite_add_machine_bdc_rpc_iface_tcase(suite, "samr",
 							  &ndr_table_samr,
 							  TEST_ACCOUNT_NAME_PWD);
 
@@ -6907,7 +6907,7 @@ struct torture_suite *torture_rpc_samr_user_privileges(TALLOC_CTX *mem_ctx)
 	struct torture_suite *suite = torture_suite_create(mem_ctx, "SAMR-USERS-PRIVILEGES");
 	struct torture_rpc_tcase *tcase;
 
-	tcase = torture_suite_add_machine_rpc_iface_tcase(suite, "samr",
+	tcase = torture_suite_add_machine_bdc_rpc_iface_tcase(suite, "samr",
 							  &ndr_table_samr,
 							  TEST_ACCOUNT_NAME_PWD);
 
@@ -6997,7 +6997,7 @@ struct torture_suite *torture_rpc_samr_large_dc(TALLOC_CTX *mem_ctx)
 	struct torture_suite *suite = torture_suite_create(mem_ctx, "SAMR-LARGE-DC");
 	struct torture_rpc_tcase *tcase;
 
-	tcase = torture_suite_add_machine_rpc_iface_tcase(suite, "samr",
+	tcase = torture_suite_add_machine_bdc_rpc_iface_tcase(suite, "samr",
 							  &ndr_table_samr,
 							  TEST_ACCOUNT_NAME);
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list