def test_get_node_by_port_addresses_multiple_found(self):
    node1 = utils.create_test_node(driver='driver', uuid=uuidutils.generate_uuid())
    node2 = utils.create_test_node(driver='driver', uuid=uuidutils.generate_uuid())
    addresses = [('52:54:00:cf:2d:4%s' % i) for i in (1, 2)]
    utils.create_test_port(uuid=uuidutils.generate_uuid(), node_id=node1.id, address=addresses[0])
    utils.create_test_port(uuid=uuidutils.generate_uuid(), node_id=node2.id, address=addresses[1])
    self.assertRaisesRegex(exception.NodeNotFound, 'Multiple nodes', self.dbapi.get_node_by_port_addresses, addresses)
def test_get_node_by_port_addresses_multiple_found(self):
    node1 = utils.create_test_node(driver='driver', uuid=uuidutils.generate_uuid())
    node2 = utils.create_test_node(driver='driver', uuid=uuidutils.generate_uuid())
    addresses = [('52:54:00:cf:2d:4%s' % i) for i in (1, 2)]
    utils.create_test_port(uuid=uuidutils.generate_uuid(), node_id=node1.id, address=addresses[0])
    utils.create_test_port(uuid=uuidutils.generate_uuid(), node_id=node2.id, address=addresses[1])
    self.assertRaisesRegex(exception.NodeNotFound, 'Multiple nodes', self.dbapi.get_node_by_port_addresses, addresses)