Пример #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
    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()
 def tearDown(self):
     set_events_enabled(True)
     self.app_test_client.cleanup()
 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
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
 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
 def tearDown(self):
     flags.set_events_enabled(False)
     self.factory.shutdown()
     self._client.instance().reset()