コード例 #1
0
 def setUp(self):
     flags.set_events_enabled(True)
     self._server = server.ensure_server(
         emit_addr="tcp://127.0.0.1:0",
         reg_addr="tcp://127.0.0.1:0")
     self._client.configure_client(
         emit_addr="tcp://127.0.0.1:%d" % self._server.pull_port,
         reg_addr="tcp://127.0.0.1:%d" % self._server.pub_port)
コード例 #2
0
    def setUp(self):
        flags.set_events_enabled(True)
        self.factory = ZmqFactory()
        self._server = server.ensure_server(emit_addr="tcp://127.0.0.1:0",
                                            reg_addr="tcp://127.0.0.1:0",
                                            factory=self.factory,
                                            enable_curve=False)

        self._client.configure_client(
            emit_addr="tcp://127.0.0.1:%d" % self._server.pull_port,
            reg_addr="tcp://127.0.0.1:%d" % self._server.pub_port,
            factory=self.factory,
            enable_curve=False)
コード例 #3
0
ファイル: test_events.py プロジェクト: leapcode/leap_pycommon
    def setUp(self):
        flags.set_events_enabled(True)
        self.factory = ZmqFactory()
        self._server = server.ensure_server(
            emit_addr="tcp://127.0.0.1:0",
            reg_addr="tcp://127.0.0.1:0",
            factory=self.factory,
            enable_curve=False)

        self._client.configure_client(
            emit_addr="tcp://127.0.0.1:%d" % self._server.pull_port,
            reg_addr="tcp://127.0.0.1:%d" % self._server.pub_port,
            factory=self.factory, enable_curve=False)
コード例 #4
0
import shutil
import sys
import tempfile

# This is needed because the twisted shipped with wheezy is too old
# to do proper ssl verification.
os.environ['SKIP_TWISTED_SSL_CHECK'] = '1'

from twisted.internet import defer, reactor
from twisted.python import log
from twisted.python.lockfile import FilesystemLock

from client_side_db import get_soledad_instance
from leap.common.events import flags

flags.set_events_enabled(False)

NUMDOCS = 1
USAGE = "Usage: %s uuid token server cert_file password" % sys.argv[0]
SYNC_TIMEOUT = 60


def bail(msg, exitcode):
    print "[!] %s" % msg
    sys.exit(exitcode)


def obtain_lock():
    scriptname = os.path.basename(__file__)
    lockfile = os.path.join(tempfile.gettempdir(), scriptname + '.lock')
    lock = FilesystemLock(lockfile)
コード例 #5
0
 def tearDown(self):
     set_events_enabled(True)
     self.cleanup()
コード例 #6
0
 def setUp(self):
     set_events_enabled(False)
     super(SoledadTestBase, self).setUp()
     self.adaptor = SoledadMailAdaptor()
     self.mbox_uuid = str(uuid4())
     yield self.start_client()
コード例 #7
0
 def tearDown(self):
     set_events_enabled(True)
     self.app_test_client.cleanup()
コード例 #8
0
 def setUp(self):
     set_events_enabled(False)
     super(SoledadTestBase, self).setUp()
     self.adaptor = SoledadMailAdaptor()
     self.mbox_uuid = str(uuid4())
     yield self.app_test_client.start_client()
コード例 #9
0
ファイル: profile-sync.py プロジェクト: Moscarda/soledad
import argparse
import commands
import getpass
import logging
import mmap
import os
import tempfile

from datetime import datetime
from twisted.internet import reactor

from util import StatsLogger, ValidateUserHandle
from client_side_db import _get_soledad_instance, _get_soledad_info
from leap.common.events import flags

flags.set_events_enabled(False)


# create a logger
logger = logging.getLogger(__name__)
LOG_FORMAT = '%(asctime)s %(message)s'
logging.basicConfig(format=LOG_FORMAT, level=logging.INFO)

GITVER = commands.getoutput('git describe')


def get_and_run_plop_collector():
    from plop.collector import Collector
    collector = Collector()
    collector.start()
    return collector
コード例 #10
0
 def tearDown(self):
     set_events_enabled(True)
     self.cleanup()
コード例 #11
0
 def tearDown(self):
     flags.set_events_enabled(False)
     self.factory.shutdown()
     self._client.instance().reset()
コード例 #12
0
 def tearDown(self):
     self._client.shutdown()
     self._server.shutdown()
     flags.set_events_enabled(False)
     # wait a bit for sockets to close properly
     time.sleep(0.1)
コード例 #13
0
ファイル: test_events.py プロジェクト: leapcode/leap_pycommon
 def tearDown(self):
     flags.set_events_enabled(False)
     self.factory.shutdown()
     self._client.instance().reset()