selftest: Do not skip environments that fail to start up
authorAndrew Bartlett <abartlet@samba.org>
Thu, 23 Feb 2012 05:34:47 +0000 (16:34 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 23 Feb 2012 09:55:20 +0000 (10:55 +0100)
This is a regression in 70f4a96c68e91e407651e2487cc3c66a80262fa2.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Thu Feb 23 10:55:20 CET 2012 on sn-devel-104

selftest/selftest.pl
selftest/target/Samba.pm

index 4625172..72e9ddf 100755 (executable)
@@ -888,7 +888,7 @@ sub setup_env($$)
                        $testenv_vars->{target} = $target;
                }
                if (not defined($testenv_vars)) {
-                       warn("$opt_target can't provide environment '$envname'");
+                       warn("$opt_target can't start up known environment '$envname'");
                }
        }
 
index eea1987..445cbb2 100644 (file)
@@ -31,7 +31,7 @@ sub setup_env($$$)
            if (not defined($env->{target})) {
                $env->{target} = $self->{samba4};
            }
-       } else {
+       } elsif (defined($env) and $env eq "UNKNOWN") {
                $env = $self->{samba3}->setup_env($envname, $path);
                if (defined($env) and $env ne "UNKNOWN") {
                    if (not defined($env->{target})) {
@@ -39,8 +39,12 @@ sub setup_env($$$)
                    }
                }
        }
-       if (not defined $env) {
+       if (defined($env) and ($env eq "UNKNOWN")) {
                warn("Samba can't provide environment '$envname'");
+               return "UNKNOWN";
+       }
+       if (not defined $env) {
+               warn("failed to start up environment '$envname'");
                return undef;
        }
        return $env;