[SCM] Samba Shared Repository - branch master updated

Kamen Mazdrashki kamenim at samba.org
Sun Sep 5 17:34:01 MDT 2010


The branch, master has been updated
       via  35aed17 s4-test: refactor API-DELETEUSER test a little to:
       via  dea5c7b s4-idl: redefine dreplsrv_refresh() to be alike other RPC function definitions
      from  cf616ec wafsamba: Create bin/defaukt/modules if it does not yet exist.

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


- Log -----------------------------------------------------------------
commit 35aed17b2651bc6dd9be415f8b8060357ee78ecb
Author: Kamen Mazdrashki <kamenim at samba.org>
Date:   Sun Sep 5 23:28:06 2010 +0300

    s4-test: refactor API-DELETEUSER test a little to:
    
     - fail torture_context in case libnet_DeleteUser() has failed
     - make use of torture_assert_* macros to track down where failur occured
     - use only one memory context internally

commit dea5c7b9486f7d4cbefd563a4e366c2fb3ccbf8f
Author: Kamen Mazdrashki <kamenim at samba.org>
Date:   Sun Sep 5 22:54:05 2010 +0300

    s4-idl: redefine dreplsrv_refresh() to be alike other RPC function definitions
    
    Sorry for the 'custom' definition first time

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

Summary of changes:
 source4/dsdb/repl/drepl_service.c    |    2 +-
 source4/librpc/idl/irpc.idl          |    4 +--
 source4/torture/libnet/libnet_user.c |   52 +++++++++++++++-------------------
 3 files changed, 25 insertions(+), 33 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/repl/drepl_service.c b/source4/dsdb/repl/drepl_service.c
index 252ec5f..5babbcb 100644
--- a/source4/dsdb/repl/drepl_service.c
+++ b/source4/dsdb/repl/drepl_service.c
@@ -244,7 +244,7 @@ static NTSTATUS dreplsrv_refresh(struct irpc_message *msg,
 	struct dreplsrv_service *s = talloc_get_type(msg->private_data,
 						     struct dreplsrv_service);
 
-	r->out.werr = dreplsrv_refresh_partitions(s);
+	r->out.result = dreplsrv_refresh_partitions(s);
 
 	return NT_STATUS_OK;
 }
diff --git a/source4/librpc/idl/irpc.idl b/source4/librpc/idl/irpc.idl
index 220cecf..35204db 100644
--- a/source4/librpc/idl/irpc.idl
+++ b/source4/librpc/idl/irpc.idl
@@ -156,7 +156,5 @@ import "misc.idl", "security.idl", "nbt.idl";
 	 * @param partition_dn Partition to refresh cacheh for.
 	 *                     If empy/NULL, refresh all partitions.
 	 */
-	void dreplsrv_refresh(
-		[out] WERROR werr
-		);
+	WERROR dreplsrv_refresh();
 }
diff --git a/source4/torture/libnet/libnet_user.c b/source4/torture/libnet/libnet_user.c
index c5af5ed..64f57d5 100644
--- a/source4/torture/libnet/libnet_user.c
+++ b/source4/torture/libnet/libnet_user.c
@@ -80,55 +80,49 @@ bool torture_deleteuser(struct torture_context *torture)
 {
 	NTSTATUS status;
 	struct dcerpc_pipe *p;
-	TALLOC_CTX *prep_mem_ctx, *mem_ctx;
+	TALLOC_CTX *mem_ctx;
 	struct policy_handle h;
 	struct lsa_String domain_name;
 	const char *name = TEST_USERNAME;
 	struct libnet_context *ctx = NULL;
 	struct libnet_DeleteUser req;
-	bool ret = true;
-
-	prep_mem_ctx = talloc_init("prepare test_deleteuser");
-
-	req.in.user_name = TEST_USERNAME;
-	req.in.domain_name = lpcfg_workgroup(torture->lp_ctx);
+	bool ret = false;
 
 	status = torture_rpc_connection(torture,
 					&p,
 					&ndr_table_samr);
-	if (!NT_STATUS_IS_OK(status)) {
-		ret = false;
-		goto done;
-	}
+	torture_assert_ntstatus_ok(torture, status, "torture_rpc_connection() failed");
+
+	mem_ctx = talloc_init("torture_deleteuser");
 
+	/*
+	 * Pre-create a user to be deleted later
+	 */
 	domain_name.string = lpcfg_workgroup(torture->lp_ctx);
-	if (!test_domain_open(torture, p->binding_handle, &domain_name, prep_mem_ctx, &h, NULL)) {
-		ret = false;
-		goto done;
-	}
+	ret = test_domain_open(torture, p->binding_handle, &domain_name, mem_ctx, &h, NULL);
+	torture_assert_goto(torture, ret, ret, done, "test_domain_open() failed");
 
-	if (!test_user_create(torture, p->binding_handle, prep_mem_ctx, &h, name, NULL)) {
-		ret = false;
-		goto done;
-	}
+	ret = test_user_create(torture, p->binding_handle, mem_ctx, &h, name, NULL);
+	torture_assert_goto(torture, ret, ret, done, "test_user_create() failed");
 
-	mem_ctx = talloc_init("test_deleteuser");
+	/*
+	 * Delete the user using libnet layer
+	 */
+	ret = test_libnet_context_init(torture, true, &ctx);
+	torture_assert_goto(torture, ret, ret, done, "test_libnet_context_init() failed");
 
-	if (!test_libnet_context_init(torture, true, &ctx)) {
-		return false;
-	}
+	req.in.user_name = TEST_USERNAME;
+	req.in.domain_name = lpcfg_workgroup(torture->lp_ctx);
 
 	status = libnet_DeleteUser(ctx, mem_ctx, &req);
-	if (!NT_STATUS_IS_OK(status)) {
-		torture_comment(torture, "libnet_DeleteUser call failed: %s\n", nt_errstr(status));
-		ret = false;
-	}
+	torture_assert_ntstatus_ok_goto(torture, status, ret, done, "libnet_DeleteUser() failed");
 
-	talloc_free(mem_ctx);
+	/* mark test as successful */
+	ret = true;
 
 done:
 	talloc_free(ctx);
-	talloc_free(prep_mem_ctx);
+	talloc_free(mem_ctx);
 	return ret;
 }
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list