def test_matches_only_if_server_address_matches_node_address(self): """ :func:`CLBNode.matches` returns True only if the :class:`NovaServer` has the same ServiceNet address as the node address """ node = CLBNode(node_id="1234", description=self.desc, address="10.1.1.1") self.assertFalse( node.matches( NovaServer( id="1", state=ServerState.ACTIVE, created=0.0, servicenet_address="10.1.1.2", image_id="image", flavor_id="flavor", ) ) ) self.assertTrue( node.matches( NovaServer( id="1", state=ServerState.ACTIVE, created=0.0, servicenet_address="10.1.1.1", image_id="image", flavor_id="flavor", ) ) )
def test_matches_only_if_server_address_matches_node_address(self): """ :func:`CLBNode.matches` returns True only if the :class:`NovaServer` has the same ServiceNet address as the node address """ node = CLBNode(node_id='1234', description=self.desc, address='10.1.1.1') self.assertFalse(node.matches( NovaServer(id='1', state=ServerState.ACTIVE, created=0.0, servicenet_address="10.1.1.2", image_id='image', flavor_id='flavor'))) self.assertTrue(node.matches( NovaServer(id='1', state=ServerState.ACTIVE, created=0.0, servicenet_address="10.1.1.1", image_id='image', flavor_id='flavor')))
def test_matches_only_works_with_NovaServers(self): """ :func:`CLBNode.matches` returns false if the server is not an instance of :class:`NovaServer`. """ node = CLBNode(node_id="1234", description=self.desc, address="10.1.1.1") self.assertFalse(node.matches(DummyServer(servicenet_address="10.1.1.1")))
def test_matches_only_works_with_NovaServers(self): """ :func:`CLBNode.matches` returns false if the server is not an instance of :class:`NovaServer`. """ node = CLBNode(node_id='1234', description=self.desc, address='10.1.1.1') self.assertFalse( node.matches(DummyServer(servicenet_address="10.1.1.1")))