summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-02-13 12:14:57 +1100
committerAndrew Bartlett <abartlet@samba.org>2012-02-13 04:41:05 +0100
commit70f4a96c68e91e407651e2487cc3c66a80262fa2 (patch)
tree9fa08c334fd15299e8c02f55136b2009432beb26
parent3bf922111a29277e390361c6f4cf7580ff4453e3 (diff)
downloadsamba-70f4a96c68e91e407651e2487cc3c66a80262fa2.tar.gz
samba-70f4a96c68e91e407651e2487cc3c66a80262fa2.tar.bz2
samba-70f4a96c68e91e407651e2487cc3c66a80262fa2.zip
selftest: Allow setup_env() to signal that an environment name is unknown
This will allow us to skip samba4 environments that may be mentioned in the source3/selftest/tests.py file. Andrew Bartlett
-rwxr-xr-xselftest/selftest.pl9
-rw-r--r--selftest/target/Samba.pm4
-rwxr-xr-xselftest/target/Samba3.pm2
-rw-r--r--selftest/target/Samba4.pm2
4 files changed, 12 insertions, 5 deletions
diff --git a/selftest/selftest.pl b/selftest/selftest.pl
index e5ccbd8f37..462517271b 100755
--- a/selftest/selftest.pl
+++ b/selftest/selftest.pl
@@ -882,7 +882,9 @@ sub setup_env($$)
}
} else {
$testenv_vars = $target->setup_env($envname, $prefix);
- if (defined($testenv_vars) && not defined($testenv_vars->{target})) {
+ if (defined($testenv_vars) and $testenv_vars eq "UNKNOWN") {
+ return $testenv_vars;
+ } elsif (defined($testenv_vars) && not defined($testenv_vars->{target})) {
$testenv_vars->{target} = $target;
}
if (not defined($testenv_vars)) {
@@ -1024,6 +1026,11 @@ $envvarstr
Subunit::end_testsuite($name, "error",
"unable to set up environment $envname - exiting");
next;
+ } elsif ($envvars eq "UNKNOWN") {
+ Subunit::start_testsuite($name);
+ Subunit::end_testsuite($name, "skip",
+ "environment $envname is unknown in this test backend - skipping");
+ next;
}
# Generate a file with the individual tests to run, if the
diff --git a/selftest/target/Samba.pm b/selftest/target/Samba.pm
index 64bc405137..eea1987a4a 100644
--- a/selftest/target/Samba.pm
+++ b/selftest/target/Samba.pm
@@ -27,13 +27,13 @@ sub setup_env($$$)
$ENV{ENVNAME} = $envname;
my $env = $self->{samba4}->setup_env($envname, $path);
- if (defined($env)) {
+ if (defined($env) and $env ne "UNKNOWN") {
if (not defined($env->{target})) {
$env->{target} = $self->{samba4};
}
} else {
$env = $self->{samba3}->setup_env($envname, $path);
- if (defined($env)) {
+ if (defined($env) and $env ne "UNKNOWN") {
if (not defined($env->{target})) {
$env->{target} = $self->{samba3};
}
diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index b710d5466d..7ecb481a46 100755
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -112,7 +112,7 @@ sub setup_env($$$)
}
return $self->setup_member("$path/member", $self->{vars}->{s3dc});
} else {
- return undef;
+ return "UNKNOWN";
}
}
diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm
index 52c6d680d7..8ac3ee7eaf 100644
--- a/selftest/target/Samba4.pm
+++ b/selftest/target/Samba4.pm
@@ -1429,7 +1429,7 @@ sub setup_env($$$)
} elsif ($envname eq "plugin_s4_dc") {
return $self->setup_plugin_s4_dc("$path/plugin_s4_dc");
} else {
- return undef;
+ return "UNKNOWN";
}
}