From Dan Kenigsberg <danken(a)redhat.com>:
Dan Kenigsberg has posted comments on this change.
Change subject: net func test: Existing NM test should cleanup even if it fails
......................................................................
Patch Set 1: Code-Review-1
(1 comment)
https://gerrit.ovirt.org/#/c/69276/1/tests/network/func_net_basic_test.py
File tests/network/func_net_basic_test.py:
Line 105: iface = iface_name()
Line 106: NET = {NETWORK_NAME: {'bonding': iface, 'switch':
self.switch}}
Line 107: with nm_connections(iface, IPv4_ADDRESS, con_count=3):
Line 108: try:
Line 109: with self.setupNetworks(NET, {}, NOCHK):
shouldn't you open the try-block only here, after we are sure that the bond has been
acquired? If setupNetwork explodes before it yields, we should not attempt to clean up.
Line 110: self.assertNetwork(NETWORK_NAME, NET[NETWORK_NAME])
Line 111: finally:
Line 112: # The bond was acquired, therefore VDSM needs to clean it.
Line 113: BONDREMOVE = {iface: {'remove': True}}
--
To view, visit
https://gerrit.ovirt.org/69276
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: If66640134404be54792cf69a22056b64a2c94b85
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Edward Haas <edwardh(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Edward Haas <edwardh(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Petr Horáček <phoracek(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: Yes