[SCM] Samba Shared Repository - branch master updated

Andreas Schneider asn at samba.org
Fri Mar 27 10:40:02 UTC 2020


The branch, master has been updated
       via  a85fadaefc6 selftest: we no longer need '--use-dns-faking' on Linux and FreeBSD
       via  05d3a909d5a selftest: use 10.53.57.0/8 instead of 127.0.0.1/8
       via  83f6ff9006c selftest: pass ipv4 and ipv6 listener addresses to dns_hub.py
       via  6b249437bdc selftest: let realm_to_ip_mappings() return stable (sorted) results
       via  0bc9987049b selftest: {offlinebackupdc,restoredc,customdc} are disconnected from other environments
       via  c5e478216f1 selftest: correctly use RESOLV_CONF from the DC environment or "no_resolv.conf"
       via  678651a73b7 selftest: always explicitly use RESOLV_CONF
       via  8133c5787b6 selftest: split out Samba::mk_resolv_conf() helper
       via  1e9697c4d20 selftest: we have a global $ENV{UID_WRAPPER} = 1, don't set it again
       via  b6af0a268c8 selftest: let get_env_for_process() include RESOLV_CONF
       via  f1f43f13317 selftest: handle proc{killdom,limit}.samba.example.com in dns_hub
       via  ffa40fa90fb selftest: allow dns_hub.py to do forwarding to ipv6 servers
       via  25ba290d18c selftest: allow dns_hub.py to listen on more than one address
       via  2d1d67ed725 selftest: make sure dns_hub.py exits on SIGINT
       via  4d6864e08e5 samba_dnsupdate: fix delete (samba-tool) message
       via  88500f7326a samba_dnsupdate: fix --no-credentials handling
       via  72bbd170fc3 python/netcmd/dns: improve exception handling in cmd_add_record()
       via  23bd1eff751 python/netcmd/dns: improve exception handling in cmd_delete_record()
       via  cefa9be9d7d librpc/tests: make use of replace.h in test_ndr*.c
       via  bc94d9878da s4:torture/ldb: fix the build on FreeBSD
       via  1c0eed6ba72 s3:util_sec: fix the build on non-linux platforms
      from  fe78216b1cf smbd: use a helper variable in filename_convert_internal()

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit a85fadaefc6b51891b3fa7808bd7c9257060e5d1
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Jan 24 00:23:34 2019 +0100

    selftest: we no longer need '--use-dns-faking' on Linux and FreeBSD
    
    For now I'll leave it arround for others I haven't tested.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    
    Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
    Autobuild-Date(master): Fri Mar 27 10:39:32 UTC 2020 on sn-devel-184

commit 05d3a909d5a66ab2b9a6b00416b7087588dbdef9
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Jan 23 22:29:19 2019 +0100

    selftest: use 10.53.57.0/8 instead of 127.0.0.1/8
    
    This makes our testing much more realistic and allows
    the removal of some knowfail entries.
    
    It also means the testing with network namespaces on Linux
    can use the same addresses as our socket wrapper testing.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 83f6ff9006c74e60d84f38151589958769e45bdf
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Mar 11 17:03:01 2020 +0100

    selftest: pass ipv4 and ipv6 listener addresses to dns_hub.py
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 6b249437bdc98bd4dd72364690b6230898de1e57
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Mar 11 16:57:02 2020 +0100

    selftest: let realm_to_ip_mappings() return stable (sorted) results
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 0bc9987049b0f890c2d41f19ea64bb513abe7b6f
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Oct 31 15:39:53 2019 +0100

    selftest: {offlinebackupdc,restoredc,customdc} are disconnected from other environments
    
    These restore copies of others and better use their own resolv.conf
    and use '--use-samba-tool --no-credentials' for samba_dnsupdate in order
    to avoid talking to the real environments.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit c5e478216f18eb2e7b5115cb7626070eb65e21b0
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Feb 27 12:33:48 2020 +0100

    selftest: correctly use RESOLV_CONF from the DC environment or "no_resolv.conf"
    
    It's important to have the correct $resolv_conf variable within
    provision(), because it also sets "RESOLV_WRAPPER_CONF" if needed,
    instead of just setting "RESOLV_CONF".
    
    There's also no point in creating an resolv.conf with the ip addresses
    for other roles than "active directory domain controller".
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 678651a73b767e4182f7b825860c760a69e80ccc
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Oct 30 18:17:36 2019 +0100

    selftest: always explicitly use RESOLV_CONF
    
    By default point RESOLV_CONF to a non-existing file and
    use the per environment RESOLV_CONF explicitly where needed.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 8133c5787b6a5142ffbb9c3818eb7e01239005d8
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Oct 31 15:37:40 2019 +0100

    selftest: split out Samba::mk_resolv_conf() helper
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 1e9697c4d20c507c345995b36eed3e7d0e8b4e37
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Feb 27 12:30:43 2020 +0100

    selftest: we have a global $ENV{UID_WRAPPER} = 1, don't set it again
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit b6af0a268c80b6ebba1c1bf3e7b318dc534ecb61
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Feb 27 11:21:51 2020 +0100

    selftest: let get_env_for_process() include RESOLV_CONF
    
    This is needed for all environments not just "samba".
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit f1f43f13317423e63109e72af9a80e3f20f599c9
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Feb 27 01:47:31 2020 +0100

    selftest: handle proc{killdom,limit}.samba.example.com in dns_hub
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit ffa40fa90fb84931ec542849d6c24da1021c5960
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Mar 11 17:09:13 2020 +0100

    selftest: allow dns_hub.py to do forwarding to ipv6 servers
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 25ba290d18ccba7a9ed674720770888b5a3a2b10
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Mar 11 16:55:33 2020 +0100

    selftest: allow dns_hub.py to listen on more than one address
    
    This makes it possible to serve ipv4 and ipv6 at the same time.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 2d1d67ed725348b7a6bf8ea9f0a7554a198c1363
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Mar 13 07:06:05 2020 +0100

    selftest: make sure dns_hub.py exits on SIGINT
    
    Otherwise we have a deadlock in the python threading
    that prevents out EOF detection on stdin to work
    if someone aborts 'make test' with strg+c.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 4d6864e08e5e7da282581c412f880e5d3fe7e0dd
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Nov 5 11:25:52 2019 +0100

    samba_dnsupdate: fix delete (samba-tool) message
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 88500f7326a617a859f70e17869b34611a33e38e
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Nov 5 11:25:14 2019 +0100

    samba_dnsupdate: fix --no-credentials handling
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 72bbd170fc326a4e0a9e953b23ad0b90d01742c5
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Nov 5 11:23:48 2019 +0100

    python/netcmd/dns: improve exception handling in cmd_add_record()
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 23bd1eff751fad67a5caacd9fbc2911cd85f8e49
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Nov 5 11:23:48 2019 +0100

    python/netcmd/dns: improve exception handling in cmd_delete_record()
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit cefa9be9d7d9877a1d00caaf5c536f08ecdee0f4
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Feb 27 01:51:18 2020 +0100

    librpc/tests: make use of replace.h in test_ndr*.c
    
    This fixes the build on FreeBSD 12.1 and maybe other systems.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit bc94d9878da15253d617f6f772eb0d8e02929620
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Nov 6 08:49:30 2019 +0100

    s4:torture/ldb: fix the build on FreeBSD
    
    clock_t is 'int' instead' of 'long' there.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 1c0eed6ba7225fa6b655b3770228d2018fbeb3c4
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Nov 6 08:47:31 2019 +0100

    s3:util_sec: fix the build on non-linux platforms
    
    This fixes a regression introduced by
    "util_sec.c: Move __thread variable to global scope"
    (5a80f399b51221fb0b8661f30d940ca24e1ce627).
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 librpc/tests/test_ndr.c                |  4 +-
 librpc/tests/test_ndr_macros.c         |  4 +-
 librpc/tests/test_ndr_string.c         |  4 +-
 python/samba/netcmd/dns.py             |  8 +++-
 python/samba/tests/blackbox/mdfind.py  |  2 +-
 python/samba/tests/dcerpc/mdssvc.py    |  2 +-
 python/samba/tests/param.py            |  2 +-
 selftest/knownfail.d/dns               |  8 ----
 selftest/ns/README                     | 18 ++++----
 selftest/selftest.pl                   |  5 ++
 selftest/target/Samba.pm               | 29 ++++++++----
 selftest/target/Samba3.pm              | 51 +++++++--------------
 selftest/target/Samba4.pm              | 70 +++++++++++++++++++++++-----
 selftest/target/dns_hub.py             | 84 +++++++++++++++++++++++++++-------
 selftest/wscript                       |  7 +--
 source3/lib/util_sec.c                 |  8 ++--
 source3/script/tests/test_async_req.sh |  3 ++
 source4/scripting/bin/samba_dnsupdate  |  4 +-
 source4/selftest/tests.py              |  4 +-
 source4/torture/ldb/ldb.c              |  4 +-
 20 files changed, 204 insertions(+), 117 deletions(-)


Changeset truncated at 500 lines:

diff --git a/librpc/tests/test_ndr.c b/librpc/tests/test_ndr.c
index 316c54368a0..a26c75ab053 100644
--- a/librpc/tests/test_ndr.c
+++ b/librpc/tests/test_ndr.c
@@ -32,9 +32,7 @@
  * library functions and types.
  *
  */
-#include <stdarg.h>
-#include <stddef.h>
-#include <stdint.h>
+#include "replace.h"
 #include <setjmp.h>
 #include <cmocka.h>
 
diff --git a/librpc/tests/test_ndr_macros.c b/librpc/tests/test_ndr_macros.c
index 0cd20d3e8f3..337bc95b57a 100644
--- a/librpc/tests/test_ndr_macros.c
+++ b/librpc/tests/test_ndr_macros.c
@@ -32,9 +32,7 @@
  * library functions and types.
  *
  */
-#include <stdarg.h>
-#include <stddef.h>
-#include <stdint.h>
+#include "replace.h"
 #include <setjmp.h>
 #include <cmocka.h>
 
diff --git a/librpc/tests/test_ndr_string.c b/librpc/tests/test_ndr_string.c
index b3b297c550c..571aae42f34 100644
--- a/librpc/tests/test_ndr_string.c
+++ b/librpc/tests/test_ndr_string.c
@@ -32,9 +32,7 @@
  * library functions and types.
  *
  */
-#include <stdarg.h>
-#include <stddef.h>
-#include <stdint.h>
+#include "replace.h"
 #include <setjmp.h>
 #include <cmocka.h>
 
diff --git a/python/samba/netcmd/dns.py b/python/samba/netcmd/dns.py
index 6cf8d40b2aa..6faa54d1a8e 100644
--- a/python/samba/netcmd/dns.py
+++ b/python/samba/netcmd/dns.py
@@ -941,7 +941,9 @@ class cmd_add_record(Command):
                                          0, server, zone, name, add_rec_buf, None)
         except WERRORError as e:
             if e.args[0] == werror.WERR_DNS_ERROR_NAME_DOES_NOT_EXIST:
-                raise CommandError('Zone does not exist; record could not be added.')
+                raise CommandError('Zone does not exist; record could not be added. zone[%s] name[%s]' % (zone, name))
+            if e.args[0] == werror.WERR_DNS_ERROR_RECORD_ALREADY_EXISTS:
+                raise CommandError('Record already exist; record could not be added. zone[%s] name[%s]' % (zone, name))
             raise e
 
         self.outf.write('Record added successfully\n')
@@ -1067,7 +1069,9 @@ class cmd_delete_record(Command):
                                          del_rec_buf)
         except WERRORError as e:
             if e.args[0] == werror.WERR_DNS_ERROR_NAME_DOES_NOT_EXIST:
-                raise CommandError('Zone does not exist; record could not be deleted.')
+                raise CommandError('Zone does not exist; record could not be deleted. zone[%s] name[%s]' % (zone, name))
+            if e.args[0] == werror.WERR_DNS_ERROR_RECORD_DOES_NOT_EXIST:
+                raise CommandError('Record does not exist; record could not be deleted. zone[%s] name[%s]' % (zone, name))
             raise e
 
         self.outf.write('Record deleted successfully\n')
diff --git a/python/samba/tests/blackbox/mdfind.py b/python/samba/tests/blackbox/mdfind.py
index e00af054007..5c1c0c3d155 100644
--- a/python/samba/tests/blackbox/mdfind.py
+++ b/python/samba/tests/blackbox/mdfind.py
@@ -67,7 +67,7 @@ class MdfindBlackboxTests(BlackboxTestCase):
     def setUp(self):
         super(MdfindBlackboxTests, self).setUp()
 
-        self.server = HTTPServer(('127.0.0.35', 8080),
+        self.server = HTTPServer(('10.53.57.35', 8080),
                                  MdssvcHTTPRequestHandler,
                                  bind_and_activate=False)
 
diff --git a/python/samba/tests/dcerpc/mdssvc.py b/python/samba/tests/dcerpc/mdssvc.py
index 68243aa4354..b0df509ddc7 100644
--- a/python/samba/tests/dcerpc/mdssvc.py
+++ b/python/samba/tests/dcerpc/mdssvc.py
@@ -77,7 +77,7 @@ class MdssvcTests(RpcInterfaceTestCase):
 
         self.pipe = mdssvc.mdssvc('ncacn_np:fileserver[/pipe/mdssvc]', self.get_loadparm())
 
-        self.server = HTTPServer(('127.0.0.35', 8080),
+        self.server = HTTPServer(('10.53.57.35', 8080),
                                  MdssvcHTTPRequestHandler,
                                  bind_and_activate=False)
 
diff --git a/python/samba/tests/param.py b/python/samba/tests/param.py
index 0a7f86adad7..ae58074b80b 100644
--- a/python/samba/tests/param.py
+++ b/python/samba/tests/param.py
@@ -98,7 +98,7 @@ class LoadParmTestCase(samba.tests.TestCaseInTempDir):
                                                     'global',
                                                     self.tempf))
         content = open(self.tempf, 'r').read()
-        self.assertIn('127.0.0.', content)
+        self.assertIn('10.53.57.', content)
 
     def test_samdb_url(self):
         samba_lp = param.LoadParm()
diff --git a/selftest/knownfail.d/dns b/selftest/knownfail.d/dns
index 70a719a818a..bf563632472 100644
--- a/selftest/knownfail.d/dns
+++ b/selftest/knownfail.d/dns
@@ -6,7 +6,6 @@ samba.tests.dns.__main__.TestDNSUpdates.test_delete_record\(rodc:local\)
 samba.tests.dns.__main__.TestDNSUpdates.test_readd_record\(rodc:local\)
 samba.tests.dns.__main__.TestDNSUpdates.test_update_add_mx_record\(rodc:local\)
 samba.tests.dns.__main__.TestDNSUpdates.test_update_add_txt_record\(rodc:local\)
-samba.tests.dns.__main__.TestInvalidQueries.test_one_a_query\(rodc:local\)
 samba.tests.dns.__main__.TestRPCRoundtrip.test_update_add_empty_txt_records\(rodc:local\)
 samba.tests.dns.__main__.TestRPCRoundtrip.test_update_add_hex_char_txt_record\(rodc:local\)
 samba.tests.dns.__main__.TestRPCRoundtrip.test_update_add_null_char_txt_record\(rodc:local\)
@@ -18,7 +17,6 @@ samba.tests.dns.__main__.TestDNSUpdates.test_delete_record\(vampire_dc:local\)
 samba.tests.dns.__main__.TestDNSUpdates.test_readd_record\(vampire_dc:local\)
 samba.tests.dns.__main__.TestDNSUpdates.test_update_add_mx_record\(vampire_dc:local\)
 samba.tests.dns.__main__.TestDNSUpdates.test_update_add_txt_record\(vampire_dc:local\)
-samba.tests.dns.__main__.TestInvalidQueries.test_one_a_query\(vampire_dc:local\)
 samba.tests.dns.__main__.TestRPCRoundtrip.test_update_add_empty_txt_records\(vampire_dc:local\)
 samba.tests.dns.__main__.TestRPCRoundtrip.test_update_add_hex_char_txt_record\(vampire_dc:local\)
 samba.tests.dns.__main__.TestRPCRoundtrip.test_update_add_null_char_txt_record\(vampire_dc:local\)
@@ -63,12 +61,6 @@ samba.tests.dns.__main__.TestZones.test_static_record_dynamic_update\(vampire_dc
 
 samba.tests.dns.__main__.TestComplexQueries.test_cname_two_chain\(vampire_dc:local\)
 samba.tests.dns.__main__.TestComplexQueries.test_one_a_query\(vampire_dc:local\)
-samba.tests.dns.__main__.TestSimpleQueries.test_one_a_query\(vampire_dc:local\)
-samba.tests.dns.__main__.TestSimpleQueries.test_one_a_query_tcp\(vampire_dc:local\)
-samba.tests.dns.__main__.TestSimpleQueries.test_qtype_all_query\(vampire_dc:local\)
-samba.tests.dns.__main__.TestSimpleQueries.test_one_a_query\(rodc:local\)
-samba.tests.dns.__main__.TestSimpleQueries.test_one_a_query_tcp\(rodc:local\)
-samba.tests.dns.__main__.TestSimpleQueries.test_qtype_all_query\(rodc:local\)
 
 # The SOA override should not pass against the RODC, it must not overstamp
 samba.tests.dns.__main__.TestSimpleQueries.test_one_SOA_query\(rodc:local\)
diff --git a/selftest/ns/README b/selftest/ns/README
index a8ad1c0444f..896fe15fff7 100644
--- a/selftest/ns/README
+++ b/selftest/ns/README
@@ -26,10 +26,10 @@ selftest namespace (which itself is a child of whatever namespace you run
 
 How does it work?
 =================
-Normally when 'make test' is run, every testenv uses a 127.0.0.x IP address
+Normally when 'make test' is run, every testenv uses a 10.53.57.x IP address
 and socket-wrapper passes the packets between them.
 
-With namespaces, we can use real IP addresses and have the packets pass through
+With namespaces, we also use 10.53.57.x IP addresses but have the packets pass through
 the kernel's IP stack normally, as it forwards them between namespaces.
 
 We use veth interfaces for this. veth is a type of virtual interface supported
@@ -43,7 +43,7 @@ namespace, and the other end is added to a new namespace that we'll run
 samba in. E.g.
 
 selftest.pl  veth21-br ------------------------ veth21 samba (ad_dc_ntvfs)
-             10.0.0.11                          10.0.0.21
+             10.53.57.11                          10.53.57.21
  Namespace 1                                       Namespace 2
 
 However, we need to run multiple different testenvs and have them talk to
@@ -52,11 +52,11 @@ up the namespaces, which essentially just acts as a hub. So connecting together
 multiple testenvs looks more like this:
 
 selftest.pl     +-- veth21-br ------------------------ veth21 samba (ad_dc_ntvfs)
-                |                                      10.0.0.21
+                |                                      10.53.57.21
     selftest0 --+                                        Namespace 2
-    10.0.0.11   |
+    10.53.57.11   |
                 +-- veth22-br ------------------------ veth22 samba (vampire_dc)
-                                                       10.0.0.22
+                                                       10.53.57.22
  Namespace 1                                             Namespace 3      
 
 The veth interfaces are named vethX and vethX-br, where X is the
@@ -114,7 +114,7 @@ sudo ip link set testenv-veth1 netns $SELFTEST_PID
 4. Configure the veth end in the default namespace to be in the same subnet
 as the selftest network:
 sudo ip link set dev testenv-veth0 up
-sudo ip addr add 10.0.0.63/24 dev testenv-veth0
+sudo ip addr add 10.53.57.63/24 dev testenv-veth0
 
 5. Enter the selftest namespace, bring that end of the pipe up, and add it to
 to the main selftest0 bridge (that connects all the DCs together). We also need
@@ -122,14 +122,14 @@ to add a default route from selftest back to your PC's default namespace.
 nsenter -t $SELFTEST_PID --net --user --preserve-credentials
 ip link set dev testenv-veth1 up
 ip link set testenv-veth1 master selftest0
-ip route add default via 10.0.0.63
+ip route add default via 10.53.57.63
 logout
 
 Your Windows VM and samba testenv should now be able to talk to each
 other over IP!
 
 6. The other step is to get DNS working. You probably need to add dns_hub
-(10.0.0.64) as a nameserver (at least on your Windows VM).
+(10.53.57.64) as a nameserver (at least on your Windows VM).
 
 This should work for using RSAT tools on samba, or joining Windows to Samba
 (depending on the schema version). Joining samba to Windows is a bit more
diff --git a/selftest/selftest.pl b/selftest/selftest.pl
index be83a0bd0e6..d14df92a11c 100755
--- a/selftest/selftest.pl
+++ b/selftest/selftest.pl
@@ -487,6 +487,7 @@ foreach (@opt_include) {
 # We give the selftest client 6 different IPv4 addresses to use. Most tests
 # only use the first (.11) IP. Note that winsreplication.c is one test that
 # uses the other IPs (search for iface_list_count()).
+$ENV{SOCKET_WRAPPER_IPV4_NETWORK} = "10.53.57.0";
 my $interfaces = Samba::get_interfaces_config("client", 6);
 
 my $clientdir = "$prefix_abs/client";
@@ -686,6 +687,9 @@ if ($opt_quick) {
 }
 $ENV{SELFTEST_MAXTIME} = $torture_maxtime;
 
+my $selftest_resolv_conf_path = "$tmpdir_abs/selftest.resolv.conf";
+$ENV{RESOLV_CONF} = "${selftest_resolv_conf_path}.global";
+
 my $selftest_krbt_ccache_path = "$tmpdir_abs/selftest.krb5_ccache";
 $ENV{KRB5CCNAME} = "FILE:${selftest_krbt_ccache_path}.global";
 
@@ -823,6 +827,7 @@ sub setup_env($$)
 	delete $ENV{SOCKET_WRAPPER_DEFAULT_IFACE};
 	delete $ENV{SMB_CONF_PATH};
 
+	$ENV{RESOLV_CONF} = "${selftest_resolv_conf_path}.${envname}/ignore";
 	$ENV{KRB5CCNAME} = "FILE:${selftest_krbt_ccache_path}.${envname}/ignore";
 
 	if (defined(get_running_env($envname))) {
diff --git a/selftest/target/Samba.pm b/selftest/target/Samba.pm
index 5a20311ea88..e415110d8e7 100644
--- a/selftest/target/Samba.pm
+++ b/selftest/target/Samba.pm
@@ -113,6 +113,7 @@ sub setup_env($$$)
 	# Avoid hitting system krb5.conf -
 	# An env that needs Kerberos will reset this to the real value.
 	$ENV{KRB5_CONFIG} = "$path/no_krb5.conf";
+	$ENV{RESOLV_CONF} = "$path/no_resolv.conf";
 
 	my $setup_name = $ENV_TARGETS{$envname}."::setup_".$envname;
 	my $setup_sub = \&$setup_name;
@@ -436,6 +437,20 @@ sub mk_mitkdc_conf($$)
 	close(KDCCONF);
 }
 
+sub mk_resolv_conf($$)
+{
+	my ($ctx) = @_;
+
+	unless (open(RESOLV_CONF, ">$ctx->{resolv_conf}")) {
+		warn("can't open $ctx->{resolv_conf}$?");
+		return undef;
+	}
+
+	print RESOLV_CONF "nameserver $ctx->{dns_ipv4}\n";
+	print RESOLV_CONF "nameserver $ctx->{dns_ipv6}\n";
+	close(RESOLV_CONF);
+}
+
 sub realm_to_ip_mappings
 {
 	# this maps the DNS realms for the various testenvs to the corresponding
@@ -453,6 +468,8 @@ sub realm_to_ip_mappings
 		'renamedom.samba.example.com'     => 'renamedc',
 		'labdom.samba.example.com'        => 'labdc',
 		'schema.samba.example.com'        => 'liveupgrade1dc',
+		'prockilldom.samba.example.com'   => 'prockilldc',
+		'proclimit.samba.example.com'     => 'proclimitdc',
 		'samba.example.com'               => 'localdc',
 	);
 
@@ -460,7 +477,8 @@ sub realm_to_ip_mappings
 
 	# convert the hashmap to a list of key=value strings, where key is the
 	# realm and value is the IP address
-	while (my ($realm, $pdc) = each(%realm_to_pdc_mapping)) {
+	foreach my $realm (sort(keys %realm_to_pdc_mapping)) {
+		my $pdc = $realm_to_pdc_mapping{$realm};
 		my $ipaddr = get_ipv4_addr($pdc);
 		push(@mapping, "$realm=$ipaddr");
 	}
@@ -558,13 +576,7 @@ sub get_ipv4_addr
 		$swiface += $iface_num;
 	}
 
-	if (use_namespaces()) {
-		# use real IPs if selftest is running in its own network namespace
-		return "10.0.0.$swiface";
-	} else {
-		# use loopback IPs with socket-wrapper
-		return "127.0.0.$swiface";
-	}
+	return "10.53.57.$swiface";
 }
 
 sub get_ipv6_addr
@@ -651,6 +663,7 @@ sub get_env_for_process
 {
 	my ($proc_name, $env_vars) = @_;
 	my $proc_envs = {
+		RESOLV_CONF => $env_vars->{RESOLV_CONF},
 		KRB5_CONFIG => $env_vars->{KRB5_CONFIG},
 		KRB5CCNAME => "$env_vars->{KRB5_CCACHE}.$proc_name",
 		SELFTEST_WINBINDD_SOCKET_DIR => $env_vars->{SELFTEST_WINBINDD_SOCKET_DIR},
diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index 92d6ce3d719..fe871af4573 100755
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -686,8 +686,7 @@ sub setup_ad_member
 	    server => "LOCALADMEMBER",
 	    password => "loCalMemberPass",
 	    extra_options => $member_options,
-	    dc_server_ip => $dcvars->{SERVER_IP},
-	    dc_server_ipv6 => $dcvars->{SERVER_IPV6});
+	    resolv_conf => $dcvars->{RESOLV_CONF});
 
 	$ret or return undef;
 
@@ -710,7 +709,6 @@ sub setup_ad_member
 	Samba::mk_krb5_conf($ctx, "");
 
 	$ret->{KRB5_CONFIG} = $ctx->{krb5_conf};
-	$ret->{RESOLV_CONF} = $dcvars->{RESOLV_CONF};
 
 	my $net = Samba::bindir_path($self, "net");
 	# Add hosts file for name lookups
@@ -721,6 +719,7 @@ sub setup_ad_member
 	} else {
 		$cmd .= "RESOLV_WRAPPER_HOSTS=\"$ret->{RESOLV_WRAPPER_HOSTS}\" ";
 	}
+	$cmd .= "RESOLV_CONF=\"$ret->{RESOLV_CONF}\" ";
 	$cmd .= "KRB5_CONFIG=\"$ret->{KRB5_CONFIG}\" ";
 	$cmd .= "SELFTEST_WINBINDD_SOCKET_DIR=\"$ret->{SELFTEST_WINBINDD_SOCKET_DIR}\" ";
 	$cmd .= "$net join $ret->{CONFIGURATION}";
@@ -810,8 +809,7 @@ sub setup_ad_member_rfc2307
 	    server => "RFC2307MEMBER",
 	    password => "loCalMemberPass",
 	    extra_options => $member_options,
-	    dc_server_ip => $dcvars->{SERVER_IP},
-	    dc_server_ipv6 => $dcvars->{SERVER_IPV6});
+	    resolv_conf => $dcvars->{RESOLV_CONF});
 
 	$ret or return undef;
 
@@ -833,7 +831,6 @@ sub setup_ad_member_rfc2307
 	Samba::mk_krb5_conf($ctx, "");
 
 	$ret->{KRB5_CONFIG} = $ctx->{krb5_conf};
-	$ret->{RESOLV_CONF} = $dcvars->{RESOLV_CONF};
 
 	my $net = Samba::bindir_path($self, "net");
 	# Add hosts file for name lookups
@@ -844,6 +841,7 @@ sub setup_ad_member_rfc2307
 	} else {
 		$cmd .= "RESOLV_WRAPPER_HOSTS=\"$ret->{RESOLV_WRAPPER_HOSTS}\" ";
 	}
+	$cmd .= "RESOLV_CONF=\"$ret->{RESOLV_CONF}\" ";
 	$cmd .= "KRB5_CONFIG=\"$ret->{KRB5_CONFIG}\" ";
 	$cmd .= "SELFTEST_WINBINDD_SOCKET_DIR=\"$ret->{SELFTEST_WINBINDD_SOCKET_DIR}\" ";
 	$cmd .= "$net join $ret->{CONFIGURATION}";
@@ -908,8 +906,7 @@ sub setup_ad_member_idmap_rid
 	    server => "IDMAPRIDMEMBER",
 	    password => "loCalMemberPass",
 	    extra_options => $member_options,
-	    dc_server_ip => $dcvars->{SERVER_IP},
-	    dc_server_ipv6 => $dcvars->{SERVER_IPV6});
+	    resolv_conf => $dcvars->{RESOLV_CONF});
 
 	$ret or return undef;
 
@@ -931,7 +928,6 @@ sub setup_ad_member_idmap_rid
 	Samba::mk_krb5_conf($ctx, "");
 
 	$ret->{KRB5_CONFIG} = $ctx->{krb5_conf};
-	$ret->{RESOLV_CONF} = $dcvars->{RESOLV_CONF};
 
 	my $net = Samba::bindir_path($self, "net");
 	# Add hosts file for name lookups
@@ -942,6 +938,7 @@ sub setup_ad_member_idmap_rid
 	} else {
 		$cmd .= "RESOLV_WRAPPER_HOSTS=\"$ret->{RESOLV_WRAPPER_HOSTS}\" ";
 	}
+	$cmd .= "RESOLV_CONF=\"$ret->{RESOLV_CONF}\" ";
 	$cmd .= "KRB5_CONFIG=\"$ret->{KRB5_CONFIG}\" ";
 	$cmd .= "SELFTEST_WINBINDD_SOCKET_DIR=\"$ret->{SELFTEST_WINBINDD_SOCKET_DIR}\" ";
 	$cmd .= "$net join $ret->{CONFIGURATION}";
@@ -1005,8 +1002,7 @@ sub setup_ad_member_idmap_ad
 	    server => "IDMAPADMEMBER",
 	    password => "loCalMemberPass",
 	    extra_options => $member_options,
-	    dc_server_ip => $dcvars->{SERVER_IP},
-	    dc_server_ipv6 => $dcvars->{SERVER_IPV6});
+	    resolv_conf => $dcvars->{RESOLV_CONF});
 
 	$ret or return undef;
 
@@ -1028,7 +1024,6 @@ sub setup_ad_member_idmap_ad
 	Samba::mk_krb5_conf($ctx, "");
 
 	$ret->{KRB5_CONFIG} = $ctx->{krb5_conf};
-	$ret->{RESOLV_CONF} = $dcvars->{RESOLV_CONF};
 
 	my $net = Samba::bindir_path($self, "net");
 	# Add hosts file for name lookups
@@ -1039,6 +1034,7 @@ sub setup_ad_member_idmap_ad
 	} else {
 		$cmd .= "RESOLV_WRAPPER_HOSTS=\"$ret->{RESOLV_WRAPPER_HOSTS}\" ";
 	}
+	$cmd .= "RESOLV_CONF=\"$ret->{RESOLV_CONF}\" ";
 	$cmd .= "KRB5_CONFIG=\"$ret->{KRB5_CONFIG}\" ";
 	$cmd .= "SELFTEST_WINBINDD_SOCKET_DIR=\"$ret->{SELFTEST_WINBINDD_SOCKET_DIR}\" ";
 	$cmd .= "$net join $ret->{CONFIGURATION}";
@@ -1254,11 +1250,12 @@ sub setup_fileserver
 	my $dropbox_sharedir="$share_dir/dropbox";
 	push(@dirs,$dropbox_sharedir);
 
+	my $ip4 = Samba::get_ipv4_addr("FILESERVER");
 	my $fileserver_options = "
 	kernel change notify = yes
 	rpc_server:mdssvc = embedded
 	spotlight backend = elasticsearch
-	elasticsearch:address = 127.0.0.35
+	elasticsearch:address = $ip4
 	elasticsearch:port = 8080
 	elasticsearch:mappings = $srcdir_abs/source3/rpc_server/mdssvc/elasticsearch_mappings.json
 
@@ -1736,8 +1733,7 @@ sub provision($$)
 	my $server = $args{server};
 	my $password = $args{password};
 	my $extra_options = $args{extra_options};
-	my $dc_server_ip = $args{dc_server_ip};
-	my $dc_server_ipv6 = $args{dc_server_ipv6};
+	my $resolv_conf = $args{resolv_conf};
 	my $no_delete_prefix= $args{no_delete_prefix};
 	my $netbios_name = $args{netbios_name} // $server;
 
@@ -1939,7 +1935,6 @@ sub provision($$)
 	my $nss_wrapper_passwd = "$privatedir/passwd";
 	my $nss_wrapper_group = "$privatedir/group";
 	my $nss_wrapper_hosts = "$ENV{SELFTEST_PREFIX}/hosts";
-	my $resolv_conf = "$privatedir/resolv.conf";
 	my $dns_host_file = "$ENV{SELFTEST_PREFIX}/dns_host_file";
 
 	my $mod_printer_pl = "$ENV{PERL} $self->{srcdir}/source3/script/tests/printing/modprinter.pl";
@@ -2726,23 +2721,7 @@ force_user:x:$gid_force_user:
 	print HOSTS "${server_ipv6} ${hostname}.samba.example.com ${hostname}\n";
 	close(HOSTS);
 
-	## hosts
-	unless (open(RESOLV_CONF, ">$resolv_conf")) {
-		warn("Unable to open $resolv_conf");
-		return undef;
-	}
-	if (defined($dc_server_ip) or defined($dc_server_ipv6)) {
-		if (defined($dc_server_ip)) {
-			print RESOLV_CONF "nameserver $dc_server_ip\n";
-		}
-		if (defined($dc_server_ipv6)) {
-			print RESOLV_CONF "nameserver $dc_server_ipv6\n";
-		}
-	} else {
-		print RESOLV_CONF "nameserver ${server_ip}\n";
-		print RESOLV_CONF "nameserver ${server_ipv6}\n";
-	}
-	close(RESOLV_CONF);
+	$resolv_conf = "$privatedir/no_resolv.conf" unless defined($resolv_conf);
 
 	foreach my $evlog (@eventlog_list) {
 		my $evlogtdb = "$eventlogdir/$evlog.tdb";
@@ -2759,6 +2738,7 @@ force_user:x:$gid_force_user:
 	} else {
 		$createuser_env{RESOLV_WRAPPER_CONF} = $resolv_conf;
 	}
+	$createuser_env{RESOLV_CONF} = $resolv_conf;
 
 	createuser($self, $unix_name, $password, $conffile, \%createuser_env) || die("Unable to create user");
 	createuser($self, "force_user", $password, $conffile, \%createuser_env) || die("Unable to create force_user");
@@ -2810,6 +2790,7 @@ force_user:x:$gid_force_user:
 	} else {
 		$ret{RESOLV_WRAPPER_CONF} = $resolv_conf;
 	}
+	$ret{RESOLV_CONF} = $resolv_conf;
 	$ret{LOCAL_PATH} = "$shrdir";
         $ret{LOGDIR} = $logdir;
 
@@ -2850,7 +2831,7 @@ sub wait_for_start($$$$$)
 			} else {
 				system("$nmblookup $envvars->{CONFIGURATION} -U $envvars->{SERVER_IP} __SAMBA__");
 				system("$nmblookup $envvars->{CONFIGURATION} __SAMBA__");


-- 
Samba Shared Repository



More information about the samba-cvs mailing list