Пример #1
0
    def test_sync_for_without_cloud(self):
        self._create_members_with_cloud()

        mapping_mgr = mapping.GridMappingManager(self.test_grid_config)
        mapping_mgr._sync_nios_for_network_view = mock.Mock()

        network_view_json = self.connector_fixture.get_object(
            base.FixtureResourceMap.FAKE_NETWORKVIEW_WITHOUT_CLOUD)
        mapping_mgr._discover_network_views = mock.Mock()
        mapping_mgr._discover_network_views.return_value = network_view_json

        network_json = self.connector_fixture.get_object(
            base.FixtureResourceMap.FAKE_NETWORK_WITHOUT_CLOUD)
        mapping_mgr._discover_networks = mock.Mock()
        mapping_mgr._discover_networks.return_value = network_json

        dnsview_json = self.connector_fixture.get_object(
            base.FixtureResourceMap.FAKE_DNS_VIEW)
        mapping_mgr._discover_dns_views = mock.Mock()
        mapping_mgr._discover_dns_views.return_value = dnsview_json

        mapping_mgr.sync()

        # validate network views, mapping conditions, mapping members
        self._validate_network_views(network_view_json)
        self._validate_mapping_conditions(network_view_json)
        self._validate_member_mapping(network_view_json, network_json)
Пример #2
0
 def __init__(self, context):
     self.grid_config = self._create_grid_configuration(context)
     self.member = grid_member.GridMemberManager(self.grid_config)
     self.mapping = grid_mapping.GridMappingManager(self.grid_config)
     self.hostname = socket.gethostname()