def setUp(self): super(TestValidateInterfacesHook, self).setUp() self.hook = std_plugins.ValidateInterfacesHook() self.existing_ports = [mock.Mock(spec=['address', 'uuid'], address=a) for a in (self.macs[1], '44:44:44:44:44:44')] self.node_info = node_cache.NodeInfo(uuid=self.uuid, started_at=0, node=self.node, ports=self.existing_ports)
def setUp(self): super(TestValidateInterfacesHookBeforeUpdateDeletion, self).setUp() self.hook = std_plugins.ValidateInterfacesHook() self.interfaces_to_create = sorted(self.valid_interfaces.values(), key=lambda i: i['mac']) self.existing_ports = [mock.Mock(spec=['address', 'uuid'], address=a) for a in (self.macs[1], '44:44:44:44:44:44')] self.node_info = node_cache.NodeInfo(uuid=self.uuid, started_at=0, node=self.node, ports=self.existing_ports)
def setUp(self): super(TestValidateInterfacesHookBeforeUpdatePXEEnabled, self).setUp() self.hook = std_plugins.ValidateInterfacesHook() # Note(milan) assumes the ordering of self.macs from test_base.NodeTest # where the first item '11:22:33:44:55:66' is the MAC of the # self.pxe_iface_name 'eth1', the "real" PXE interface sorted_interfaces = sorted(self.valid_interfaces.values(), key=lambda i: i['mac']) self.existing_ports = [ mock.Mock(spec=['address', 'uuid', 'pxe_enabled'], address=iface['mac'], pxe_enabled=True) for iface in sorted_interfaces ] self.node_info = node_cache.NodeInfo(uuid=self.uuid, started_at=0, node=self.node, ports=self.existing_ports)
def setUp(self): super(TestValidateInterfacesHook, self).setUp() self.hook = std_plugins.ValidateInterfacesHook() self.data = { 'interfaces': { 'em1': { 'mac': '11:11:11:11:11:11', 'ip': '1.1.1.1' }, 'em2': { 'mac': '22:22:22:22:22:22', 'ip': '2.2.2.2' }, 'em3': { 'mac': '33:33:33:33:33:33' } }, 'boot_interface': '01-22-22-22-22-22-22', } self.orig_interfaces = self.data['interfaces'].copy() self.pxe_interface = self.data['interfaces']['em2'] self.active_interfaces = { 'em1': { 'mac': '11:11:11:11:11:11', 'ip': '1.1.1.1' }, 'em2': { 'mac': '22:22:22:22:22:22', 'ip': '2.2.2.2' }, } self.existing_ports = [ mock.Mock(spec=['address', 'uuid'], address=a) for a in ('11:11:11:11:11:11', '44:44:44:44:44:44') ] self.node_info = node_cache.NodeInfo(uuid=self.uuid, started_at=0, node=self.node, ports=self.existing_ports)
def setUp(self): super(TestValidateInterfacesHookBeforeProcessing, self).setUp() self.hook = std_plugins.ValidateInterfacesHook()