selftest: Define if we should fake dns resolving.
authorAndreas Schneider <asn@samba.org>
Mon, 3 Nov 2014 12:22:38 +0000 (13:22 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 18 Dec 2014 05:47:40 +0000 (06:47 +0100)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
selftest/selftest.pl
selftest/wscript

index 166d40aebe296610c8e8a6322910af81c9aa96ad..841dc537241772eb257b7f98e27dbb98c8bcf5cc 100755 (executable)
@@ -56,6 +56,7 @@ my $opt_libnss_wrapper_so_path = "";
 my $opt_libresolv_wrapper_so_path = "";
 my $opt_libsocket_wrapper_so_path = "";
 my $opt_libuid_wrapper_so_path = "";
+my $opt_use_dns_faking = 0;
 my @testlists = ();
 
 my $srcdir = ".";
@@ -205,6 +206,10 @@ Preload cwrap:
  --socket_wrapper_so_path=FILE the socket_wrapper library to preload
  --uid_wrapper_so_path=FILE the uid_wrapper library to preload
 
+DNS:
+  --use-dns-faking          Fake DNS entries rather than talking to our
+                            DNS implementation.
+
 Target Specific:
  --socket-wrapper-pcap      save traffic to pcap directories
  --socket-wrapper-keep-pcap keep all pcap files, not just those for tests that 
@@ -247,7 +252,8 @@ my $result = GetOptions (
                'nss_wrapper_so_path=s' => \$opt_libnss_wrapper_so_path,
                'resolv_wrapper_so_path=s' => \$opt_libresolv_wrapper_so_path,
                'socket_wrapper_so_path=s' => \$opt_libsocket_wrapper_so_path,
-               'uid_wrapper_so_path=s' => \$opt_libuid_wrapper_so_path
+               'uid_wrapper_so_path=s' => \$opt_libuid_wrapper_so_path,
+               'use-dns-faking' => \$opt_use_dns_faking
            );
 
 exit(1) if (not $result);
@@ -399,6 +405,11 @@ if ($opt_socket_wrapper) {
         }
 }
 
+if ($opt_use_dns_faking) {
+       print "DNS: Faking namerserver\n";
+       $ENV{SAMBA_DNS_FAKING} = 1;
+}
+
 my $target;
 my $testenv_default = "none";
 
index fd3c89a0f3b5020079ba8ed1f4a5e3da9aca0ab7..94232d3aac134a45dea0b5ef2164d1953a0721e7 100644 (file)
@@ -215,6 +215,9 @@ def cmd_testonly(opt):
     env.OPTIONS += " --socket_wrapper_so_path=" + CONFIG_GET(opt, 'LIBSOCKET_WRAPPER_SO_PATH')
     env.OPTIONS += " --uid_wrapper_so_path=" + CONFIG_GET(opt, 'LIBUID_WRAPPER_SO_PATH')
 
+    if unversioned_sys_platform in ('freebsd', 'netbsd', 'openbsd', 'sunos'):
+        env.OPTIONS += " --use-dns-faking"
+
     subunit_cache = None
     # We use the full path rather than relative path to avoid problems on some platforms (ie. solaris 8).
     env.CORE_COMMAND = '${PERL} ${srcdir}/selftest/selftest.pl --target=${SELFTEST_TARGET} --prefix=${SELFTEST_PREFIX} --srcdir=${srcdir} --exclude=${srcdir}/selftest/skip ${TESTLISTS} ${OPTIONS} ${TESTS}'