Пример #1
0
 def setUp(self):
     NeoUnitTestBase.setUp(self)
     config = self.getStorageConfiguration(master_number=1)
     self.app = Application(config)
     self.app.name = 'NEO'
     self.app.ready = True
     self.app.pt = PartitionTable(4, 1)
     self.identification = IdentificationHandler(self.app)
Пример #2
0
def main(args=None):
    from neo.storage.app import Application
    config = Application.option_parser.parse(args)

    # setup custom logging
    logging.setup(config.get('logfile'))

    # and then, load and run the application
    app = Application(config)
    if not config.get('reset'):
        app.run()
Пример #3
0
 def setUp(self):
     NeoUnitTestBase.setUp(self)
     self.prepareDatabase(number=1)
     # create an application object
     config = self.getStorageConfiguration(master_number=1)
     self.app = Application(config)
     self.app.tm = Mock({'__contains__': True})
     # handler
     self.operation = ClientOperationHandler(self.app)
     # set pmn
     self.master_uuid = self.getMasterUUID()
     pmn = self.app.nm.getMasterList()[0]
     pmn.setUUID(self.master_uuid)
     self.app.primary_master_node = pmn
Пример #4
0
def main(args=None):
    # TODO: Forbid using "reset" along with any unneeded argument.
    #       "reset" is too dangerous to let user a chance of accidentally
    #       letting it slip through in a long option list.
    #       We should drop support configation files to make such check useful.
    (options, args) = parser.parse_args(args=args)
    config = ConfigurationManager(defaults, options, 'storage')

    # setup custom logging
    logging.setup(config.getLogfile())

    # and then, load and run the application
    from neo.storage.app import Application
    app = Application(config)
    if not config.getReset():
        app.run()
 def setUp(self):
     NeoUnitTestBase.setUp(self)
     self.prepareDatabase(number=1)
     # create an application object
     config = self.getStorageConfiguration(master_number=1)
     self.app = Application(config)
     self.verification = InitializationHandler(self.app)
     # define some variable to simulate client and storage node
     self.master_port = 10010
     self.storage_port = 10020
     self.client_port = 11011
     self.num_partitions = 1009
     self.num_replicas = 2
     self.app.operational = False
     self.app.load_lock_dict = {}
     self.app.pt = PartitionTable(self.num_partitions, self.num_replicas)
Пример #6
0
 def setUp(self):
     NeoUnitTestBase.setUp(self)
     self.prepareDatabase(number=1)
     # create an application object
     config = self.getStorageConfiguration(master_number=1)
     self.app = Application(config)
     self.app.transaction_dict = {}
     self.app.store_lock_dict = {}
     self.app.load_lock_dict = {}
     self.app.event_queue = deque()
     # handler
     self.operation = MasterOperationHandler(self.app)
     # set pmn
     self.master_uuid = self.getMasterUUID()
     pmn = self.app.nm.getMasterList()[0]
     pmn.setUUID(self.master_uuid)
     self.app.primary_master_node = pmn
     self.master_port = 10010
Пример #7
0
 def setUp(self):
     NeoUnitTestBase.setUp(self)
     self.prepareDatabase(number=1)
     # create an application object
     config = self.getStorageConfiguration(master_number=1)
     self.app = Application(config)