summaryrefslogtreecommitdiff
path: root/selftest
diff options
context:
space:
mode:
authorUri Simchoni <uri@samba.org>2015-10-26 07:38:08 +0200
committerAndrew Bartlett <abartlet@samba.org>2015-10-27 00:28:34 +0100
commitf9d6be3b749313a03e9097d848ce078f19197a0a (patch)
tree884af7380bcb50483cfeac27427310415a4d059d /selftest
parent8d3106b1a4d9da5bf8b127fa70a77076d3dfeca8 (diff)
downloadsamba-f9d6be3b749313a03e9097d848ce078f19197a0a.tar.gz
selftest: Avoid system krb5.conf in "none" test env
Some torture tests do not perform Kerberos activity and do not run against a server (hence the "none" test env), but do create a krb5 context, and that causes the Kerberos libs to read krb5.conf and choke if they don't understand it. Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'selftest')
-rwxr-xr-xselftest/selftest.pl5
-rwxr-xr-xselftest/target/Samba4.pm17
2 files changed, 17 insertions, 5 deletions
diff --git a/selftest/selftest.pl b/selftest/selftest.pl
index 779847f05a8..db5da05091e 100755
--- a/selftest/selftest.pl
+++ b/selftest/selftest.pl
@@ -831,9 +831,7 @@ sub setup_env($$)
$option = "client" if $option eq "";
- if ($envname eq "none") {
- $testenv_vars = {};
- } elsif (defined(get_running_env($envname))) {
+ if (defined(get_running_env($envname))) {
$testenv_vars = get_running_env($envname);
if (not $testenv_vars->{target}->check_env($testenv_vars)) {
print $testenv_vars->{target}->getlog_env($testenv_vars);
@@ -901,7 +899,6 @@ sub getlog_env($)
sub check_env($)
{
my ($envname) = @_;
- return 1 if ($envname eq "none");
my $env = get_running_env($envname);
return $env->{target}->check_env($env);
}
diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm
index c32830d94b9..65308e293e0 100755
--- a/selftest/target/Samba4.pm
+++ b/selftest/target/Samba4.pm
@@ -1999,8 +1999,11 @@ sub getlog_env($$)
sub check_env($$)
{
my ($self, $envvars) = @_;
+ my $samba_pid = $envvars->{SAMBA_PID};
- my $childpid = Samba::cleanup_child($envvars->{SAMBA_PID}, "samba");
+ return 1 if $samba_pid == -1;
+
+ my $childpid = Samba::cleanup_child($samba_pid, "samba");
return ($childpid == 0);
}
@@ -2077,6 +2080,8 @@ sub setup_env($$$)
}
return $target3->setup_admember_rfc2307("$path/ad_member_rfc2307",
$self->{vars}->{ad_dc_ntvfs}, 34);
+ } elsif ($envname eq "none") {
+ return $self->setup_none("$path/none");
} else {
return "UNKNOWN";
}
@@ -2479,4 +2484,14 @@ sub setup_ad_dc($$)
return $env;
}
+sub setup_none($$)
+{
+ my ($self, $path) = @_;
+
+ my $ret = {
+ KRB5_CONFIG => abs_path($path) . "/no_krb5.conf",
+ SAMBA_PID => -1,
+ }
+}
+
1;