selftest: Add helper function to get interfaces config
[kai/samba-autobuild/.git] / selftest / target / Samba.pm
index 2d8cbc28703e5dfc34e693b38f91b8db1dadb483..f7332da893ee559111a27861ce577495cbd4bc3f 100644 (file)
@@ -505,6 +505,17 @@ sub get_ipv6_addr
        return sprintf("fd00:0000:0000:0000:0000:0000:5357:5f%02x", $swiface);
 }
 
+# returns the 'interfaces' setting for smb.conf, i.e. the IPv4/IPv6
+# addresses for testenv
+sub get_interfaces_config
+{
+       (my $hostname) = @_;
+       my $ipv4_addr = Samba::get_ipv4_addr($hostname);
+       my $ipv6_addr = Samba::get_ipv6_addr($hostname);
+
+       return "$ipv4_addr/8 $ipv6_addr/64";
+}
+
 sub cleanup_child($$)
 {
     my ($pid, $name) = @_;