def setUp(self):
        # load and verify registry
        from flumotion.common import registry
        reg = registry.getRegistry()

        self.vishnu = manager.Vishnu('test', unsafeTracebacks=1)
        self._workers = {}  # id -> avatar
        self._components = {}  # id -> avatar
    def setUp(self):
        self.vishnu = manager.Vishnu('test', unsafeTracebacks=True)
        keycard = keycards.KeycardUACPP('user', 'test', '127.0.0.1')
        self.heaven = self.vishnu.adminHeaven
        d = self.vishnu.dispatcher.requestAvatar('foo-avatar-id', keycard,
                                                 FakeMind(), pb.IPerspective,
                                                 interfaces.IAdminMedium)

        def gotAvatar((iface, avatar, cleanup)):
            self.avatar = avatar
            self._cleanup = cleanup

        d.addCallback(gotAvatar)
        return d
示例#3
0
    def setUp(self):
        from flumotion.twisted import pb
        from flumotion.common import server, connection
        from flumotion.manager import manager, config
        from StringIO import StringIO

        managerConf = """
        <planet>
        <manager name="planet">
            <host>localhost</host>
            <port>0</port>
            <transport>tcp</transport>
            <component name="manager-bouncer" type="htpasswdcrypt-bouncer">
              <property name="data"><![CDATA[
        user:PSfNpHTkpTx1M
        ]]></property>
            </component>
          </manager>
        </planet>
        """

        conf = config.ManagerConfigParser(StringIO(managerConf)).manager
        self.vishnu = manager.Vishnu(conf.name,
                                     unsafeTracebacks=True)
        self.vishnu.loadManagerConfigurationXML(StringIO(managerConf))
        s = server.Server(self.vishnu)
        if conf.transport == "ssl":
            p = s.startSSL(conf.host, conf.port, conf.certificate,
                           configure.configdir)
        elif conf.transport == "tcp":
            p = s.startTCP(conf.host, conf.port)
        self.tport = p
        self.port = p.getHost().port
        i = connection.PBConnectionInfo('localhost', self.port,
                                        conf.transport == 'ssl',
                                        pb.Authenticator(username='******',
                                                         password='******'))
        self.connectionInfo = i
 def setUp(self):
     self._mappers = {}
     self.heaven = component.ComponentHeaven(manager.Vishnu('test'))
示例#5
0
    setup.setupPackagePath()

    # log our standardized starting marker
    log.info('manager', "Starting manager '%s'" % options.name)

    log.debug('manager', 'Running Flumotion version %s' %
        configure.version)
    import twisted.copyright
    log.debug('manager', 'Running against Twisted version %s' %
        twisted.copyright.version)
    from flumotion.project import project
    for p in project.list():
        log.debug('manager', 'Registered project %s version %s' % (
            p, project.get(p, 'version')))

    vishnu = manager.Vishnu(options.name, configDir=managerConfigDir)
    for managerConfigFile in args[1:]:
        vishnu.loadManagerConfigurationXML(managerConfigFile)

    paths = [os.path.abspath(filename) for filename in args[1:]]
    reactor.callLater(0, _initialLoadConfig, vishnu, paths)
    reactor.callLater(0, vishnu.startManagerPlugs)

    # set up server based on transport
    myServer = server.Server(vishnu)
    try:
        if options.transport == "ssl":
            myServer.startSSL(options.host, options.port, options.certificate,
                configure.configdir)
        elif options.transport == "tcp":
            myServer.startTCP(options.host, options.port)