Пример #1
0
    def test01_dht_init(self):
        n_node = 'init-fabnet'
        i = 1987
        address = '127.0.0.1:%s'%i

        home = '/tmp/node_%s'%i
        if os.path.exists(home):
            shutil.rmtree(home)
        os.mkdir(home)

        logger.warning('{SNP} STARTING NODE %s'%address)
        args = ['/usr/bin/python', './fabnet/bin/fabnet-node', address, n_node, '%.02i'%i, home, VALID_STORAGE, PASSWD]
        if DEBUG:
            args.append('--debug')
        p = subprocess.Popen(args)
        logger.warning('{SNP} PROCESS STARTED')
        time.sleep(1.5)

        TestDHTInitProcedure.NODE_PROC = p
        TestDHTInitProcedure.NODE_ADDRESS = address

        security_manager = init_security_manager(CLIENT_KS_PATH, PASSWD)
        nibbler = Nibbler('127.0.0.1', security_manager)
        TestDHTInitProcedure.NIBBLER_INST = nibbler

        nibbler.register_user()