From 4bebab21463825c22cced6e8c59b99c525172911 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 12 Mar 2015 13:43:49 +1300 Subject: [PATCH] selftest: Change testsuite to use a samAccountName with a space in it This shows that the previous patch is correct Signed-off-by: Andrew Bartlett Reviewed-by: Stefan Metzmacher Reviewed-by: Guenther Deschner --- selftest/target/Samba4.pm | 17 +++++++++++++---- source4/selftest/tests.py | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm index 901fc62e8e3..5ac9a1ee0b5 100755 --- a/selftest/target/Samba4.pm +++ b/selftest/target/Samba4.pm @@ -834,6 +834,15 @@ sub provision_raw_step2($$$) open(LDIF, "|$ldbmodify -H $ctx->{privatedir}/sam.ldb"); print LDIF "dn: $user_dn changetype: modify +replace: samAccountName +samAccountName: test allowed +- +"; + close(LDIF); + + open(LDIF, "|$ldbmodify -H $ctx->{privatedir}/sam.ldb"); + print LDIF "dn: $user_dn +changetype: modify replace: userPrincipalName userPrincipalName: testallowed upn\@$ctx->{realm} replace: servicePrincipalName @@ -860,9 +869,9 @@ userPrincipalName: testdenied_upn\@$ctx->{realm}.upn close(LDIF); $samba_tool_cmd = Samba::bindir_path($self, "samba-tool") - . " group addmembers --configfile=$ctx->{smb_conf} 'Allowed RODC Password Replication Group' testallowed"; + . " group addmembers --configfile=$ctx->{smb_conf} 'Allowed RODC Password Replication Group' 'test allowed'"; unless (system($samba_tool_cmd) == 0) { - warn("Unable to add testallowed user to 'Allowed RODC Password Replication Group': \n$samba_tool_cmd\n"); + warn("Unable to add 'test allowed' user to 'Allowed RODC Password Replication Group': \n$samba_tool_cmd\n"); return undef; } @@ -1638,10 +1647,10 @@ sub provision_rodc($$$) return undef; } - # This ensures deterministic behaviour for tests that want to have the testallowed + # This ensures deterministic behaviour for tests that want to have the 'test allowed' # user password verified on the RODC $cmd = "KRB5_CONFIG=\"$ret->{KRB5_CONFIG}\" "; - $cmd .= "$samba_tool rodc preload testallowed $ret->{CONFIGURATION}"; + $cmd .= "$samba_tool rodc preload 'test allowed' $ret->{CONFIGURATION}"; $cmd .= " --server=$dcvars->{DC_SERVER}"; unless (system($cmd) == 0) { diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py index cc67c206d57..038513d9d10 100755 --- a/source4/selftest/tests.py +++ b/source4/selftest/tests.py @@ -572,7 +572,7 @@ for env in ["dc", "rodc", "promoted_dc", "plugin_s4_dc", "fl2000dc", "fl2003dc", plansmbtorture4testsuite('krb5.kdc', "%s:local" % env, ['ncacn_np:$SERVER_IP', "-k", "yes", '-P', '--workgroup=$DOMAIN', '--realm=$REALM', '--option=torture:krb5-hostname=$SERVER', '--option=torture:expect_machine_account=true'] + extra_options, "samba4.krb5.kdc with machine account") - plansmbtorture4testsuite('krb5.kdc', env, ['ncacn_np:$SERVER_IP', "-k", "yes", '-Utestallowed%$PASSWORD', + plansmbtorture4testsuite('krb5.kdc', env, ['ncacn_np:$SERVER_IP', "-k", "yes", '-Utest\ allowed%$PASSWORD', '--workgroup=$DOMAIN', '--realm=$REALM', '--option=torture:expect_machine_account=true', '--option=torture:krb5-upn=testallowed\ upn@$REALM',