(self, name, itype, mode, netdev, ipv4_type, ipv4_addr, ipv4_gw,
ipv6_type, ipv6_addr, ipv6_gw, stp, delay)
| 16 | self.wvm.interfaceDefineXML(xml, flag) |
| 17 | |
| 18 | def create_iface(self, name, itype, mode, netdev, ipv4_type, ipv4_addr, ipv4_gw, |
| 19 | ipv6_type, ipv6_addr, ipv6_gw, stp, delay): |
| 20 | xml = """<interface type='%s' name='%s'> |
| 21 | <start mode='%s'/>""" % (itype, name, mode) |
| 22 | if ipv4_type == 'dhcp': |
| 23 | xml += """<protocol family='ipv4'> |
| 24 | <dhcp/> |
| 25 | </protocol>""" |
| 26 | if ipv4_type == 'static': |
| 27 | address, prefix = ipv4_addr.split('/') |
| 28 | xml += """<protocol family='ipv4'> |
| 29 | <ip address='%s' prefix='%s'/> |
| 30 | <route gateway='%s'/> |
| 31 | </protocol>""" % (address, prefix, ipv4_gw) |
| 32 | if ipv6_type == 'dhcp': |
| 33 | xml += """<protocol family='ipv6'> |
| 34 | <dhcp/> |
| 35 | </protocol>""" |
| 36 | if ipv6_type == 'static': |
| 37 | address, prefix = ipv6_addr.split('/') |
| 38 | xml += """<protocol family='ipv6'> |
| 39 | <ip address='%s' prefix='%s'/> |
| 40 | <route gateway='%s'/> |
| 41 | </protocol>""" % (address, prefix, ipv6_gw) |
| 42 | if itype == 'bridge': |
| 43 | xml += """<bridge stp='%s' delay='%s'> |
| 44 | <interface name='%s' type='ethernet'/> |
| 45 | </bridge>""" % (stp, delay, netdev) |
| 46 | xml += """</interface>""" |
| 47 | self.define_iface(xml) |
| 48 | iface = self.get_iface(name) |
| 49 | iface.create() |
| 50 | |
| 51 | |
| 52 | class wvmInterface(wvmConnect): |
no test coverage detected