summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2004-11-11 05:29:58 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:05:43 -0500
commit32e368502d80517dd7b00c1c3bc8b042887d9db0 (patch)
tree81b1cdfc7f8a14faced4c4aadcfcac0a3e1ba3fc
parent189783e5b9dabdb12fdff0381f8145aea57b5be6 (diff)
downloadsamba-32e368502d80517dd7b00c1c3bc8b042887d9db0.tar.gz
samba-32e368502d80517dd7b00c1c3bc8b042887d9db0.tar.bz2
samba-32e368502d80517dd7b00c1c3bc8b042887d9db0.zip
r3680: 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 (This used to be commit 68dd173dc0539f290f40ee90f398591409765932)
-rw-r--r--source4/torture/rpc/samlogon.c98
1 files changed, 36 insertions, 62 deletions
diff --git a/source4/torture/rpc/samlogon.c b/source4/torture/rpc/samlogon.c
index 6f58af3134..54d6dd85f8 100644
--- a/source4/torture/rpc/samlogon.c
+++ b/source4/torture/rpc/samlogon.c
@@ -976,7 +976,7 @@ static BOOL test_InteractiveLogon(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
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 torture_rpc_samlogon(void)
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,69 +1043,35 @@ BOOL torture_rpc_samlogon(void)
ret = False;
}
- if (!test_SetupCredentials2(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_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;
+ 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_SamLogon(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;
+ }
}
talloc_destroy(mem_ctx);