def setUpClass(cls):
     """
     These tests connect to a running graph database and so for safety
     reasons this needs to be explicitly set.
     """
     utils.create_test_config()
     logging.disable(logging.CRITICAL)
Ejemplo n.º 2
0
    def setUp(self):
        utils.create_test_config()
        test_conf = utils.TEST_CONFIG_FILE
        self.conf_manager = configuration.ConfigurationManager(test_conf)
        self.events_manager = events_manager.EventsManager()
        self.graph_db = neo4j_db.Neo4jGDB(self.conf_manager)

        # Disable logging.
        logging.disable(logging.CRITICAL)
Ejemplo n.º 3
0
    def setUp(self):
        utils.create_test_config()
        manager = LandscapeManager(utils.TEST_CONFIG_FILE)
        self.graph_db = manager.graph_db
        self.graph_db.delete_all()
        self.graph_db.load_test_landscape(self.landscape_file)

        # Test flask calls.
        self.app = application.APP.test_client()
        application.initilise_application()
Ejemplo n.º 4
0
    def setUp(self):
        utils.create_test_config()
        manager = LandscapeManager(utils.TEST_CONFIG_FILE)
        self.graph_db = manager.graph_db
        self.graph_db.delete_all()
        self.conf_manager = manager.conf_manager
        self.conf_manager.add_section('physical_layer')

        confmgr_mock = mock.Mock()
        confmgr_mock.get_types_to_filter.return_value = []
        confmgr_mock.get_machines.return_value = ['machine-A']

        self.collector = edc.EphemeralDiskCollector(self.graph_db,
                                                    self.conf_manager,
                                                    mock.Mock())
        tests_dir = os.path.dirname(os.path.abspath(__file__))
        self.xml_file_path = os.path.join(tests_dir,
                                          'data/ephemeral_collector.xml')
        file_handler = open(self.xml_file_path, 'r')
        self.xml_dump = file_handler.read().strip()
Ejemplo n.º 5
0
    def setUp(self):
        # Initialise managers with test config..
        utils.create_test_config()
        conf = configuration.ConfigurationManager(utils.TEST_CONFIG_FILE)
        event_m = events_manager.EventsManager()

        # Set up the graph database.
        self.graph_db = neo4j_db.Neo4jGDB(conf)
        self.graph_db.delete_all()
        self.graph_db.load_test_landscape(self.landscape_file)

        # Patch up nova and neutron openstack.
        nova_patch = patch('landscaper.collector.nova_collector.openstack')
        cinder_patch = patch('landscaper.collector.cinder_collector.openstack')
        self.addCleanup(nova_patch.stop)
        self.addCleanup(cinder_patch.stop)
        nova_patch.start()
        cinder_patch.start()

        # Set up landscaper classes.
        self.listener = os_rabbitmq_listener.OSRabbitMQListener(event_m, conf)
        nova_collector.NovaCollectorV2(self.graph_db, conf, event_m)
        cinder_collector.CinderCollectorV2(self.graph_db, conf, event_m)
        logging.disable(logging.ERROR)
Ejemplo n.º 6
0
 def setUpClass(cls):
     utils.create_test_config()
     logging.disable(logging.CRITICAL)
Ejemplo n.º 7
0
 def setUpClass(cls):
     utils.create_test_config()
Ejemplo n.º 8
0
 def setUp(self):
     utils.create_test_config()
     manager = landscape_manager.LandscapeManager(utils.TEST_CONFIG_FILE)
     self.graph_db = manager.graph_db
     self.graph_db.delete_all()
     self.graph_db.load_test_landscape(self.landscape_file)