Example #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()
Example #2
0
class FabnetProvider(DAVProvider):
    def __init__(self, fabnet_host, security_provider):
        super(FabnetProvider, self).__init__()
        self.nibbler = Nibbler(fabnet_host, security_provider)
        self.readonly = False

    def getResourceInst(self, path, environ):
        """Return info dictionary for path.

        See DAVProvider.getResourceInst()
        """
        self._count_getResourceInst += 1
        fp = util.toUnicode(path.rstrip("/"))
        r_obj = self.nibbler.get_resource(fp)

        if r_obj is None:
            return None

        if r_obj.is_dir():
            return FolderResource(self.nibbler, path, environ, r_obj)

        return FileResource(self.nibbler, path, environ, r_obj)
Example #3
0
 def __init__(self, fabnet_host, security_provider):
     super(FabnetProvider, self).__init__()
     self.nibbler = Nibbler(fabnet_host, security_provider)
     self.readonly = False