summaryrefslogtreecommitdiff
path: root/source4/script/tests
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-04-19 14:54:09 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:51:10 -0500
commite2deb0013687ebd887241f81cf616a06d4b1a08d (patch)
treebd466fc204059ce59cb8b415ad1dff4a767bff84 /source4/script/tests
parent49f71c5c970e51a8918b3624e4f41d99751b4a2a (diff)
downloadsamba-e2deb0013687ebd887241f81cf616a06d4b1a08d.tar.gz
samba-e2deb0013687ebd887241f81cf616a06d4b1a08d.tar.bz2
samba-e2deb0013687ebd887241f81cf616a06d4b1a08d.zip
r22375: implement check_env() logic in the frontend
metze (This used to be commit 0b48ca5d3ebe8fe29774d85ee15e473af8c0714d)
Diffstat (limited to 'source4/script/tests')
-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);