summaryrefslogtreecommitdiff
path: root/selftest
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-02-18 10:35:24 +1100
committerAndrew Bartlett <abartlet@samba.org>2012-02-18 00:44:07 +0100
commitdd479bd2927a6b470e2b6c6b89ef0e4fdd457d55 (patch)
treeb7fe11df5f03c4fb7d7e44ec733b308632d0dc0e /selftest
parent32c82fe69b588fe18674c0bda49cd7fc0f73f50a (diff)
downloadsamba-dd479bd2927a6b470e2b6c6b89ef0e4fdd457d55.tar.gz
samba-dd479bd2927a6b470e2b6c6b89ef0e4fdd457d55.tar.bz2
samba-dd479bd2927a6b470e2b6c6b89ef0e4fdd457d55.zip
selftest: Fix selftest to check ADS functionalty again
This was found by looking over the lcov output on build.samba.org The new have_ads() check also now dies if it cannot run smbd, to avoid this in future. Andrew Bartlett
Diffstat (limited to 'selftest')
-rwxr-xr-xselftest/target/Samba3.pm18
1 files changed, 10 insertions, 8 deletions
diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index e8a03e71dc..269601470e 100755
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -12,15 +12,17 @@ use POSIX;
use target::Samba;
sub have_ads($) {
- my ($self);
+ 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;
- }
- }
+ my $smbd_build_options = Samba::bindir_path($self, "smbd") . " -b|";
+ open(IN, $smbd_build_options) or die("Unable to run $smbd_build_options: $!");
+
+ while (<IN>) {
+ if (/WITH_ADS/) {
+ $found_ads = 1;
+ }
+ }
+ close IN;
# If we were not built with ADS support, pretend we were never even available
return $found_ads;