selftest/Samba4: use 'testallowed account' instead of 'test allowed'
authorStefan Metzmacher <metze@samba.org>
Sun, 29 Mar 2015 09:15:29 +0000 (11:15 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 9 Apr 2015 14:58:23 +0000 (16:58 +0200)
local.nss test might print lines starting with 'test allowed:...'
and that confused the subunit parser.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
selftest/target/Samba4.pm
source4/selftest/tests.py

index 9d765c43577162d1f6fe44226737c18a6bddb8da..26f6ddaf9def179bec426f13bbc67b4f69fc558f 100755 (executable)
@@ -816,8 +816,9 @@ sub provision_raw_step2($$$)
                return undef;
        }
 
+       my $testallowed_account = "testallowed";
        my $samba_tool_cmd = Samba::bindir_path($self, "samba-tool") 
-           . " user add --configfile=$ctx->{smb_conf} testallowed $ctx->{password}";
+           . " user add --configfile=$ctx->{smb_conf} $testallowed_account $ctx->{password}";
        unless (system($samba_tool_cmd) == 0) {
                warn("Unable to add testallowed user: \n$samba_tool_cmd\n");
                return undef;
@@ -830,12 +831,13 @@ sub provision_raw_step2($$$)
                $base_dn = "DC=$ctx->{netbiosname}";
        }
 
-       my $user_dn = "cn=testallowed,cn=users,$base_dn";
+       my $user_dn = "cn=$testallowed_account,cn=users,$base_dn";
+       $testallowed_account = "testallowed account";
        open(LDIF, "|$ldbmodify -H $ctx->{privatedir}/sam.ldb");
        print LDIF "dn: $user_dn
 changetype: modify
 replace: samAccountName
-samAccountName: test allowed
+samAccountName: $testallowed_account
 -
 ";
        close(LDIF);
@@ -869,9 +871,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' 'test allowed'";
+           . " group addmembers --configfile=$ctx->{smb_conf} 'Allowed RODC Password Replication Group' '$testallowed_account'";
        unless (system($samba_tool_cmd) == 0) {
-               warn("Unable to add 'test allowed' user to 'Allowed RODC Password Replication Group': \n$samba_tool_cmd\n");
+               warn("Unable to add '$testallowed_account' user to 'Allowed RODC Password Replication Group': \n$samba_tool_cmd\n");
                return undef;
        }
 
@@ -1637,10 +1639,11 @@ sub provision_rodc($$$)
                return undef;
        }
 
-        # This ensures deterministic behaviour for tests that want to have the 'test allowed'
+        # This ensures deterministic behaviour for tests that want to have the 'testallowed account'
         # user password verified on the RODC
+       my $testallowed_account = "testallowed account";
        $cmd = "KRB5_CONFIG=\"$ret->{KRB5_CONFIG}\" ";
-       $cmd .= "$samba_tool rodc preload 'test allowed' $ret->{CONFIGURATION}";
+       $cmd .= "$samba_tool rodc preload '$testallowed_account' $ret->{CONFIGURATION}";
        $cmd .= " --server=$dcvars->{DC_SERVER}";
 
        unless (system($cmd) == 0) {
index bea1540df3a41e1f8fd0d31d85e21156409bc5d6..3fcf2b506f7b6388fecb17d8fea363ce4cbd42f4 100755 (executable)
@@ -572,7 +572,7 @@ for env in ["ad_dc_ntvfs", "rodc", "promoted_dc", "ad_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", '-Utest\ allowed%$PASSWORD',
+    plansmbtorture4testsuite('krb5.kdc', env, ['ncacn_np:$SERVER_IP', "-k", "yes", '-Utestallowed\ account%$PASSWORD',
                                                '--workgroup=$DOMAIN', '--realm=$REALM',
                                                '--option=torture:expect_machine_account=true',
                                                '--option=torture:krb5-upn=testallowed\ upn@$REALM',