diff options
Diffstat (limited to 'selftest/target')
-rwxr-xr-x | selftest/target/Samba3.pm | 61 |
1 files changed, 33 insertions, 28 deletions
diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm index 6e45159f0e..bd277d22ad 100755 --- a/selftest/target/Samba3.pm +++ b/selftest/target/Samba3.pm @@ -675,7 +675,7 @@ sub check_or_start($$$$$) { close(STDIN_READER); - return $self->wait_for_start($env_vars); + return $self->wait_for_start($env_vars, $nmbd, $winbindd, $smbd); } sub provision($$$$$$) @@ -1094,38 +1094,43 @@ domadmins:X:$gid_domadmins: return \%ret; } -sub wait_for_start($$) +sub wait_for_start($$$$$) { - my ($self, $envvars) = @_; - - # give time for nbt server to register its names - print "delaying for nbt name registration\n"; - sleep(10); - # 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, "nmblookup3"); - system("$nmblookup $envvars->{CONFIGURATION} -U $envvars->{SERVER_IP} __SAMBA__"); - system("$nmblookup $envvars->{CONFIGURATION} __SAMBA__"); - system("$nmblookup $envvars->{CONFIGURATION} -U 127.255.255.255 __SAMBA__"); - system("$nmblookup $envvars->{CONFIGURATION} -U $envvars->{SERVER_IP} $envvars->{SERVER}"); - system("$nmblookup $envvars->{CONFIGURATION} $envvars->{SERVER}"); + my ($self, $envvars, $nmbd, $winbindd, $smbd) = @_; + + if ($nmbd eq "yes") { + # give time for nbt server to register its names + print "delaying for nbt name registration\n"; + sleep(10); + # 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, "nmblookup3"); + system("$nmblookup $envvars->{CONFIGURATION} -U $envvars->{SERVER_IP} __SAMBA__"); + system("$nmblookup $envvars->{CONFIGURATION} __SAMBA__"); + system("$nmblookup $envvars->{CONFIGURATION} -U 127.255.255.255 __SAMBA__"); + system("$nmblookup $envvars->{CONFIGURATION} -U $envvars->{SERVER_IP} $envvars->{SERVER}"); + system("$nmblookup $envvars->{CONFIGURATION} $envvars->{SERVER}"); + } - # make sure smbd is also up set - print "wait for smbd\n"; + if ($smbd eq "yes") { + # make sure smbd is also up set + print "wait for smbd\n"; - my $count = 0; - my $ret; - do { - $ret = system(Samba::bindir_path($self, "smbclient3") ." $envvars->{CONFIGURATION} -L $envvars->{SERVER} -U% -p 139"); - if ($ret != 0) { - sleep(2); + my $count = 0; + my $ret; + do { + $ret = system(Samba::bindir_path($self, "smbclient3") ." $envvars->{CONFIGURATION} -L $envvars->{SERVER} -U% -p 139"); + if ($ret != 0) { + sleep(2); + } + $count++ + } while ($ret != 0 && $count < 10); + if ($count == 10) { + print "SMBD failed to start up in a reasonable time (20sec)\n"; + teardown_env($self, $envvars); + return 0; } - $count++ - } while ($ret != 0 && $count < 10); - if ($count == 10) { - print "SMBD failed to start up in a reasonable time (20sec)\n"; - teardown_env($self, $envvars); - return 0; } + # Ensure we have domain users mapped. $ret = system(Samba::bindir_path($self, "net") ." $envvars->{CONFIGURATION} groupmap add rid=513 unixgroup=domusers type=domain"); if ($ret != 0) { |