Ejemplo n.º 1
0
    def test_query_node_data_filter_preferred_ip_addresses(self):
        '''
        Test if query node data is filtering out unpreferred IP addresses.
        '''
        nova.__opts__ = {}

        vm = {'name': None}
        data = MagicMock()
        data.public_ips = []

        assert nova._query_node_data(vm, data,
                                     MagicMock()).public_ips == ['0.0.0.0']
Ejemplo n.º 2
0
    def test_query_node_data_filter_preferred_ip_addresses(self):
        '''
        Test if query node data is filtering out unpreferred IP addresses.
        '''
        dimensiondata.NodeState = MagicMock()
        dimensiondata.NodeState.RUNNING = True
        dimensiondata.__opts__ = {}

        vm = {'name': None}
        data = MagicMock()
        data.public_ips = []

        assert dimensiondata._query_node_data(vm, data).public_ips == ['0.0.0.0']
Ejemplo n.º 3
0
    def test_query_node_data_filter_preferred_ip_addresses(self):
        '''
        Test if query node data is filtering out unpreferred IP addresses.
        '''
        openstack.NodeState = MagicMock()
        openstack.NodeState.RUNNING = True
        openstack.__opts__ = {}

        vm = {'name': None}
        data = MagicMock()
        data.public_ips = []

        with patch('salt.utils.cloud.is_public_ip',
                   MagicMock(return_value=True)):
            assert openstack._query_node_data(
                vm, data, False, MagicMock()).public_ips == ['0.0.0.0']