summaryrefslogtreecommitdiff
path: root/selftest/selftest.pl
diff options
context:
space:
mode:
authorJamie McClymont <jamiemcclymont@catalyst.net.nz>2018-02-21 13:33:49 +1300
committerAndrew Bartlett <abartlet@samba.org>2018-02-21 02:47:15 +0100
commit962e8a0ea7db79b96dddec06a4bde211eea0d1d6 (patch)
tree07ff332e8863f84eedafb8d7f543d41d316b5ad0 /selftest/selftest.pl
parent41085ad37de56504467a0014b70f6a708dcde91b (diff)
downloadsamba-962e8a0ea7db79b96dddec06a4bde211eea0d1d6.tar.gz
selftest: move to declaratively specifying environments and their dependencies
This removes the tangle of code for starting up dependencies, and allows selftest.pl to query dependencies (hence it can know when things can be shut down early and how to order environments for optimal memory usage - that patch not yet submitted). It also removes the slightly hacky special-casing of the ad_members, and sets $target->{vars} centrally (so each setup_ function does not need to). Signed-off-by: Jamie McClymont <jamiemcclymont@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'selftest/selftest.pl')
-rwxr-xr-xselftest/selftest.pl14
1 files changed, 8 insertions, 6 deletions
diff --git a/selftest/selftest.pl b/selftest/selftest.pl
index 64fb9f85d3a..c48e1926520 100755
--- a/selftest/selftest.pl
+++ b/selftest/selftest.pl
@@ -85,7 +85,12 @@ sub find_in_list($$)
sub skip
{
- my ($name) = @_;
+ my ($name, $envname) = @_;
+ my ($env_basename, $env_localpart) = split(/:/, $envname);
+
+ if ($opt_target eq "samba3" && $Samba::ENV_NEEDS_AD_DC{$env_basename}) {
+ return "environment $envname is disabled as this build does not include an AD DC";
+ }
return find_in_list(\@excludes, $name);
}
@@ -449,15 +454,12 @@ if (defined($ENV{SMBD_MAXTIME}) and $ENV{SMBD_MAXTIME} ne "") {
$server_maxtime = $ENV{SMBD_MAXTIME};
}
+$target = new Samba($bindir, $ldap, $srcdir, $server_maxtime);
unless ($opt_list) {
if ($opt_target eq "samba") {
$testenv_default = "ad_dc";
- require target::Samba;
- $target = new Samba($bindir, $ldap, $srcdir, $server_maxtime);
} elsif ($opt_target eq "samba3") {
$testenv_default = "nt4_member";
- require target::Samba3;
- $target = new Samba3($bindir, $srcdir_abs, $server_maxtime);
}
}
@@ -725,7 +727,7 @@ $individual_tests = {};
foreach my $testsuite (@available) {
my $name = $$testsuite[0];
- my $skipreason = skip($name);
+ my $skipreason = skip(@$testsuite);
if (defined($restricted)) {
# Find the testsuite for this test
my $match = undef;