svn commit: samba r2676 - in branches/SAMBA_4_0/source/torture/rpc:
.
tridge at samba.org
tridge at samba.org
Mon Sep 27 05:15:14 GMT 2004
Author: tridge
Date: 2004-09-27 05:15:14 +0000 (Mon, 27 Sep 2004)
New Revision: 2676
WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/torture/rpc&rev=2676&nolog=1
Log:
add a test of the reference counting logic in the SAMR server into the
RPC-SAMR torture test. This closes the samr connection before working
on a open domain handle. The server is supposed to know that the open
domain handle still holds a reference to the connection, so the
connection remains valid even though it has been closed.
Modified:
branches/SAMBA_4_0/source/torture/rpc/samr.c
Changeset:
Modified: branches/SAMBA_4_0/source/torture/rpc/samr.c
===================================================================
--- branches/SAMBA_4_0/source/torture/rpc/samr.c 2004-09-27 05:13:00 UTC (rev 2675)
+++ branches/SAMBA_4_0/source/torture/rpc/samr.c 2004-09-27 05:15:14 UTC (rev 2676)
@@ -2705,6 +2705,8 @@
+static BOOL test_Connect(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle);
static BOOL test_OpenDomain(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
struct policy_handle *handle, struct dom_sid *sid)
@@ -2735,90 +2737,32 @@
return False;
}
- if (!test_QuerySecurity(p, mem_ctx, &domain_handle)) {
- ret = False;
- }
+ /* run the domain tests with the main handle closed - this tests
+ the servers reference counting */
+ ret &= test_Close(p, mem_ctx, handle);
- if (!test_RemoveMemberFromForeignDomain(p, mem_ctx, &domain_handle)) {
- ret = False;
- }
+ ret &= test_QuerySecurity(p, mem_ctx, &domain_handle);
+ ret &= test_RemoveMemberFromForeignDomain(p, mem_ctx, &domain_handle);
+ ret &= test_CreateUser2(p, mem_ctx, &domain_handle);
+ ret &= test_CreateUser(p, mem_ctx, &domain_handle, &user_handle);
+ ret &= test_CreateAlias(p, mem_ctx, &domain_handle, &alias_handle, sid);
+ ret &= test_CreateDomainGroup(p, mem_ctx, &domain_handle, &group_handle);
+ ret &= test_QueryDomainInfo(p, mem_ctx, &domain_handle);
+ ret &= test_QueryDomainInfo2(p, mem_ctx, &domain_handle);
+ ret &= test_EnumDomainUsers(p, mem_ctx, &domain_handle);
+ ret &= test_EnumDomainUsers_async(p, mem_ctx, &domain_handle);
+ ret &= test_EnumDomainGroups(p, mem_ctx, &domain_handle);
+ ret &= test_EnumDomainAliases(p, mem_ctx, &domain_handle);
+ ret &= test_QueryDisplayInfo(p, mem_ctx, &domain_handle);
+ ret &= test_QueryDisplayInfo2(p, mem_ctx, &domain_handle);
+ ret &= test_QueryDisplayInfo3(p, mem_ctx, &domain_handle);
+ ret &= test_GetDisplayEnumerationIndex(p, mem_ctx, &domain_handle);
+ ret &= test_GetDisplayEnumerationIndex2(p, mem_ctx, &domain_handle);
+ ret &= test_GroupList(p, mem_ctx, &domain_handle);
+ ret &= test_TestPrivateFunctionsDomain(p, mem_ctx, &domain_handle);
+ ret &= test_RidToSid(p, mem_ctx, &domain_handle);
+ ret &= test_GetBootKeyInformation(p, mem_ctx, &domain_handle);
- if (!test_CreateUser2(p, mem_ctx, &domain_handle)) {
- ret = False;
- }
-
- if (!test_CreateUser(p, mem_ctx, &domain_handle, &user_handle)) {
- ret = False;
- }
-
- if (!test_CreateAlias(p, mem_ctx, &domain_handle, &alias_handle, sid)) {
- ret = False;
- }
-
- if (!test_CreateDomainGroup(p, mem_ctx, &domain_handle, &group_handle)) {
- ret = False;
- }
-
- if (!test_QueryDomainInfo(p, mem_ctx, &domain_handle)) {
- ret = False;
- }
-
- if (!test_QueryDomainInfo2(p, mem_ctx, &domain_handle)) {
- ret = False;
- }
-
- if (!test_EnumDomainUsers(p, mem_ctx, &domain_handle)) {
- ret = False;
- }
-
- if (!test_EnumDomainUsers_async(p, mem_ctx, &domain_handle)) {
- ret = False;
- }
-
- if (!test_EnumDomainGroups(p, mem_ctx, &domain_handle)) {
- ret = False;
- }
-
- if (!test_EnumDomainAliases(p, mem_ctx, &domain_handle)) {
- ret = False;
- }
-
- if (!test_QueryDisplayInfo(p, mem_ctx, &domain_handle)) {
- ret = False;
- }
-
- if (!test_QueryDisplayInfo2(p, mem_ctx, &domain_handle)) {
- ret = False;
- }
-
- if (!test_QueryDisplayInfo3(p, mem_ctx, &domain_handle)) {
- ret = False;
- }
-
- if (!test_GetDisplayEnumerationIndex(p, mem_ctx, &domain_handle)) {
- ret = False;
- }
-
- if (!test_GetDisplayEnumerationIndex2(p, mem_ctx, &domain_handle)) {
- ret = False;
- }
-
- if (!test_GroupList(p, mem_ctx, &domain_handle)) {
- ret = False;
- }
-
- if (!test_TestPrivateFunctionsDomain(p, mem_ctx, &domain_handle)) {
- ret = False;
- }
-
- if (!test_RidToSid(p, mem_ctx, &domain_handle)) {
- ret = False;
- }
-
- if (!test_GetBootKeyInformation(p, mem_ctx, &domain_handle)) {
- ret = False;
- }
-
if (!policy_handle_empty(&user_handle) &&
!test_DeleteUser(p, mem_ctx, &user_handle)) {
ret = False;
@@ -2834,10 +2778,11 @@
ret = False;
}
- if (!test_Close(p, mem_ctx, &domain_handle)) {
- ret = False;
- }
+ ret &= test_Close(p, mem_ctx, &domain_handle);
+ /* reconnect the main handle */
+ ret &= test_Connect(p, mem_ctx, handle);
+
return ret;
}
More information about the samba-cvs
mailing list