Change in vdsm[master]: net tests: Introduce Router Advertisement with dnsmasq

edwardh at redhat.com edwardh at redhat.com
Fri Mar 11 11:24:58 UTC 2016


Edward Haas has uploaded a new change for review.

Change subject: net tests: Introduce Router Advertisement with dnsmasq
......................................................................

net tests: Introduce Router Advertisement with dnsmasq

dnsmasq has been used as a dhcp server for the network funtional tests.
With the introduction of IPv6 support and its autoconf option, RA is
enabled in dnsmasq (if requested).

RA is currently disabled by default, following patch should enable it by
default.

Change-Id: If770736e899c5e8e5e9086237876b6c0ec74b6ba
Signed-off-by: Edward Haas <edwardh at redhat.com>
---
M tests/functional/dhcp.py
1 file changed, 16 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/30/54630/1

diff --git a/tests/functional/dhcp.py b/tests/functional/dhcp.py
index 852179e..73038f8 100644
--- a/tests/functional/dhcp.py
+++ b/tests/functional/dhcp.py
@@ -45,7 +45,9 @@
         self.proc = None
 
     def start(self, interface, dhcp_range_from, dhcp_range_to,
-              dhcpv6_range_from=None, dhcpv6_range_to=None, router=None):
+              dhcpv6_range_from=None, dhcpv6_range_to=None, router=None,
+              dhcp_enable=True, router_advertisement=False):
+        # --dhcp-authoritative      The only DHCP server on network
         # -p 0                      don't act as a DNS server
         # --dhcp-option=3,<router>  advertise a specific gateway (or None)
         # --dhcp-option=6           don't reply with any DNS servers
@@ -54,14 +56,23 @@
         command = [
             _DNSMASQ_BINARY.cmd, '--dhcp-authoritative',
             '-p', '0',
-            '--dhcp-range={0},{1},2m'.format(dhcp_range_from, dhcp_range_to),
             '--dhcp-option=3' + (',{0}'.format(router) if router else ''),
             '--dhcp-option=6',
             '-i', interface, '-I', 'lo', '-d', '--bind-dynamic',
         ]
-        if dhcpv6_range_from and dhcpv6_range_to:
-            command += ['--dhcp-range={0},{1},2m'.format(dhcpv6_range_from,
-                                                         dhcpv6_range_to)]
+
+        if router_advertisement:
+            command += ['--enable-ra']
+
+        if dhcp_enable:
+            command += ['--dhcp-range={0},{1},2m'.format(dhcp_range_from,
+                                                         dhcp_range_to)]
+            if dhcpv6_range_from and dhcpv6_range_to:
+                command += ['--dhcp-range={0},{1},2m'.format(dhcpv6_range_from,
+                                                             dhcpv6_range_to)]
+        elif dhcpv6_range_from and dhcpv6_range_to:
+            command += ['--dhcp-range={0},slaac,2m'.format(dhcpv6_range_from)]
+
         self.proc = execCmd(command, sync=False)
         sleep(_START_CHECK_TIMEOUT)
         if self.proc.returncode:


-- 
To view, visit https://gerrit.ovirt.org/54630
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If770736e899c5e8e5e9086237876b6c0ec74b6ba
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Edward Haas <edwardh at redhat.com>


More information about the vdsm-patches mailing list