summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/script/tests/Samba3.pm8
-rw-r--r--source4/script/tests/Samba4.pm8
-rwxr-xr-xsource4/script/tests/selftest.pl22
3 files changed, 37 insertions, 1 deletions
diff --git a/source4/script/tests/Samba3.pm b/source4/script/tests/Samba3.pm
index 478a79e2af..f040432ce6 100644
--- a/source4/script/tests/Samba3.pm
+++ b/source4/script/tests/Samba3.pm
@@ -47,6 +47,14 @@ sub getlog_env($$)
return "";
}
+sub check_env($$)
+{
+ my ($self, $envvars) = @_;
+
+ # TODO ...
+ return 1;
+}
+
sub setup_env($$$)
{
my ($self, $envname, $path) = @_;
diff --git a/source4/script/tests/Samba4.pm b/source4/script/tests/Samba4.pm
index d0f66f1a8d..4ab720c7bf 100644
--- a/source4/script/tests/Samba4.pm
+++ b/source4/script/tests/Samba4.pm
@@ -675,6 +675,14 @@ sub getlog_env($$)
return $out;
}
+sub check_env($$)
+{
+ my ($self, $envvars) = @_;
+
+ # TODO ...
+ return 1;
+}
+
sub setup_env($$$)
{
my ($self, $envname, $path) = @_;
diff --git a/source4/script/tests/selftest.pl b/source4/script/tests/selftest.pl
index ddbd538ec9..2fa8075602 100755
--- a/source4/script/tests/selftest.pl
+++ b/source4/script/tests/selftest.pl
@@ -679,11 +679,17 @@ sub setup_env($)
my $testenv_vars;
if (defined($running_envs{$envname})) {
$testenv_vars = $running_envs{$envname};
+ if (not $target->check_env($testenv_vars)) {
+ $testenv_vars = undef;
+ }
} elsif ($envname eq "none") {
$testenv_vars = {};
} else {
$testenv_vars = $target->setup_env($envname, $prefix);
}
+
+ return undef unless defined($testenv_vars);
+
write_clientconf($conffile, $testenv_vars);
foreach ("PASSWORD", "DOMAIN", "SERVER", "USERNAME", "NETBIOSNAME",
"KRB5_CONFIG", "REALM") {
@@ -707,6 +713,13 @@ sub getlog_env($)
return $target->getlog_env($running_envs{$envname});
}
+sub check_env($)
+{
+ my ($envname) = @_;
+ return 1 if ($envname eq "none");
+ return $target->check_env($running_envs{$envname});
+}
+
sub teardown_env($)
{
my ($envname) = @_;
@@ -750,7 +763,14 @@ NETBIOSNAME=\$NETBIOSNAME\" && bash'");
next;
}
- setup_env($envname);
+ my $envvars = setup_env($envname);
+ if (not defined($envvars)) {
+ push(@$suitesfailed, $name);
+ $statistics->{SUITES_FAIL}++;
+ $statistics->{TESTS_ERROR}++;
+ print "FAIL: $name (ENV[$envname] not available!)\n";
+ next;
+ }
run_test($envname, $name, $cmd, $i, $suitestotal, $msg_ops);