1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-23 00:23:53 +03:00

tests: Make IPv4 assumption explicit

This test is asserting the expected number of *IPv4* addresses, not any
interface address (including IPv6). It works currently because the
selftest client doesn't have an IPv6 address in its smb.conf.

This patch makes the IPv4 assumption explicit by importing
interface_ips_v4() from the provision code. We need to tweak this to
pass through an 'all_interfaces' flag, otherwise it filters out the
loopback IP addresses that the testenv is using.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Tim Beale
2019-03-13 10:18:41 +13:00
committed by Andrew Bartlett
parent e9c01fdbb8
commit 1fb01c5b11
2 changed files with 5 additions and 4 deletions

View File

@@ -24,6 +24,7 @@ from samba.tests.dns_base import DNSTKeyTest
from samba.join import DCJoinContext
from samba.dcerpc import drsuapi, misc, dns
from samba.credentials import Credentials
from samba.provision import interface_ips_v4
def get_logger(name="subunit"):
@@ -92,7 +93,7 @@ class JoinTestCase(DNSTKeyTest):
questions.append(q)
# Get expected IPs
IPs = samba.interface_ips(self.lp)
IPs = interface_ips_v4(self.lp, all_interfaces=True)
self.finish_name_packet(p, questions)
(response, response_packet) = self.dns_transaction_tcp(p, host=self.server_ip)
@@ -132,7 +133,7 @@ class JoinTestCase(DNSTKeyTest):
updates = []
# Delete the old expected IPs
IPs = samba.interface_ips(self.lp)
IPs = interface_ips_v4(self.lp, all_interfaces=True)
for IP in IPs[1:]:
if ":" in IP:
r = dns.res_rec()