[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-2340-gbdd214b

Günther Deschner gd at samba.org
Tue Jun 16 23:30:12 GMT 2009


The branch, master has been updated
       via  bdd214b38c9c97550cf8122f75c6a14e0b0397d0 (commit)
       via  823681bc9965b58404afda205782896c8226d053 (commit)
      from  cbb55b34e27b3927f4fb05e47cd8c19828553b6a (commit)

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


- Log -----------------------------------------------------------------
commit bdd214b38c9c97550cf8122f75c6a14e0b0397d0
Author: Günther Deschner <gd at samba.org>
Date:   Wed Jun 17 01:20:03 2009 +0200

    s4-smbtorture: use torture_comment in RPC-SAMR-USERS-PRIVILEGES test.
    
    Guenther

commit 823681bc9965b58404afda205782896c8226d053
Author: Günther Deschner <gd at samba.org>
Date:   Wed Jun 17 01:06:14 2009 +0200

    s4-smbtorture: use TORTURE_TEST_USER define in libnetapi user test.
    
    Guenther

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

Summary of changes:
 source4/torture/libnetapi/libnetapi_user.c |   32 +++++++++++++--------------
 source4/torture/rpc/samr.c                 |   30 +++++++++++++-------------
 2 files changed, 30 insertions(+), 32 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/torture/libnetapi/libnetapi_user.c b/source4/torture/libnetapi/libnetapi_user.c
index c634330..7269988 100644
--- a/source4/torture/libnetapi/libnetapi_user.c
+++ b/source4/torture/libnetapi/libnetapi_user.c
@@ -22,7 +22,8 @@
 #include <netapi.h>
 #include "torture/libnetapi/proto.h"
 
-#define TORTURE_TEST_USER "testuser"
+#define TORTURE_TEST_USER "torture_testuser"
+#define TORTURE_TEST_USER2 "torture_testuser2"
 
 #define NETAPI_STATUS(tctx, x,y,fn) \
 	torture_warning(tctx, "FAILURE: line %d: %s failed with status: %s (%d)\n", \
@@ -342,7 +343,6 @@ static NET_API_STATUS test_netusergetgroups(struct torture_context *tctx,
 bool torture_libnetapi_user(struct torture_context *tctx)
 {
 	NET_API_STATUS status = 0;
-	const char *username, *username2;
 	uint8_t *buffer = NULL;
 	uint32_t levels[] = { 0, 1, 2, 3, 4, 10, 11, 20, 23 };
 	uint32_t enum_levels[] = { 0, 1, 2, 3, 4, 10, 11, 20, 23 };
@@ -360,16 +360,14 @@ bool torture_libnetapi_user(struct torture_context *tctx)
 
 	torture_comment(tctx, "NetUser tests\n");
 
-	username = "torture_test_user";
-	username2 = "torture_test_user2";
-
 	/* cleanup */
-	NetUserDel(hostname, username);
-	NetUserDel(hostname, username2);
+
+	NetUserDel(hostname, TORTURE_TEST_USER);
+	NetUserDel(hostname, TORTURE_TEST_USER2);
 
 	/* add a user */
 
-	status = test_netuseradd(tctx, hostname, username);
+	status = test_netuseradd(tctx, hostname, TORTURE_TEST_USER);
 	if (status) {
 		NETAPI_STATUS(tctx, ctx, status, "NetUserAdd");
 		goto out;
@@ -379,7 +377,7 @@ bool torture_libnetapi_user(struct torture_context *tctx)
 
 	for (i=0; i<ARRAY_SIZE(enum_levels); i++) {
 
-		status = test_netuserenum(tctx, hostname, enum_levels[i], username);
+		status = test_netuserenum(tctx, hostname, enum_levels[i], TORTURE_TEST_USER);
 		if (status) {
 			NETAPI_STATUS(tctx, ctx, status, "NetUserEnum");
 			goto out;
@@ -392,7 +390,7 @@ bool torture_libnetapi_user(struct torture_context *tctx)
 
 		torture_comment(tctx, "testing NetUserGetInfo level %d\n", levels[i]);
 
-		status = NetUserGetInfo(hostname, username, levels[i], &buffer);
+		status = NetUserGetInfo(hostname, TORTURE_TEST_USER, levels[i], &buffer);
 		if (status && status != 124) {
 			NETAPI_STATUS(tctx, ctx, status, "NetUserGetInfo");
 			goto out;
@@ -403,7 +401,7 @@ bool torture_libnetapi_user(struct torture_context *tctx)
 
 	for (i=0; i<ARRAY_SIZE(getgr_levels); i++) {
 
-		status = test_netusergetgroups(tctx, hostname, getgr_levels[i], username, NULL);
+		status = test_netusergetgroups(tctx, hostname, getgr_levels[i], TORTURE_TEST_USER, NULL);
 		if (status) {
 			NETAPI_STATUS(tctx, ctx, status, "NetUserGetGroups");
 			goto out;
@@ -416,7 +414,7 @@ bool torture_libnetapi_user(struct torture_context *tctx)
 
 	u1007.usri1007_comment = "NetApi modified user";
 
-	status = NetUserSetInfo(hostname, username, 1007, (uint8_t *)&u1007, &parm_err);
+	status = NetUserSetInfo(hostname, TORTURE_TEST_USER, 1007, (uint8_t *)&u1007, &parm_err);
 	if (status) {
 		NETAPI_STATUS(tctx, ctx, status, "NetUserSetInfo");
 		goto out;
@@ -425,7 +423,7 @@ bool torture_libnetapi_user(struct torture_context *tctx)
 	/* query info */
 
 	for (i=0; i<ARRAY_SIZE(levels); i++) {
-		status = NetUserGetInfo(hostname, username, levels[i], &buffer);
+		status = NetUserGetInfo(hostname, TORTURE_TEST_USER, levels[i], &buffer);
 		if (status && status != 124) {
 			NETAPI_STATUS(tctx, ctx, status, "NetUserGetInfo");
 			goto out;
@@ -436,7 +434,7 @@ bool torture_libnetapi_user(struct torture_context *tctx)
 
 	torture_comment(tctx, "testing NetUserDel\n");
 
-	status = NetUserDel(hostname, username);
+	status = NetUserDel(hostname, TORTURE_TEST_USER);
 	if (status) {
 		NETAPI_STATUS(tctx, ctx, status, "NetUserDel");
 		goto out;
@@ -444,7 +442,7 @@ bool torture_libnetapi_user(struct torture_context *tctx)
 
 	/* should not exist anymore */
 
-	status = NetUserGetInfo(hostname, username, 0, &buffer);
+	status = NetUserGetInfo(hostname, TORTURE_TEST_USER, 0, &buffer);
 	if (status == 0) {
 		NETAPI_STATUS(tctx, ctx, status, "NetUserGetInfo");
 		status = -1;
@@ -461,8 +459,8 @@ bool torture_libnetapi_user(struct torture_context *tctx)
 	torture_comment(tctx, "NetUser tests succeeded\n");
  out:
 	/* cleanup */
-	NetUserDel(hostname, username);
-	NetUserDel(hostname, username2);
+	NetUserDel(hostname, TORTURE_TEST_USER);
+	NetUserDel(hostname, TORTURE_TEST_USER2);
 
 	if (status != 0) {
 		torture_comment(tctx, "NetUser testsuite failed with: %s\n",
diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c
index 11e746a..bd88c3b 100644
--- a/source4/torture/rpc/samr.c
+++ b/source4/torture/rpc/samr.c
@@ -3303,7 +3303,7 @@ static bool test_DeleteUser_with_privs(struct dcerpc_pipe *p,
 		struct lsa_EnumAccountRights r;
 		struct lsa_RightSet rights;
 
-		printf("Testing LSA EnumAccountRights\n");
+		torture_comment(tctx, "Testing LSA EnumAccountRights\n");
 
 		r.in.handle = lsa_handle;
 		r.in.sid = user_sid;
@@ -3319,7 +3319,7 @@ static bool test_DeleteUser_with_privs(struct dcerpc_pipe *p,
 		struct lsa_StringLarge names[2];
 		struct lsa_AddAccountRights r;
 
-		printf("Testing LSA AddAccountRights\n");
+		torture_comment(tctx, "Testing LSA AddAccountRights\n");
 
 		init_lsa_StringLarge(&names[0], "SeMachineAccountPrivilege");
 		init_lsa_StringLarge(&names[1], NULL);
@@ -3343,7 +3343,7 @@ static bool test_DeleteUser_with_privs(struct dcerpc_pipe *p,
 		int i;
 		bool found_sid = false;
 
-		printf("Testing LSA EnumAccounts\n");
+		torture_comment(tctx, "Testing LSA EnumAccounts\n");
 
 		r.in.handle = lsa_handle;
 		r.in.num_entries = 0x1000;
@@ -3369,7 +3369,7 @@ static bool test_DeleteUser_with_privs(struct dcerpc_pipe *p,
 		struct lsa_EnumAccountRights r;
 		struct lsa_RightSet user_rights;
 
-		printf("Testing LSA EnumAccountRights\n");
+		torture_comment(tctx, "Testing LSA EnumAccountRights\n");
 
 		r.in.handle = lsa_handle;
 		r.in.sid = user_sid;
@@ -3388,7 +3388,7 @@ static bool test_DeleteUser_with_privs(struct dcerpc_pipe *p,
 	{
 		struct lsa_OpenAccount r;
 
-		printf("Testing LSA OpenAccount\n");
+		torture_comment(tctx, "Testing LSA OpenAccount\n");
 
 		r.in.handle = lsa_handle;
 		r.in.sid = user_sid;
@@ -3404,7 +3404,7 @@ static bool test_DeleteUser_with_privs(struct dcerpc_pipe *p,
 		struct lsa_GetSystemAccessAccount r;
 		uint32_t access_mask;
 
-		printf("Testing LSA GetSystemAccessAccount\n");
+		torture_comment(tctx, "Testing LSA GetSystemAccessAccount\n");
 
 		r.in.handle = &lsa_acct_handle;
 		r.out.access_mask = &access_mask;
@@ -3417,7 +3417,7 @@ static bool test_DeleteUser_with_privs(struct dcerpc_pipe *p,
 	{
 		struct lsa_Close r;
 
-		printf("Testing LSA Close\n");
+		torture_comment(tctx, "Testing LSA Close\n");
 
 		r.in.handle = &lsa_acct_handle;
 		r.out.handle = &lsa_acct_handle;
@@ -3430,7 +3430,7 @@ static bool test_DeleteUser_with_privs(struct dcerpc_pipe *p,
 	{
 		struct samr_DeleteUser r;
 
-		printf("Testing SAMR DeleteUser\n");
+		torture_comment(tctx, "Testing SAMR DeleteUser\n");
 
 		r.in.user_handle = user_handle;
 		r.out.user_handle = user_handle;
@@ -3446,7 +3446,7 @@ static bool test_DeleteUser_with_privs(struct dcerpc_pipe *p,
 		int i;
 		bool found_sid = false;
 
-		printf("Testing LSA EnumAccounts\n");
+		torture_comment(tctx, "Testing LSA EnumAccounts\n");
 
 		r.in.handle = lsa_handle;
 		r.in.num_entries = 0x1000;
@@ -3472,7 +3472,7 @@ static bool test_DeleteUser_with_privs(struct dcerpc_pipe *p,
 		struct lsa_EnumAccountRights r;
 		struct lsa_RightSet user_rights;
 
-		printf("Testing LSA EnumAccountRights\n");
+		torture_comment(tctx, "Testing LSA EnumAccountRights\n");
 
 		r.in.handle = lsa_handle;
 		r.in.sid = user_sid;
@@ -3491,7 +3491,7 @@ static bool test_DeleteUser_with_privs(struct dcerpc_pipe *p,
 	{
 		struct lsa_OpenAccount r;
 
-		printf("Testing LSA OpenAccount\n");
+		torture_comment(tctx, "Testing LSA OpenAccount\n");
 
 		r.in.handle = lsa_handle;
 		r.in.sid = user_sid;
@@ -3507,7 +3507,7 @@ static bool test_DeleteUser_with_privs(struct dcerpc_pipe *p,
 		struct lsa_GetSystemAccessAccount r;
 		uint32_t access_mask;
 
-		printf("Testing LSA GetSystemAccessAccount\n");
+		torture_comment(tctx, "Testing LSA GetSystemAccessAccount\n");
 
 		r.in.handle = &lsa_acct_handle;
 		r.out.access_mask = &access_mask;
@@ -3520,7 +3520,7 @@ static bool test_DeleteUser_with_privs(struct dcerpc_pipe *p,
 	{
 		struct lsa_DeleteObject r;
 
-		printf("Testing LSA DeleteObject\n");
+		torture_comment(tctx, "Testing LSA DeleteObject\n");
 
 		r.in.handle = &lsa_acct_handle;
 		r.out.handle = &lsa_acct_handle;
@@ -3537,7 +3537,7 @@ static bool test_DeleteUser_with_privs(struct dcerpc_pipe *p,
 		int i;
 		bool found_sid = false;
 
-		printf("Testing LSA EnumAccounts\n");
+		torture_comment(tctx, "Testing LSA EnumAccounts\n");
 
 		r.in.handle = lsa_handle;
 		r.in.num_entries = 0x1000;
@@ -3563,7 +3563,7 @@ static bool test_DeleteUser_with_privs(struct dcerpc_pipe *p,
 		struct lsa_EnumAccountRights r;
 		struct lsa_RightSet user_rights;
 
-		printf("Testing LSA EnumAccountRights\n");
+		torture_comment(tctx, "Testing LSA EnumAccountRights\n");
 
 		r.in.handle = lsa_handle;
 		r.in.sid = user_sid;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list