summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-09-14 14:36:56 +0200
committerJelmer Vernooij <jelmer@samba.org>2010-09-14 17:24:04 +0200
commitd98754ca93bae4740a84118dc4e33e07b4d16e09 (patch)
treea0dc32d37425608f634cb13d0c89b09343d761ec
parent73edd661eaec3b1f0d8705d545160ff4a2d97948 (diff)
downloadsamba-d98754ca93bae4740a84118dc4e33e07b4d16e09.tar.gz
samba-d98754ca93bae4740a84118dc4e33e07b4d16e09.tar.bz2
samba-d98754ca93bae4740a84118dc4e33e07b4d16e09.zip
selftest: If setting up environment fails, mark testsuites that use it as
errorring, don't skip it.
-rwxr-xr-xselftest/selftest.pl17
1 files changed, 5 insertions, 12 deletions
diff --git a/selftest/selftest.pl b/selftest/selftest.pl
index 42852a192a..090e87bc59 100755
--- a/selftest/selftest.pl
+++ b/selftest/selftest.pl
@@ -156,7 +156,6 @@ my $ldap = undef;
my $opt_analyse_cmd = undef;
my $opt_resetup_env = undef;
my $opt_bindir = undef;
-my $opt_no_lazy_setup = undef;
my $opt_load_list = undef;
my @testlists = ();
@@ -351,7 +350,6 @@ my $result = GetOptions (
'testenv' => \$opt_testenv,
'ldap:s' => \$ldap,
'analyse-cmd=s' => \$opt_analyse_cmd,
- 'no-lazy-setup' => \$opt_no_lazy_setup,
'resetup-environment' => \$opt_resetup_env,
'bindir:s' => \$opt_bindir,
'image=s' => \$opt_image,
@@ -613,8 +611,6 @@ my @todo = ();
my $testsdir = "$srcdir/selftest";
-my %required_envs = ();
-
sub should_run_test($)
{
my $name = shift;
@@ -646,7 +642,6 @@ sub read_testlist($)
my $cmdline = <IN>;
$cmdline =~ s/\n//g;
if (should_run_test($name) == 1) {
- $required_envs{$env} = 1;
push (@ret, [$name, $env, $cmdline, $supports_loadlist]);
}
} else {
@@ -907,16 +902,14 @@ sub teardown_env($)
# This 'global' file needs to be empty when we start
unlink("$prefix_abs/dns_host_file");
-if ($opt_no_lazy_setup) {
- setup_env($_) foreach (keys %required_envs);
-}
-
if ($opt_testenv) {
my $testenv_name = $ENV{SELFTEST_TESTENV};
$testenv_name = $testenv_default unless defined($testenv_name);
my $testenv_vars = setup_env($testenv_name);
+ die("Unable to setup environment $testenv_name") unless ($testenv_vars);
+
$ENV{PIDDIR} = $testenv_vars->{PIDDIR};
my $envvarstr = exported_envvars_str($testenv_vars);
@@ -945,7 +938,8 @@ $envvarstr
my $envvars = setup_env($envname);
if (not defined($envvars)) {
- Subunit::skip_testsuite($name,
+ Subunit::start_testsuite($name);
+ Subunit::end_testsuite($name, "error",
"unable to set up environment $envname");
next;
}
@@ -960,8 +954,7 @@ $envvarstr
$cmd .= " --load-list=$listid_file";
}
- run_testsuite($envname, $name, $cmd, $i, $suitestotal,
- );
+ run_testsuite($envname, $name, $cmd, $i, $suitestotal);
if (defined($opt_analyse_cmd)) {
system("$opt_analyse_cmd \"$name\"");