1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-08 04:58:40 +03:00

selftest: Use a unique hostname/IP for the no_nss testenv

The ad_dc_no_nss was re-using the ad_dc testenv but changing an
environment variable to disable the NSS wrapper module.

Presumably this would setup a second AD DC server with the same
hostname/IP as another DC (but with NSS disabled). This doesn't seem
like a good thing to be doing in the selftests. This patch changes
it so that the no_nss testenv uses a unique IP/hostname.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
This commit is contained in:
Tim Beale 2017-08-01 17:18:45 +12:00 committed by Andrew Bartlett
parent 8c56aa2c91
commit 25b9e06f4a
2 changed files with 34 additions and 7 deletions

View File

@ -346,6 +346,7 @@ sub get_interface($)
# 11-16 used by selftest.pl for client interfaces
$interfaces{"addc_no_nss"} = 17;
$interfaces{"addc_no_ntlm"} = 18;
$interfaces{"idmapadmember"} = 19;
$interfaces{"idmapridmember"} = 20;

View File

@ -2127,7 +2127,7 @@ sub setup_env($$$)
} elsif ($envname eq "ad_dc") {
return $self->setup_ad_dc("$path/ad_dc");
} elsif ($envname eq "ad_dc_no_nss") {
return $self->setup_ad_dc("$path/ad_dc_no_nss", "no_nss");
return $self->setup_ad_dc_no_nss("$path/ad_dc_no_nss");
} elsif ($envname eq "ad_dc_no_ntlm") {
return $self->setup_ad_dc_no_ntlm("$path/ad_dc_no_ntlm");
} elsif ($envname eq "ad_member_rfc2307") {
@ -2502,7 +2502,7 @@ sub setup_rodc($$$)
sub setup_ad_dc($$)
{
my ($self, $path, $no_nss) = @_;
my ($self, $path) = @_;
# If we didn't build with ADS, pretend this env was never available
if (not $self->{target3}->have_ads()) {
@ -2515,11 +2515,6 @@ sub setup_ad_dc($$)
return undef;
}
if (defined($no_nss) and $no_nss) {
$env->{NSS_WRAPPER_MODULE_SO_PATH} = undef;
$env->{NSS_WRAPPER_MODULE_FN_PREFIX} = undef;
}
if (not defined($self->check_or_start($env, "single"))) {
return undef;
}
@ -2533,6 +2528,37 @@ sub setup_ad_dc($$)
return $env;
}
sub setup_ad_dc_no_nss($$)
{
my ($self, $path) = @_;
# If we didn't build with ADS, pretend this env was never available
if (not $self->{target3}->have_ads()) {
return "UNKNOWN";
}
my $env = $self->provision_ad_dc($path, "addc_no_nss", "ADNONSSDOMAIN",
"adnonssdom.samba.example.com", "");
unless ($env) {
return undef;
}
$env->{NSS_WRAPPER_MODULE_SO_PATH} = undef;
$env->{NSS_WRAPPER_MODULE_FN_PREFIX} = undef;
if (not defined($self->check_or_start($env, "single"))) {
return undef;
}
my $upn_array = ["$env->{REALM}.upn"];
my $spn_array = ["$env->{REALM}.spn"];
$self->setup_namespaces($env, $upn_array, $spn_array);
$self->{vars}->{ad_dc_no_nss} = $env;
return $env;
}
sub setup_ad_dc_no_ntlm($$)
{
my ($self, $path) = @_;