selftest: Avoid system krb5.conf in "none" test env
authorUri Simchoni <uri@samba.org>
Mon, 26 Oct 2015 05:38:08 +0000 (07:38 +0200)
committerKarolin Seeger <kseeger@samba.org>
Wed, 28 Oct 2015 14:08:10 +0000 (15:08 +0100)
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.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11576

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit f9d6be3b749313a03e9097d848ce078f19197a0a)

Autobuild-User(v4-2-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-2-test): Wed Oct 28 15:08:10 CET 2015 on sn-devel-104

selftest/selftest.pl
selftest/target/Samba4.pm

index 96687ea2ea58f34fa7cc2f62ad0c40f72e1f1e4c..1d5826da5eac26f6b4ec3afad2a804e6a7c92c91 100755 (executable)
@@ -805,9 +805,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);
@@ -875,7 +873,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);
 }
index 26d9c00ef462ba2f0bb31ccd3c3b444e8e5dec22..ab3124858c95debab4d02e2ca6770d2418739c56 100755 (executable)
@@ -1743,8 +1743,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);
 }
@@ -1813,6 +1816,8 @@ sub setup_env($$$)
                }
                return $target3->setup_admember_rfc2307("$path/s3member_rfc2307",
                                                        $self->{vars}->{dc}, 34);
+       } elsif ($envname eq "none") {
+               return $self->setup_none("$path/none");
        } else {
                return "UNKNOWN";
        }
@@ -2128,4 +2133,14 @@ sub setup_plugin_s4_dc($$)
        return $env;
 }
 
+sub setup_none($$)
+{
+       my ($self, $path) = @_;
+
+       my $ret = {
+               KRB5_CONFIG => abs_path($path) . "/no_krb5.conf",
+               SAMBA_PID => -1,
+       }
+}
+
 1;