From c006b9b898e93149f83969d0b1d8e4dafc6fbfeb Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 14 Feb 2012 09:04:16 +1100 Subject: [PATCH] selftest: skip targets that are not compiled in if we do not have ADS --- selftest/target/Samba3.pm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm index 70c320bc0e7..e8a03e71dc1 100755 --- a/selftest/target/Samba3.pm +++ b/selftest/target/Samba3.pm @@ -11,6 +11,21 @@ use FindBin qw($RealBin); use POSIX; use target::Samba; +sub have_ads($) { + my ($self); + my $found_ads = 0; + my $smbd_build_options = Samba::bindir_path($self, "smbd") . " -b"; + my @build_options = `$smbd_build_options`; + foreach my $option (@build_options) { + if ($option =~ "WITH_ADS") { + $found_ads = 1; + } + } + + # If we were not built with ADS support, pretend we were never even available + return $found_ads; +} + sub new($$) { my ($classname, $bindir, $binary_mapping, $srcdir, $server_maxtime) = @_; my $self = { vars => {}, @@ -206,6 +221,11 @@ sub setup_admember($$$$) { my ($self, $prefix, $dcvars, $iface) = @_; + # If we didn't build with ADS, pretend this env was never available + if (not $self->have_ads()) { + return "UNKNOWN"; + } + print "PROVISIONING S3 AD MEMBER$iface..."; my $member_options = " @@ -414,6 +434,11 @@ sub setup_ktest($$$) { my ($self, $prefix) = @_; + # If we didn't build with ADS, pretend this env was never available + if (not $self->have_ads()) { + return "UNKNOWN"; + } + print "PROVISIONING server with security=ads..."; my $ktest_options = " -- 2.34.1