svn commit: samba r10168 - in branches/tmp/samba4-winsrepl: . source/torture/nbt

metze at samba.org metze at samba.org
Mon Sep 12 11:43:16 GMT 2005


Author: metze
Date: 2005-09-12 11:43:15 +0000 (Mon, 12 Sep 2005)
New Revision: 10168

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=10168

Log:
 r12172 at SERNOX (orig r10167):  metze | 2005-09-12 13:42:48 +0200
 add a test to check if we always get the same assoc_ctx, on one connection.
 
 metze

Modified:
   branches/tmp/samba4-winsrepl/
   branches/tmp/samba4-winsrepl/source/torture/nbt/winsreplication.c


Changeset:

Property changes on: branches/tmp/samba4-winsrepl
___________________________________________________________________
Name: svk:merge
   - 0c0555d6-39d7-0310-84fc-f1cc0bd64818:/branches/SAMBA_4_0:10164
3a72dc49-98ff-0310-ab52-9b7ed7945d91:/local/samba4:9495
a953eb74-4aff-0310-a63c-855d20285ebb:/local/samba4:11627
   + 0c0555d6-39d7-0310-84fc-f1cc0bd64818:/branches/SAMBA_4_0:10167
3a72dc49-98ff-0310-ab52-9b7ed7945d91:/local/samba4:9495
a953eb74-4aff-0310-a63c-855d20285ebb:/local/samba4:11627

Modified: branches/tmp/samba4-winsrepl/source/torture/nbt/winsreplication.c
===================================================================
--- branches/tmp/samba4-winsrepl/source/torture/nbt/winsreplication.c	2005-09-12 11:42:48 UTC (rev 10167)
+++ branches/tmp/samba4-winsrepl/source/torture/nbt/winsreplication.c	2005-09-12 11:43:15 UTC (rev 10168)
@@ -96,6 +96,50 @@
 }
 
 /*
+  test if we always get back the same assoc_ctx
+*/
+static BOOL test_assoc_ctx2(TALLOC_CTX *mem_ctx, const char *address)
+{
+	BOOL ret = True;
+	struct wrepl_socket *wrepl_socket;
+	struct wrepl_associate associate;
+	uint32_t assoc_ctx1;
+	NTSTATUS status;
+
+	printf("Test if we always get back the same assoc_ctx\n");
+
+	wrepl_socket = wrepl_socket_init(mem_ctx, NULL);
+	
+	printf("Setup wrepl connections\n");
+	status = wrepl_connect(wrepl_socket, address);
+	CHECK_STATUS(status, NT_STATUS_OK);
+
+
+	printf("Send 1st start association request\n");
+	status = wrepl_associate(wrepl_socket, &associate);
+	CHECK_STATUS(status, NT_STATUS_OK);
+	assoc_ctx1 = associate.out.assoc_ctx;
+	printf("1st association context: 0x%x\n", associate.out.assoc_ctx);
+
+	printf("Send 2nd start association request\n");
+	status = wrepl_associate(wrepl_socket, &associate);
+	CHECK_VALUE(associate.out.assoc_ctx, assoc_ctx1);
+	CHECK_STATUS(status, NT_STATUS_OK);
+	printf("2nd association context: 0x%x\n", associate.out.assoc_ctx);
+
+	printf("Send 3rd start association request\n");
+	status = wrepl_associate(wrepl_socket, &associate);
+	CHECK_VALUE(associate.out.assoc_ctx, assoc_ctx1);
+	CHECK_STATUS(status, NT_STATUS_OK);
+	printf("3rd association context: 0x%x\n", associate.out.assoc_ctx);
+
+done:
+	printf("Close wrepl connections\n");
+	talloc_free(wrepl_socket);
+	return ret;
+}
+
+/*
   display a replication entry
 */
 static void display_entry(TALLOC_CTX *mem_ctx, struct wrepl_name *name)
@@ -145,8 +189,6 @@
 		struct wrepl_packet packet;
 		struct wrepl_request *req;
 
-		printf("We are not a valid pull partner for the server\n");
-
 		ZERO_STRUCT(packet);
 		packet.opcode                      = WREPL_OPCODE_BITS;
 		packet.assoc_ctx                   = associate.out.assoc_ctx;
@@ -155,6 +197,8 @@
 
 		req = wrepl_request_send(wrepl_socket, &packet);
 		talloc_free(req);
+
+		printf("failed - We are not a valid pull partner for the server\n");
 		ret = False;
 		goto done;
 	}
@@ -212,6 +256,7 @@
 	}
 
 	ret &= test_assoc_ctx1(mem_ctx, address);
+	ret &= test_assoc_ctx2(mem_ctx, address);
 
 	ret &= test_wins_replication(mem_ctx, address);
 



More information about the samba-cvs mailing list