summaryrefslogtreecommitdiff
path: root/selftest
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-04-18 13:44:36 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-04-19 10:03:49 +1000
commitd041ed233d1b10604ef1b9f7f1e68f6f5cd96132 (patch)
treeadfecdd6cd94ff4afa4a1f432b419254d69f9480 /selftest
parent29d8c597fc0414658b6234b0bbc136670228e108 (diff)
downloadsamba-d041ed233d1b10604ef1b9f7f1e68f6f5cd96132.tar.gz
samba-d041ed233d1b10604ef1b9f7f1e68f6f5cd96132.tar.bz2
samba-d041ed233d1b10604ef1b9f7f1e68f6f5cd96132.zip
selftest: put the target on the environment
This will allow us to have a 'switch' target type that creates environments from Samba3 or Samba4 as required. Andrew Bartlett
Diffstat (limited to 'selftest')
-rwxr-xr-xselftest/selftest.pl16
1 files changed, 11 insertions, 5 deletions
diff --git a/selftest/selftest.pl b/selftest/selftest.pl
index 69c95e9152..c4afde75c0 100755
--- a/selftest/selftest.pl
+++ b/selftest/selftest.pl
@@ -865,12 +865,15 @@ sub setup_env($$)
$testenv_vars = {};
} elsif (defined(get_running_env($envname))) {
$testenv_vars = get_running_env($envname);
- if (not $target->check_env($testenv_vars)) {
- print $target->getlog_env($testenv_vars);
+ if (not $testenv_vars->{target}->check_env($testenv_vars)) {
+ print $testenv_vars->{target}->getlog_env($testenv_vars);
$testenv_vars = undef;
}
} else {
$testenv_vars = $target->setup_env($envname, $prefix);
+ if (defined($testenv_vars) && not defined($testenv_vars->{target})) {
+ $testenv_vars->{target} = $target;
+ }
}
return undef unless defined($testenv_vars);
@@ -916,21 +919,24 @@ sub getlog_env($)
{
my ($envname) = @_;
return "" if ($envname eq "none");
- return $target->getlog_env(get_running_env($envname));
+ my $env = get_running_env($envname);
+ return $env->{target}->getlog_env($env);
}
sub check_env($)
{
my ($envname) = @_;
return 1 if ($envname eq "none");
- return $target->check_env(get_running_env($envname));
+ my $env = get_running_env($envname);
+ return $env->{target}->check_env($env);
}
sub teardown_env($)
{
my ($envname) = @_;
return if ($envname eq "none");
- $target->teardown_env(get_running_env($envname));
+ my $env = get_running_env($envname);
+ $env->{target}->teardown_env($env);
delete $running_envs{$envname};
}