summaryrefslogtreecommitdiff
path: root/ironic/tests
diff options
context:
space:
mode:
authorMoshe Levi <moshele@mellanox.com>2018-02-27 21:09:14 +0200
committerMoshe Levi <moshele@mellanox.com>2018-03-08 12:18:36 +0000
commit93012b2df1b06843df94d73a704db649d41e8591 (patch)
treecf687f29ae0d0c5ba60f5c98cb21cfa11553aec0 /ironic/tests
parent8ad8c874d208e2c80be05bc64afe67d9a9c7a9ec (diff)
downloadironic-93012b2df1b06843df94d73a704db649d41e8591.tar.gz
Don't validate local_link_connection when port has client-id
Infiniband ports do not require the local_link_connection field to be populated as the network topology is discoverable by the Infiniband Subnet Manager. This change removes the requirement for local_link_connection for Infiniband ports. Infiniband ports have a client-id in their extra field. Closes-Bug: #1753222 Change-Id: I2bfac4ccaf825bd9aa8ea0d2b447fcd7767acbc5 (cherry picked from commit dcebb77d9d7a2cebcc645dd632a12d224bd113c8)
Diffstat (limited to 'ironic/tests')
-rw-r--r--ironic/tests/unit/common/test_neutron.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/ironic/tests/unit/common/test_neutron.py b/ironic/tests/unit/common/test_neutron.py
index 9b277a7ad..c7b9e201d 100644
--- a/ironic/tests/unit/common/test_neutron.py
+++ b/ironic/tests/unit/common/test_neutron.py
@@ -466,6 +466,33 @@ class TestNeutronNetworkActions(db_base.DbTestCase):
self.assertTrue(res)
self.assertFalse(log_mock.warning.called)
+ @mock.patch.object(neutron, 'LOG', autospec=True)
+ def test_validate_port_info_flat_interface_with_client_id(self, log_mock):
+ self.node.network_interface = 'flat'
+ self.node.save()
+ llc = {}
+ port = object_utils.create_test_port(
+ self.context, node_id=self.node.id, uuid=uuidutils.generate_uuid(),
+ address='52:54:00:cf:2d:33', local_link_connection=llc,
+ extra={'client-id': self._CLIENT_ID})
+ res = neutron.validate_port_info(self.node, port)
+ self.assertTrue(res)
+ self.assertFalse(log_mock.warning.called)
+
+ @mock.patch.object(neutron, 'LOG', autospec=True)
+ def test_validate_port_info_neutron_interface_with_client_id(
+ self, log_mock):
+ self.node.network_interface = 'neutron'
+ self.node.save()
+ llc = {}
+ port = object_utils.create_test_port(
+ self.context, node_id=self.node.id, uuid=uuidutils.generate_uuid(),
+ address='52:54:00:cf:2d:33', local_link_connection=llc,
+ extra={'client-id': self._CLIENT_ID})
+ res = neutron.validate_port_info(self.node, port)
+ self.assertTrue(res)
+ self.assertFalse(log_mock.warning.called)
+
@mock.patch.object(neutron, 'get_client', autospec=True)
class TestValidateNetwork(base.TestCase):