def wipe(self):
     for index in STD_INDEXES.iterkeys():
         IndexManagementService._es_call(self.es.index_delete,index)
         IndexManagementService._es_call(self.es.river_couchdb_delete,index)
     for index in EDGE_INDEXES.iterkeys():
         IndexManagementService._es_call(self.es.index_delete,index)
         IndexManagementService._es_call(self.es.river_couchdb_delete,index)
Exemple #2
0
 def wipe(self):
     for index in STD_INDEXES.iterkeys():
         IndexManagementService._es_call(self.es.index_delete, index)
         IndexManagementService._es_call(self.es.river_couchdb_delete,
                                         index)
     for index in EDGE_INDEXES.iterkeys():
         IndexManagementService._es_call(self.es.index_delete, index)
         IndexManagementService._es_call(self.es.river_couchdb_delete,
                                         index)
Exemple #3
0
    def es_cleanup():
        es_host = CFG.get_safe('server.elasticsearch.host', 'localhost')
        es_port = CFG.get_safe('server.elasticsearch.port', '9200')
        es = ep.ElasticSearch(host=es_host, port=es_port, timeout=10)
        indexes = STD_INDEXES.keys()
        indexes.append('%s_resources_index' % get_sys_name().lower())
        indexes.append('%s_events_index' % get_sys_name().lower())

        for index in indexes:
            IndexManagementService._es_call(es.river_couchdb_delete, index)
            IndexManagementService._es_call(es.index_delete, index)
    def es_cleanup():
        es_host = CFG.get_safe("server.elasticsearch.host", "localhost")
        es_port = CFG.get_safe("server.elasticsearch.port", "9200")
        es = ep.ElasticSearch(host=es_host, port=es_port, timeout=10)
        indexes = STD_INDEXES.keys()
        indexes.append("%s_resources_index" % get_sys_name().lower())
        indexes.append("%s_events_index" % get_sys_name().lower())

        for index in indexes:
            IndexManagementService._es_call(es.river_couchdb_delete, index)
            IndexManagementService._es_call(es.index_delete, index)
Exemple #5
0
    def test_bootstrap(self):
        cc = self.container
        #=======================================
        # Clean indexes
        #=======================================
        config = CFG
        config.op = 'index_bootstrap'

        # Thankfully, the default system.force_clean for integration tests is False :)

        cc.spawn_process(name='index_bootstrap',
                         module='ion.processes.bootstrap.index_bootstrap',
                         cls='IndexBootStrap',
                         config=config)
        index_list = IndexManagementService._es_call(self.es.index_list)

        for index in STD_INDEXES.iterkeys():
            self.assertTrue(index in index_list)
    def test_bootstrap(self):
        cc = self.container
        #=======================================
        # Clean indexes
        #=======================================
        config = CFG
        config.op='index_bootstrap'

        cc.spawn_process(
            name='index_bootstrap',
            module='ion.processes.bootstrap.index_bootstrap',
            cls='IndexBootStrap',
            config=config
        )
        index_list = IndexManagementService._es_call(self.es.index_list)


        for index in STD_INDEXES.iterkeys():
            self.assertTrue(index in index_list)
    def test_clean_bootstrap(self):
        cc = self.container
        IndexManagementService._es_call(self.es.index_delete,'%s_sites_index' % get_sys_name())
        response = IndexManagementService._es_call(self.es.index_create,'%s_sites_index' % get_sys_name()) # Force a conflict
        IndexManagementService._check_response(response)

        config = CFG
        config.op='clean_bootstrap'

        cc.spawn_process(
            name='index_bootstrap',
            module='ion.processes.bootstrap.index_bootstrap',
            cls='IndexBootStrap',
            config=config
        )
        index_list = IndexManagementService._es_call(self.es.index_list)


        for index in STD_INDEXES.iterkeys():
            self.assertTrue(index in index_list)
    def test_bootstrap(self):
        cc = self.container
        #=======================================
        # Clean indexes
        #=======================================
        config = CFG
        config.op='index_bootstrap'
        
        # Thankfully, the default system.force_clean for integration tests is False :)
        
        cc.spawn_process(
            name='index_bootstrap',
            module='ion.processes.bootstrap.index_bootstrap',
            cls='IndexBootStrap',
            config=config
        )
        index_list = IndexManagementService._es_call(self.es.index_list)


        for index in STD_INDEXES.iterkeys():
            self.assertTrue(index in index_list)
Exemple #9
0
    def test_clean_bootstrap(self):
        cc = self.container
        IndexManagementService._es_call(self.es.index_delete,
                                        '%s_sites_index' % get_sys_name())
        response = IndexManagementService._es_call(
            self.es.index_create,
            '%s_sites_index' % get_sys_name())  # Force a conflict
        IndexManagementService._check_response(response)

        config = CFG
        config.op = 'clean_bootstrap'

        # Thankfully, the default system.force_clean for integration tests is False :)

        cc.spawn_process(name='index_bootstrap',
                         module='ion.processes.bootstrap.index_bootstrap',
                         cls='IndexBootStrap',
                         config=config)
        index_list = IndexManagementService._es_call(self.es.index_list)

        for index in STD_INDEXES.iterkeys():
            self.assertTrue(index in index_list)