Ejemplo n.º 1
0
 def _create_mock_events():
     gen_list = mock_sync.simple_zone_generators(
         2,
         4,
         snapshot_events=2,
         snap_vals={
             DatasourceProperties.DATASOURCE_ACTION:
             DatasourceAction.INIT_SNAPSHOT
         })
     gen_list += mock_sync.simple_host_generators(
         2,
         4,
         4,
         snap_vals={
             DatasourceProperties.DATASOURCE_ACTION:
             DatasourceAction.INIT_SNAPSHOT
         })
     gen_list += mock_sync.simple_instance_generators(
         4,
         15,
         15,
         snap_vals={
             DatasourceProperties.DATASOURCE_ACTION:
             DatasourceAction.INIT_SNAPSHOT
         })
     return mock_sync.generate_sequential_events_list(gen_list)
Ejemplo n.º 2
0
 def _create_mock_events():
     gen_list = mock_sync.simple_zone_generators(
         2, 4, snapshot_events=2, snap_vals={'sync_mode': 'init_snapshot'})
     gen_list += mock_sync.simple_host_generators(
         2, 4, 4, snap_vals={'sync_mode': 'init_snapshot'})
     gen_list += mock_sync.simple_instance_generators(
         4, 15, 15, snap_vals={'sync_mode': 'init_snapshot'})
     return mock_sync.generate_sequential_events_list(gen_list)
Ejemplo n.º 3
0
 def _create_mock_events(self):
     gen_list = mock_driver.simple_zone_generators(
         self.NUM_ZONES,
         self.NUM_HOSTS,
         snapshot_events=self.NUM_ZONES,
         snap_vals={DSProps.SYNC_MODE: SyncMode.INIT_SNAPSHOT})
     gen_list += mock_driver.simple_host_generators(
         self.NUM_ZONES,
         self.NUM_HOSTS,
         self.NUM_HOSTS,
         snap_vals={DSProps.SYNC_MODE: SyncMode.INIT_SNAPSHOT})
     gen_list += mock_driver.simple_instance_generators(
         self.NUM_HOSTS,
         self.NUM_INSTANCES,
         self.NUM_INSTANCES,
         snap_vals={DSProps.SYNC_MODE: SyncMode.INIT_SNAPSHOT})
     return mock_driver.generate_sequential_events_list(gen_list)
Ejemplo n.º 4
0
 def _create_mock_events(self):
     gen_list = mock_sync.simple_zone_generators(
         self.NUM_ZONES,
         self.NUM_HOSTS,
         snapshot_events=self.NUM_ZONES,
         snap_vals={DSProps.SYNC_MODE: SyncMode.INIT_SNAPSHOT})
     gen_list += mock_sync.simple_host_generators(
         self.NUM_ZONES,
         self.NUM_HOSTS,
         self.NUM_HOSTS,
         snap_vals={DSProps.SYNC_MODE: SyncMode.INIT_SNAPSHOT})
     gen_list += mock_sync.simple_instance_generators(
         self.NUM_HOSTS,
         self.NUM_INSTANCES,
         self.NUM_INSTANCES,
         snap_vals={DSProps.SYNC_MODE: SyncMode.INIT_SNAPSHOT})
     return mock_sync.generate_sequential_events_list(gen_list)
    def test_snapshot_transform(self):
        LOG.debug("Nova zone transformer test: transform entity event")

        # Test setup
        spec_list = mock_sync.simple_zone_generators(zone_num=1, host_num=1, snapshot_events=5)
        zone_events = mock_sync.generate_random_events_list(spec_list)

        for event in zone_events:
            # Test action
            wrapper = self.transformers[NOVA_ZONE_DATASOURCE].transform(event)

            # Test assertions
            vertex = wrapper.vertex
            self._validate_vertex_props(vertex, event)

            neighbors = wrapper.neighbors
            self.assertEqual(2, len(neighbors))
            self._validate_neighbors(neighbors, vertex.vertex_id, event)
Ejemplo n.º 6
0
    def test_snapshot_transform(self):
        LOG.debug('Nova zone transformer test: transform entity event')

        # Test setup
        spec_list = mock_sync.simple_zone_generators(zone_num=1,
                                                     host_num=1,
                                                     snapshot_events=5)
        zone_events = mock_sync.generate_random_events_list(spec_list)

        for event in zone_events:
            # Test action
            wrapper = self.transformers[NOVA_ZONE_DATASOURCE].transform(event)

            # Test assertions
            vertex = wrapper.vertex
            self._validate_vertex_props(vertex, event)

            neighbors = wrapper.neighbors
            self.assertEqual(2, len(neighbors))
            self._validate_neighbors(neighbors, vertex.vertex_id, event)
Ejemplo n.º 7
0
 def _create_mock_events(self):
     gen_list = mock_sync.simple_zone_generators(
         self.NUM_ZONES,
         self.NUM_HOSTS,
         snapshot_events=self.NUM_ZONES,
         snap_vals={DSProps.DATASOURCE_ACTION:
                    DatasourceAction.INIT_SNAPSHOT})
     gen_list += mock_sync.simple_host_generators(
         self.NUM_ZONES,
         self.NUM_HOSTS,
         self.NUM_HOSTS,
         snap_vals={DSProps.DATASOURCE_ACTION:
                    DatasourceAction.INIT_SNAPSHOT})
     gen_list += mock_sync.simple_instance_generators(
         self.NUM_HOSTS,
         self.NUM_INSTANCES,
         self.NUM_INSTANCES,
         snap_vals={DSProps.DATASOURCE_ACTION:
                    DatasourceAction.INIT_SNAPSHOT})
     return mock_sync.generate_sequential_events_list(gen_list)
Ejemplo n.º 8
0
 def _create_mock_events(self):
     gen_list = mock_driver.simple_zone_generators(
         self.NUM_ZONES,
         self.NUM_HOSTS,
         snapshot_events=self.NUM_ZONES,
         snap_vals={DSProps.DATASOURCE_ACTION:
                    DatasourceAction.INIT_SNAPSHOT})
     gen_list += mock_driver.simple_host_generators(
         self.NUM_ZONES,
         self.NUM_HOSTS,
         self.NUM_HOSTS,
         snap_vals={DSProps.DATASOURCE_ACTION:
                    DatasourceAction.INIT_SNAPSHOT})
     gen_list += mock_driver.simple_instance_generators(
         self.NUM_HOSTS,
         self.NUM_INSTANCES,
         self.NUM_INSTANCES,
         snap_vals={DSProps.DATASOURCE_ACTION:
                    DatasourceAction.INIT_SNAPSHOT})
     return mock_driver.generate_sequential_events_list(gen_list)