svn commit: samba r3680 - in branches/SAMBA_4_0/source/torture/rpc: .

abartlet at samba.org abartlet at samba.org
Thu Nov 11 05:29:58 GMT 2004


Author: abartlet
Date: 2004-11-11 05:29:58 +0000 (Thu, 11 Nov 2004)
New Revision: 3680

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

Log:
Move the multiple runs of this test into a loop.  Also check that no
flags individually have an impact (above what we already expect).

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/torture/rpc/samlogon.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/rpc/samlogon.c
===================================================================
--- branches/SAMBA_4_0/source/torture/rpc/samlogon.c	2004-11-11 05:04:22 UTC (rev 3679)
+++ branches/SAMBA_4_0/source/torture/rpc/samlogon.c	2004-11-11 05:29:58 UTC (rev 3680)
@@ -976,7 +976,7 @@
 		creds_des_encrypt(creds, &pinfo.ntpassword);
 	}
 
-	printf("Testing netr_LogonSamLogonWithFlags\n");
+	printf("Testing netr_LogonSamLogonWithFlags (Interactive Logon)\n");
 
 	status = dcerpc_netr_LogonSamLogonWithFlags(p, mem_ctx, &r);
 	if (!NT_STATUS_IS_OK(status)) {
@@ -1002,6 +1002,14 @@
 	BOOL ret = True;
 	void *join_ctx;
 	const char *machine_pass;
+	int i;
+	
+	unsigned int credential_flags[] = {
+		0, 
+		NETLOGON_NEG_AUTH2_FLAGS,
+		NETLOGON_NEG_ARCFOUR,
+		NETLOGON_NEG_ARCFOUR | NETLOGON_NEG_128BIT,
+		NETLOGON_NEG_AUTH2_ADS_FLAGS};
 
 	struct creds_CredentialState creds;
 
@@ -1035,71 +1043,37 @@
 		ret = False;
 	}
 
-	if (!test_SetupCredentials2(p, mem_ctx, NETLOGON_NEG_AUTH2_FLAGS,
-				    TEST_MACHINE_NAME, machine_pass, &creds)) {
-		return False;
+	for (i=0; i < ARRAY_SIZE(credential_flags); i++) {
+		
+		if (!test_SetupCredentials2(p, mem_ctx, credential_flags[i],
+					    TEST_MACHINE_NAME, machine_pass, &creds)) {
+			return False;
+		}
+		
+		if (!test_InteractiveLogon(p, mem_ctx, &creds)) {
+			ret = False;
+		}
+		
+		if (!test_SamLogon(p, mem_ctx, &creds)) {
+			ret = False;
+		}
 	}
 
-	if (!test_InteractiveLogon(p, mem_ctx, &creds)) {
-		ret = False;
+	for (i=0; i < 32; i++) {
+		if (!test_SetupCredentials2(p, mem_ctx, 1 << i,
+					    TEST_MACHINE_NAME, machine_pass, &creds)) {
+			return False;
+		}
+		
+		if (!test_InteractiveLogon(p, mem_ctx, &creds)) {
+			ret = False;
+		}
+		
+		if (!test_SamLogon(p, mem_ctx, &creds)) {
+			ret = False;
+		}
 	}
 
-	if (!test_SamLogon(p, mem_ctx, &creds)) {
-		ret = False;
-	}
-
-	if (!test_SetupCredentials2(p, mem_ctx, NETLOGON_NEG_ARCFOUR,
-				    TEST_MACHINE_NAME, machine_pass, &creds)) {
-		return False;
-	}
-
-	if (!test_InteractiveLogon(p, mem_ctx, &creds)) {
-		ret = False;
-	}
-
-	if (!test_SamLogon(p, mem_ctx, &creds)) {
-		ret = False;
-	}
-
-	if (!test_SetupCredentials2(p, mem_ctx, NETLOGON_NEG_ARCFOUR | NETLOGON_NEG_128BIT,
-				    TEST_MACHINE_NAME, machine_pass, &creds)) {
-		return False;
-	}
-
-	if (!test_InteractiveLogon(p, mem_ctx, &creds)) {
-		ret = False;
-	}
-
-	if (!test_SamLogon(p, mem_ctx, &creds)) {
-		ret = False;
-	}
-
-	if (!test_SetupCredentials3(p, mem_ctx, NETLOGON_NEG_AUTH2_FLAGS,
-				    TEST_MACHINE_NAME, machine_pass, &creds)) {
-		return False;
-	}
-
-	if (!test_InteractiveLogon(p, mem_ctx, &creds)) {
-		ret = False;
-	}
-
-	if (!test_SamLogon(p, mem_ctx, &creds)) {
-		ret = False;
-	}
-
-	if (!test_SetupCredentials3(p, mem_ctx, NETLOGON_NEG_AUTH2_ADS_FLAGS,
-				    TEST_MACHINE_NAME, machine_pass, &creds)) {
-		return False;
-	}
-
-	if (!test_InteractiveLogon(p, mem_ctx, &creds)) {
-		ret = False;
-	}
-
-	if (!test_SamLogon(p, mem_ctx, &creds)) {
-		ret = False;
-	}
-
 	talloc_destroy(mem_ctx);
 
 	torture_rpc_close(p);



More information about the samba-cvs mailing list