Change in vdsm[master]: netinfo: Determine bootproto from dhclient's lease files
danken at redhat.com
danken at redhat.com
Tue Jan 28 10:32:13 UTC 2014
Dan Kenigsberg has posted comments on this change.
Change subject: netinfo: Determine bootproto from dhclient's lease files
......................................................................
Patch Set 6: Code-Review-1
(5 comments)
http://gerrit.ovirt.org/#/c/23098/6/tests/functional/dhcp.py
File tests/functional/dhcp.py:
Line 1: # Copyright 2013 Red Hat, Inc.
add 2014
Line 2: #
Line 3: # This program is free software; you can redistribute it and/or modify
Line 4: # it under the terms of the GNU General Public License as published by
Line 5: # the Free Software Foundation; either version 2 of the License, or
Line 67: '''Creating our own 'connection' with a static address prevents Network
Line 68: Manager from running dhclient on the interface.
Line 69:
Line 70: And so it does not interfere with dhclient we are going to run.'''
Line 71: proc = execCmd([_NM_CLI_BINARY.cmd, 'connection', 'add',
returns (rc, out, err)
Line 72: 'type', 'ethernet', 'ifname', interface,
Line 73: 'con-name', connection, 'autoconnect', 'yes',
Line 74: 'ip4', '12.34.56.78'], sync=True)
Line 75:
http://gerrit.ovirt.org/#/c/23098/6/tests/functional/firewall.py
File tests/functional/firewall.py:
Line 31: pass
Line 32:
Line 33:
Line 34: def allowDhcp(interface):
Line 35: '''Allows DHCP traffic on a supposed testing veth interface.
maybe if you rename the argument, we can drop the not-so-clear text about "a supposed testing veth".
Line 36:
Line 37: When using the iptables service, no other traffic is allowed.
Line 38: With firewalld, the whole interface is moved to the 'trusted',
Line 39: unrestricted zone.
Line 42: if _serviceRunning('iptables'):
Line 43: _execCmdChecker([_IPTABLES_BINARY.cmd, '-I', 'INPUT', '-i',
Line 44: interface, '-p', 'udp', '--sport', '68', '--dport',
Line 45: '67', '-j', 'ACCEPT'])
Line 46: if _serviceRunning('firewalld'):
style: use elif, and add an else clause rasing a SkipTest.
Line 47: _execCmdChecker([_FIREWALLD_BINARY.cmd, '--zone=trusted',
Line 48: '--change-interface=' + interface])
Line 49: except FirewallError as e:
Line 50: raise SkipTest('Failed to allow dhcp traffic in firewall because of '
Line 67: '67', '-j', 'ACCEPT'])
Line 68: if _serviceRunning('firewalld'):
Line 69: _execCmdChecker([_FIREWALLD_BINARY.cmd, '--zone=trusted',
Line 70: '--remove-interface=' + interface])
Line 71: except FirewallError as e:
failing to remove the firewall rule is a real failure - let this exception to be caught by nosetests.
Line 72: raise SkipTest('Failed to remove created rules from firewall because '
Line 73: 'of %s' % e)
Line 74:
Line 75:
--
To view, visit http://gerrit.ovirt.org/23098
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I5fbc48a0adf5f40120a72ec2c4cc2fc80b7226b8
Gerrit-PatchSet: 6
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda <osvoboda at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Assaf Muller <amuller at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Ondřej Svoboda <osvoboda at redhat.com>
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list