svn commit: samba r22375 - in
branches/SAMBA_4_0/source/script/tests: .
metze at samba.org
metze at samba.org
Thu Apr 19 14:54:10 GMT 2007
Author: metze
Date: 2007-04-19 14:54:09 +0000 (Thu, 19 Apr 2007)
New Revision: 22375
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22375
Log:
implement check_env() logic in the frontend
metze
Modified:
branches/SAMBA_4_0/source/script/tests/Samba3.pm
branches/SAMBA_4_0/source/script/tests/Samba4.pm
branches/SAMBA_4_0/source/script/tests/selftest.pl
Changeset:
Modified: branches/SAMBA_4_0/source/script/tests/Samba3.pm
===================================================================
--- branches/SAMBA_4_0/source/script/tests/Samba3.pm 2007-04-19 14:51:46 UTC (rev 22374)
+++ branches/SAMBA_4_0/source/script/tests/Samba3.pm 2007-04-19 14:54:09 UTC (rev 22375)
@@ -47,6 +47,14 @@
return "";
}
+sub check_env($$)
+{
+ my ($self, $envvars) = @_;
+
+ # TODO ...
+ return 1;
+}
+
sub setup_env($$$)
{
my ($self, $envname, $path) = @_;
Modified: branches/SAMBA_4_0/source/script/tests/Samba4.pm
===================================================================
--- branches/SAMBA_4_0/source/script/tests/Samba4.pm 2007-04-19 14:51:46 UTC (rev 22374)
+++ branches/SAMBA_4_0/source/script/tests/Samba4.pm 2007-04-19 14:54:09 UTC (rev 22375)
@@ -675,6 +675,14 @@
return $out;
}
+sub check_env($$)
+{
+ my ($self, $envvars) = @_;
+
+ # TODO ...
+ return 1;
+}
+
sub setup_env($$$)
{
my ($self, $envname, $path) = @_;
Modified: branches/SAMBA_4_0/source/script/tests/selftest.pl
===================================================================
--- branches/SAMBA_4_0/source/script/tests/selftest.pl 2007-04-19 14:51:46 UTC (rev 22374)
+++ branches/SAMBA_4_0/source/script/tests/selftest.pl 2007-04-19 14:54:09 UTC (rev 22375)
@@ -679,11 +679,17 @@
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 @@
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 @@
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);
More information about the samba-cvs
mailing list