]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
selftest: use 10.53.57.0/8 instead of 127.0.0.1/8
authorStefan Metzmacher <metze@samba.org>
Wed, 23 Jan 2019 21:29:19 +0000 (22:29 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 27 Mar 2020 09:02:38 +0000 (09:02 +0000)
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@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
python/samba/tests/blackbox/mdfind.py
python/samba/tests/dcerpc/mdssvc.py
python/samba/tests/param.py
selftest/knownfail.d/dns
selftest/ns/README
selftest/selftest.pl
selftest/target/Samba.pm
selftest/target/Samba3.pm
source3/script/tests/test_async_req.sh
source4/selftest/tests.py

index e00af05400730385a1547a55b9514524aa47ffa2..5c1c0c3d1558bd82e83bee4529d1a74dedc533fb 100644 (file)
@@ -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)
 
index 68243aa4354ae525df0abceb306e913f6e22618c..b0df509ddc793c3eadf1f6bd1c5d3d7876269b24 100644 (file)
@@ -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)
 
index 0a7f86adad75d83fe46a91956e23854ea17d93a2..ae58074b80be10a70797d7d4149bdd43905671bc 100644 (file)
@@ -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()
index 70a719a818a947142009bae0205cfbbd37e593fb..bf56363247274e541465f9ede811ccc81503cf56 100644 (file)
@@ -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\)
index a8ad1c0444fec33c2371dfa21173eb112ff3bd24..896fe15fff7a423524f5766669a2ba8e6d867001 100644 (file)
@@ -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
index 941943f0306953387f1416e2c60980cd8c6ee328..d14df92a11c8dc184158489474ee6de411a45a12 100755 (executable)
@@ -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";
index 50a81ff049075fd2429c9dfb3e96c5ed632e3c8a..e415110d8e71a31d7b293ba90c58b0d76c957588 100644 (file)
@@ -576,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
index 3461ca26fc0884abbf325955387ea67cb2b62866..fe871af4573a70eb5d76a61d71a57708144bc370 100755 (executable)
@@ -1250,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
 
@@ -2830,7 +2831,7 @@ sub wait_for_start($$$$$)
                        } else {
                                system("$nmblookup $envvars->{CONFIGURATION} -U $envvars->{SERVER_IP} __SAMBA__");
                                system("$nmblookup $envvars->{CONFIGURATION} __SAMBA__");
-                               system("$nmblookup $envvars->{CONFIGURATION} -U 127.255.255.255 __SAMBA__");
+                               system("$nmblookup $envvars->{CONFIGURATION} -U 10.255.255.255 __SAMBA__");
                                system("$nmblookup $envvars->{CONFIGURATION} -U $envvars->{SERVER_IP} $envvars->{SERVER}");
                        }
                        $count++;
@@ -3037,7 +3038,7 @@ sub provision_ctdb($$$$)
                my %node = ();
                my $server_name = "ctdb${i}";
                my $pub_iface = Samba::get_interface($server_name);
-               my $ip = "127.0.0.${pub_iface}";
+               my $ip = Samba::get_ipv4_addr($server_name);
 
                $node{NODE_NUMBER} = "$i";
                $node{SERVER_NAME} = "$server_name";
index a92f9909911724e533d5b51f009c7764884b145f..fdbcb59f13d10fd341a4286990aab80abe8dc4d4 100755 (executable)
@@ -5,6 +5,9 @@ incdir=`dirname $0`/../../../testprogs/blackbox
 
 failed=0
 
+SOCKET_WRAPPER_IPV4_NETWORK="127.0.0.0"
+export SOCKET_WRAPPER_IPV4_NETWORK
+
 testit "async_connect_send" $VALGRIND $BINDIR/async_connect_send_test ||
        failed=`expr $failed + 1`
 
index 1a8116332b9663f0b555dbc4b049190ad05accb0..7d2ba5676eb58cbff622d2af1c3c0bbc32e57ca5 100755 (executable)
@@ -759,10 +759,10 @@ for env in ["chgdcpass", "ad_member"]:
 
 if have_heimdal_support:
     planoldpythontestsuite("ad_dc:local", "samba.tests.auth_log", extra_args=['-U"$USERNAME%$PASSWORD"'],
-                           environ={'CLIENT_IP': '127.0.0.11',
+                           environ={'CLIENT_IP': '10.53.57.11',
                                     'SOCKET_WRAPPER_DEFAULT_IFACE': 11})
     planoldpythontestsuite("ad_dc_ntvfs:local", "samba.tests.auth_log", extra_args=['-U"$USERNAME%$PASSWORD"'],
-                           environ={'CLIENT_IP': '127.0.0.11',
+                           environ={'CLIENT_IP': '10.53.57.11',
                                     'SOCKET_WRAPPER_DEFAULT_IFACE': 11})
     planoldpythontestsuite("ad_dc", "samba.tests.auth_log_pass_change",
                            extra_args=['-U"$USERNAME%$PASSWORD"'])