selftest: skip targets that are not compiled in if we do not have ADS
authorAndrew Bartlett <abartlet@samba.org>
Mon, 13 Feb 2012 22:04:16 +0000 (09:04 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 16 Feb 2012 04:21:10 +0000 (15:21 +1100)
selftest/target/Samba3.pm

index 70c320bc0e7576b34a6bb14efde250358a606fb6..e8a03e71dc14982f7715658232a709e300478bcd 100755 (executable)
@@ -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 = "