The branch, master has been updated
       via  fa5292a selftest: Remove nbt wait time
       via  2643275 selftest: Add newlines for info output
       via  d6fdf3b selftest: Fix indentation in wait_for_start()
       via  1619cde selftest: Consistently check for provision return code
       via  f6e4dc2 selftest: Remove unneeded sleep before first ldbsearch 
execution
       via  341d06f selftest: Use the correct smb.conf for ldbsearch
      from  61cb3a6 lib/ldb-samba: We can confirm a GUID is a GUID by length

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit fa5292a3659e151e5e020f6707cfdd9d0cd5119c
Author: Andreas Schneider <[email protected]>
Date:   Fri Jun 17 10:01:19 2016 +0200

    selftest: Remove nbt wait time
    
    Signed-off-by: Andreas Schneider <[email protected]>
    Reviewed-by: Andrew Bartlett <[email protected]>
    
    Autobuild-User(master): Andreas Schneider <[email protected]>
    Autobuild-Date(master): Fri Jun 17 22:15:09 CEST 2016 on sn-devel-144

commit 2643275de6a8f314554ea31d4a964b46abc72732
Author: Andreas Schneider <[email protected]>
Date:   Fri Jun 17 10:47:06 2016 +0200

    selftest: Add newlines for info output
    
    Signed-off-by: Andreas Schneider <[email protected]>
    Reviewed-by: Andrew Bartlett <[email protected]>

commit d6fdf3bb236f062ba16644b0dba091eec35ebbe0
Author: Andreas Schneider <[email protected]>
Date:   Fri Jun 17 09:48:19 2016 +0200

    selftest: Fix indentation in wait_for_start()
    
    Signed-off-by: Andreas Schneider <[email protected]>
    Reviewed-by: Andrew Bartlett <[email protected]>

commit 1619cde477e0b6e1fae035f63681bce4805e4390
Author: Andreas Schneider <[email protected]>
Date:   Fri Jun 17 09:23:49 2016 +0200

    selftest: Consistently check for provision return code
    
    Signed-off-by: Andreas Schneider <[email protected]>
    Reviewed-by: Andrew Bartlett <[email protected]>

commit f6e4dc2a92fc6b9ba5c4cc329f37bba27acd2290
Author: Andreas Schneider <[email protected]>
Date:   Fri Jun 17 13:03:48 2016 +0200

    selftest: Remove unneeded sleep before first ldbsearch execution
    
    Signed-off-by: Andreas Schneider <[email protected]>
    Reviewed-by: Andrew Bartlett <[email protected]>

commit 341d06fa24bbf159572565be08f2741931a39509
Author: Andreas Schneider <[email protected]>
Date:   Fri Jun 17 13:03:34 2016 +0200

    selftest: Use the correct smb.conf for ldbsearch
    
    Signed-off-by: Andreas Schneider <[email protected]>
    Reviewed-by: Andrew Bartlett <[email protected]>

-----------------------------------------------------------------------

Summary of changes:
 selftest/target/Samba4.pm | 96 ++++++++++++++++++++++++++++-------------------
 1 file changed, 58 insertions(+), 38 deletions(-)


Changeset truncated at 500 lines:

diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm
index 184b949..693e623 100755
--- a/selftest/target/Samba4.pm
+++ b/selftest/target/Samba4.pm
@@ -110,7 +110,7 @@ sub check_or_start($$$)
                }
        }
 
-       print "STARTING SAMBA...";
+       print "STARTING SAMBA...\n";
        my $pid = fork();
        if ($pid == 0) {
                # we want out from samba to go to the log file, but also
@@ -172,6 +172,7 @@ sub check_or_start($$$)
 sub wait_for_start($$)
 {
        my ($self, $testenv_vars) = @_;
+       my $count = 0;
        my $ret = 0;
 
        if (not $self->check_env($testenv_vars)) {
@@ -179,30 +180,39 @@ sub wait_for_start($$)
            return -1;
        }
 
-       # give time for nbt server to register its names
-       print "delaying for nbt name registration\n";
-       sleep 2;
-
        # This will return quickly when things are up, but be slow if we
        # need to wait for (eg) SSL init
        my $nmblookup =  Samba::bindir_path($self, "nmblookup4");
-       system("$nmblookup $testenv_vars->{CONFIGURATION} 
$testenv_vars->{SERVER}");
-       system("$nmblookup $testenv_vars->{CONFIGURATION} -U 
$testenv_vars->{SERVER_IP} $testenv_vars->{SERVER}");
-       system("$nmblookup $testenv_vars->{CONFIGURATION} 
$testenv_vars->{NETBIOSNAME}");
-       system("$nmblookup $testenv_vars->{CONFIGURATION} -U 
$testenv_vars->{SERVER_IP} $testenv_vars->{NETBIOSNAME}");
-       system("$nmblookup $testenv_vars->{CONFIGURATION} 
$testenv_vars->{NETBIOSNAME}");
-       system("$nmblookup $testenv_vars->{CONFIGURATION} -U 
$testenv_vars->{SERVER_IP} $testenv_vars->{NETBIOSNAME}");
-       system("$nmblookup $testenv_vars->{CONFIGURATION} 
$testenv_vars->{SERVER}");
-       system("$nmblookup $testenv_vars->{CONFIGURATION} -U 
$testenv_vars->{SERVER_IP} $testenv_vars->{SERVER}");
-       system("$nmblookup $testenv_vars->{CONFIGURATION} 
$testenv_vars->{NETBIOSNAME}");
-       system("$nmblookup $testenv_vars->{CONFIGURATION} -U 
$testenv_vars->{SERVER_IP} $testenv_vars->{NETBIOSNAME}");
-       system("$nmblookup $testenv_vars->{CONFIGURATION} 
$testenv_vars->{NETBIOSNAME}");
-       system("$nmblookup $testenv_vars->{CONFIGURATION} -U 
$testenv_vars->{SERVER_IP} $testenv_vars->{NETBIOSNAME}");
+
+       do {
+               $ret = system("$nmblookup $testenv_vars->{CONFIGURATION} 
$testenv_vars->{SERVER}");
+               if ($ret != 0) {
+                       sleep(1);
+               } else {
+                       system("$nmblookup $testenv_vars->{CONFIGURATION} -U 
$testenv_vars->{SERVER_IP} $testenv_vars->{SERVER}");
+                       system("$nmblookup $testenv_vars->{CONFIGURATION} 
$testenv_vars->{NETBIOSNAME}");
+                       system("$nmblookup $testenv_vars->{CONFIGURATION} -U 
$testenv_vars->{SERVER_IP} $testenv_vars->{NETBIOSNAME}");
+                       system("$nmblookup $testenv_vars->{CONFIGURATION} 
$testenv_vars->{NETBIOSNAME}");
+                       system("$nmblookup $testenv_vars->{CONFIGURATION} -U 
$testenv_vars->{SERVER_IP} $testenv_vars->{NETBIOSNAME}");
+                       system("$nmblookup $testenv_vars->{CONFIGURATION} 
$testenv_vars->{SERVER}");
+                       system("$nmblookup $testenv_vars->{CONFIGURATION} -U 
$testenv_vars->{SERVER_IP} $testenv_vars->{SERVER}");
+                       system("$nmblookup $testenv_vars->{CONFIGURATION} 
$testenv_vars->{NETBIOSNAME}");
+                       system("$nmblookup $testenv_vars->{CONFIGURATION} -U 
$testenv_vars->{SERVER_IP} $testenv_vars->{NETBIOSNAME}");
+                       system("$nmblookup $testenv_vars->{CONFIGURATION} 
$testenv_vars->{NETBIOSNAME}");
+                       system("$nmblookup $testenv_vars->{CONFIGURATION} -U 
$testenv_vars->{SERVER_IP} $testenv_vars->{NETBIOSNAME}");
+               }
+               $count++;
+       } while ($ret != 0 && $count < 20);
+       if ($count == 10) {
+               warn("nbt not reachable after 20 retries\n");
+               teardown_env($self, $testenv_vars);
+               return 0;
+       }
 
        # Ensure we have the first RID Set before we start tests.  This makes 
the tests more reliable.
        if ($testenv_vars->{SERVER_ROLE} eq "domain controller" and not 
($testenv_vars->{NETBIOSNAME} eq "RODC")) {
-           # Add hosts file for name lookups
-           $ENV{NSS_WRAPPER_HOSTS} = $testenv_vars->{NSS_WRAPPER_HOSTS};
+               # Add hosts file for name lookups
+               $ENV{NSS_WRAPPER_HOSTS} = $testenv_vars->{NSS_WRAPPER_HOSTS};
                if (defined($testenv_vars->{RESOLV_WRAPPER_CONF})) {
                        $ENV{RESOLV_WRAPPER_CONF} = 
$testenv_vars->{RESOLV_WRAPPER_CONF};
                } else {
@@ -215,8 +225,8 @@ sub wait_for_start($$)
            my $base_dn = "DC=".join(",DC=", split(/\./, 
$testenv_vars->{REALM}));
            my $rid_set_dn = "cn=RID 
Set,cn=$testenv_vars->{NETBIOSNAME},ou=domain controllers,$base_dn";
            my $max_wait = 60;
-           sleep(1);
-           while (system("$ldbsearch -H ldap://$testenv_vars->{SERVER} 
-U$testenv_vars->{USERNAME}%$testenv_vars->{PASSWORD} -s base -b 
\"$rid_set_dn\" rIDAllocationPool > /dev/null") != 0) {
+           my $cmd = "$ldbsearch $testenv_vars->{CONFIGURATION} -H 
ldap://$testenv_vars->{SERVER} 
-U$testenv_vars->{USERNAME}%$testenv_vars->{PASSWORD} -s base -b 
\"$rid_set_dn\" rIDAllocationPool";
+           while (system("$cmd >/dev/null") != 0) {
                $count++;
                if ($count > $max_wait) {
                    warn("Timed out ($max_wait sec) waiting for working LDAP 
and a RID Set to be allocated by $testenv_vars->{NETBIOSNAME} PID 
$testenv_vars->{SAMBA_PID}");
@@ -946,7 +956,7 @@ $extra_smbconf_shares
 sub provision_s4member($$$)
 {
        my ($self, $prefix, $dcvars) = @_;
-       print "PROVISIONING MEMBER...";
+       print "PROVISIONING MEMBER...\n";
        my $extra_smb_conf = "
         passdb backend = samba_dsdb
 winbindd:use external pipes = true
@@ -1016,7 +1026,7 @@ rpc_server:tcpip = no
 sub provision_rpc_proxy($$$)
 {
        my ($self, $prefix, $dcvars) = @_;
-       print "PROVISIONING RPC PROXY...";
+       print "PROVISIONING RPC PROXY...\n";
 
        my $extra_smbconf_options = "
         passdb backend = samba_dsdb
@@ -1049,7 +1059,6 @@ sub provision_rpc_proxy($$$)
                                   $dcvars->{SERVER_IP},
                                   $dcvars->{SERVER_IPV6},
                                   $extra_smbconf_options, "", undef);
-
        unless ($ret) {
                return undef;
        }
@@ -1119,7 +1128,7 @@ sub provision_rpc_proxy($$$)
 sub provision_promoted_dc($$$)
 {
        my ($self, $prefix, $dcvars) = @_;
-       print "PROVISIONING PROMOTED DC...";
+       print "PROVISIONING PROMOTED DC...\n";
 
        # We do this so that we don't run the provision.  That's the job of 
'samba-tool domain dcpromo'.
        my $ctx = $self->provision_raw_prepare($prefix, "domain controller",
@@ -1201,7 +1210,7 @@ sub provision_promoted_dc($$$)
 sub provision_vampire_dc($$$)
 {
        my ($self, $prefix, $dcvars) = @_;
-       print "PROVISIONING VAMPIRE DC...";
+       print "PROVISIONING VAMPIRE DC...\n";
 
        # We do this so that we don't run the provision.  That's the job of 
'net vampire'.
        my $ctx = $self->provision_raw_prepare($prefix, "domain controller",
@@ -1271,7 +1280,7 @@ sub provision_vampire_dc($$$)
 sub provision_subdom_dc($$$)
 {
        my ($self, $prefix, $dcvars) = @_;
-       print "PROVISIONING SUBDOMAIN DC...";
+       print "PROVISIONING SUBDOMAIN DC...\n";
 
        # We do this so that we don't run the provision.  That's the job of 
'net vampire'.
        my $ctx = $self->provision_raw_prepare($prefix, "domain controller",
@@ -1347,7 +1356,7 @@ sub provision_ad_dc_ntvfs($$)
        # ensure upgrades which used that name still work with the now
        # alias.
 
-       print "PROVISIONING AD DC (NTVFS)...";
+       print "PROVISIONING AD DC (NTVFS)...\n";
         my $extra_conf_options = "netbios aliases = localDC1-a
         server services = +winbind -winbindd
        ldap server require strong auth = allow_sasl_over_tls
@@ -1364,8 +1373,10 @@ sub provision_ad_dc_ntvfs($$)
                                   $extra_conf_options,
                                   "",
                                   undef);
+       unless ($ret) {
+               return undef;
+       }
 
-       return undef unless(defined $ret);
        unless($self->add_wins_config("$prefix/private")) {
                warn("Unable to add wins configuration");
                return undef;
@@ -1386,7 +1397,7 @@ sub provision_fl2000dc($$)
 {
        my ($self, $prefix) = @_;
 
-       print "PROVISIONING DC WITH FOREST LEVEL 2000...";
+       print "PROVISIONING DC WITH FOREST LEVEL 2000...\n";
        my $extra_conf_options = "
        spnego:simulate_w2k=yes
        ntlmssp_server:force_old_spnego=yes
@@ -1403,6 +1414,9 @@ sub provision_fl2000dc($$)
                                   $extra_conf_options,
                                   "",
                                   undef);
+       unless ($ret) {
+               return undef;
+       }
 
        unless($self->add_wins_config("$prefix/private")) {
                warn("Unable to add wins configuration");
@@ -1425,7 +1439,7 @@ sub provision_fl2003dc($$$)
        my $swiface1 = Samba::get_interface("fakednsforwarder1");
        my $swiface2 = Samba::get_interface("fakednsforwarder2");
 
-       print "PROVISIONING DC WITH FOREST LEVEL 2003...";
+       print "PROVISIONING DC WITH FOREST LEVEL 2003...\n";
        my $extra_conf_options = "allow dns updates = nonsecure and secure
        dns forwarder = 127.0.0.$swiface1 127.0.0.$swiface2";
        my $ret = $self->provision($prefix,
@@ -1440,7 +1454,6 @@ sub provision_fl2003dc($$$)
                                   $extra_conf_options,
                                   "",
                                   undef);
-
        unless (defined $ret) {
                return undef;
        }
@@ -1482,7 +1495,7 @@ sub provision_fl2008r2dc($$$)
 {
        my ($self, $prefix, $dcvars) = @_;
 
-       print "PROVISIONING DC WITH FOREST LEVEL 2008r2...";
+       print "PROVISIONING DC WITH FOREST LEVEL 2008r2...\n";
         my $extra_conf_options = "ldap server require strong auth = no";
        my $ret = $self->provision($prefix,
                                   "domain controller",
@@ -1496,6 +1509,9 @@ sub provision_fl2008r2dc($$$)
                                   $extra_conf_options,
                                   "",
                                   undef);
+       unless (defined $ret) {
+               return undef;
+       }
 
        unless ($self->add_wins_config("$prefix/private")) {
                warn("Unable to add wins configuration");
@@ -1516,7 +1532,7 @@ sub provision_fl2008r2dc($$$)
 sub provision_rodc($$$)
 {
        my ($self, $prefix, $dcvars) = @_;
-       print "PROVISIONING RODC...";
+       print "PROVISIONING RODC...\n";
 
        # We do this so that we don't run the provision.  That's the job of 
'net join RODC'.
        my $ctx = $self->provision_raw_prepare($prefix, "domain controller",
@@ -1707,7 +1723,7 @@ sub provision_ad_dc($$)
        copy = print1
 ";
 
-       print "PROVISIONING AD DC...";
+       print "PROVISIONING AD DC...\n";
        my $ret = $self->provision($prefix,
                                   "domain controller",
                                   "addc",
@@ -1720,8 +1736,10 @@ sub provision_ad_dc($$)
                                   $extra_smbconf_options,
                                   $extra_smbconf_shares,
                                   undef);
+       unless (defined $ret) {
+               return undef;
+       }
 
-       return undef unless(defined $ret);
        unless($self->add_wins_config("$prefix/private")) {
                warn("Unable to add wins configuration");
                return undef;
@@ -1741,7 +1759,7 @@ sub provision_chgdcpass($$)
 {
        my ($self, $prefix) = @_;
 
-       print "PROVISIONING CHGDCPASS...";
+       print "PROVISIONING CHGDCPASS...\n";
        my $extra_provision_options = undef;
        push (@{$extra_provision_options}, "--dns-backend=BIND9_DLZ");
        my $ret = $self->provision($prefix,
@@ -1756,8 +1774,10 @@ sub provision_chgdcpass($$)
                                   "",
                                   "",
                                   $extra_provision_options);
+       unless (defined $ret) {
+               return undef;
+       }
 
-       return undef unless(defined $ret);
        unless($self->add_wins_config("$prefix/private")) {
                warn("Unable to add wins configuration");
                return undef;


-- 
Samba Shared Repository

Reply via email to