Change in vdsm[master]: tests: Provide dnsmasq_run as a context manager

danken at redhat.com danken at redhat.com
Mon Mar 14 16:41:30 UTC 2016


Dan Kenigsberg has posted comments on this change.

Change subject: tests: Provide dnsmasq_run as a context manager
......................................................................


Patch Set 4: Code-Review-1

(2 comments)

https://gerrit.ovirt.org/#/c/54632/4/tests/network/nettestlib.py
File tests/network/nettestlib.py:

Line 387:     return wrapper
Line 388: 
Line 389: 
Line 390: @contextmanager
Line 391: def dnsmasq_run(interface, dhcp_range_from=None, dhcp_range_to=None,
this code was basically copied from functional/networkTests.py. Please move make networkTests.py import it from here to avoid code duplication.

For example, we'd like to drop the SkipTest() from both places.
Line 392:                 dhcpv6_range_from=None, dhcpv6_range_to=None, router=None,
Line 393:                 ipv6_slaac_prefix=None):
Line 394:     """Manages the life cycle of dnsmasq as a DHCP/RA server."""
Line 395:     server = dhcp.Dnsmasq()


Line 396:     try:
Line 397:         server.start(interface, dhcp_range_from, dhcp_range_to,
Line 398:                      dhcpv6_range_from, dhcpv6_range_to, router,
Line 399:                      ipv6_slaac_prefix)
Line 400:     # TODO: Why should we skip and not fail?
it might have been a good idea back when https://gerrit.ovirt.org/#/c/21113/2/tests/functional/dhcpd.py@28 was proposed. Please drop it now (prior or after this patch)
Line 401:     except dhcp.DhcpError as e:
Line 402:         raise SkipTest(e)
Line 403: 
Line 404:     with firewall.allow_dhcp(interface):


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifde1232416081981256c3e384151574617e9b0d0
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Edward Haas <edwardh at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Edward Haas <edwardh at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondřej Svoboda <osvoboda at redhat.com>
Gerrit-Reviewer: Petr Horáček <phoracek at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list