selftest: Avoid hard-coding client IP address
authorTim Beale <timbeale@catalyst.net.nz>
Thu, 14 Feb 2019 01:37:16 +0000 (14:37 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 5 Mar 2019 23:27:30 +0000 (23:27 +0000)
We implicitly assume the client IP used by selftest is always
127.0.0.11. Add an iface entry for the client to make this a little more
explicit.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
selftest/target/Samba.pm
selftest/target/Samba4.pm

index 8e8723c0b88a311fbda96fde66a0f9c5438cfaa3..fdba45504bc5dc1605d899bbd6dd383aeb1dc3cc 100644 (file)
@@ -400,6 +400,7 @@ sub get_interface($)
     $interfaces{"localnt4dc9"} = 9;
 
     # 11-16 used by selftest.pl for client interfaces
+    $interfaces{"client"} = 11;
 
     $interfaces{"addc_no_nss"} = 17;
     $interfaces{"addc_no_ntlm"} = 18;
index 84b7fa9dc03f8b8b195ea980f95491d71930e135..de7307d95c8e1b8e75afd26f35267bb30e8e1970 100755 (executable)
@@ -333,12 +333,13 @@ sub write_ldb_file($$$)
 sub add_wins_config($$)
 {
        my ($self, $privatedir) = @_;
+       my $client_ip = Samba::get_ipv4_addr("client");
 
        return $self->write_ldb_file("$privatedir/wins_config.ldb", "
 dn: name=TORTURE_11,CN=PARTNERS
 objectClass: wreplPartner
 name: TORTURE_11
-address: 127.0.0.11
+address: $client_ip
 pullInterval: 0
 pushChangeCount: 0
 type: 0x3