예제 #1
0
    def install(self, silent=True):
        if self._start_against_running:
            self._iproto = self._start_against_running
            self._admin = int(self._start_against_running) + 1
            return
        color_log('Installing the server ...\n', schema='serv_text')
        color_log('    Found executable at ', schema='serv_text')
        color_log(self.binary + '\n', schema='path')
        color_log('    Found tarantoolctl at  ', schema='serv_text')
        color_log(self.ctl_path + '\n', schema='path')
        color_log('    Creating and populating working directory in ',
                  schema='serv_text')
        color_log(self.vardir + ' ...\n', schema='path')
        if not os.path.exists(self.vardir):
            os.makedirs(self.vardir)
        else:
            color_log('    Found old vardir, deleting ...\n',
                      schema='serv_text')
            self.kill_old_server()
            self.cleanup()
        self.copy_files()

        if self.use_unix_sockets:
            self._admin = os.path.join(self.vardir, "socket-admin")
        else:
            self._admin = find_port()

        self._iproto = find_port()

        # these sockets will be created by tarantool itself
        path = os.path.join(self.vardir, self.name + '.control')
        warn_unix_socket(path)
예제 #2
0
    def install(self, silent=True):
        if self._start_against_running:
            self._iproto = self._start_against_running
            self._admin = int(self._start_against_running) + 1
            return
        if not silent:
            color_stdout('Installing the server ...\n', schema='serv_text')
            color_stdout('    Found executable at ', schema='serv_text')
            color_stdout(self.binary + '\n', schema='path')
            color_stdout('    Found tarantoolctl at  ', schema='serv_text')
            color_stdout(self.ctl_path + '\n', schema='path')
            color_stdout('    Creating and populating working directory in ',
                         schema='serv_text')
            color_stdout(self.vardir + ' ...\n', schema='path')
        if not os.path.exists(self.vardir):
            os.makedirs(self.vardir)
        else:
            if not silent:
                color_stdout('    Found old vardir, deleting ...\n',
                             schema='serv_text')
            self.kill_old_server()
            self.cleanup()
        self.copy_files()
        port = random.randrange(3300, 9999)

        if self.use_unix_sockets:
            self._admin = os.path.join(self.vardir, "socket-admin")
        else:
            self._admin = find_port(port)
            port = self._admin.port + 1

        self._iproto = find_port(port)
예제 #3
0
 def __init__(self, host, port):
     # When specific port range was acquired for current worker, don't allow
     # OS set port for us that isn't from specified range.
     if port == 0:
         port = find_port()
     super(TarantoolInspector, self).__init__((host, port))
     self.parser = None
예제 #4
0
 def deploy(self, vardir=None, silent=True, need_init=True):
     self.vardir = vardir
     if not os.access(self.vardir, os.F_OK):
         os.makedirs(self.vardir)
     if self.lua_libs:
         for i in self.lua_libs:
             source = os.path.join(self.testdir, i)
             try:
                 if os.path.isdir(source):
                     shutil.copytree(source,
                                     os.path.join(self.vardir,
                                                  os.path.basename(source)))
                 else:
                     shutil.copy(source, self.vardir)
             except IOError as e:
                 if (e.errno == errno.ENOENT):
                     continue
                 raise
     if self.use_unix_sockets_iproto:
         path = os.path.join(self.vardir, self.name + ".socket-iproto")
         warn_unix_socket(path)
         self.iproto = path
     else:
         self.iproto = str(find_port())
     shutil.copy(os.path.join(self.TEST_RUN_DIR, 'test_run.lua'),
                 self.vardir)
예제 #5
0
 def __init__(self, host, port):
     # When specific port range was acquired for current worker, don't allow
     # OS set port for us that isn't from specified range.
     if port == 0:
         port = find_port()
     super(TarantoolInspector, self).__init__((host, port))
     self.parser = None
예제 #6
0
    def install(self, silent=True):
        if self._start_against_running:
            self._iproto = self._start_against_running
            self._admin = int(self._start_against_running) + 1
            return
        color_log('Installing the server ...\n', schema='serv_text')
        color_log('    Found executable at ', schema='serv_text')
        color_log(self.binary + '\n', schema='path')
        color_log('    Found tarantoolctl at  ', schema='serv_text')
        color_log(self.ctl_path + '\n', schema='path')
        color_log('    Creating and populating working directory in ',
                  schema='serv_text')
        color_log(self.vardir + ' ...\n', schema='path')
        if not os.path.exists(self.vardir):
            os.makedirs(self.vardir)
        else:
            color_log('    Found old workdir, deleting ...\n',
                      schema='serv_text')
            self.kill_old_server()
            self.cleanup()
        self.copy_files()

        if self.use_unix_sockets:
            path = os.path.join(self.vardir, self.name + ".socket-admin")
            warn_unix_socket(path)
            self._admin = path
        else:
            self._admin = find_port()

        if self.use_unix_sockets_iproto:
            path = os.path.join(self.vardir, self.name + ".socket-iproto")
            warn_unix_socket(path)
            self._iproto = path
        else:
            self._iproto = find_port()

        # these sockets will be created by tarantool itself
        path = os.path.join(self.vardir, self.name + '.control')
        warn_unix_socket(path)
예제 #7
0
    def install(self, silent=True):
        if self._start_against_running:
            self._iproto = self._start_against_running
            self._admin = int(self._start_against_running) + 1
            return
        color_log('DEBUG: [Instance {}] Installing the server...\n'.format(
            self.name), schema='info')
        color_log(' | Found executable at {}\n'.format(self.binary))
        color_log(' | Found tarantoolctl at {}\n'.format(self.ctl_path))
        color_log(' | Creating and populating working directory in '
                  '{}...\n'.format(self.vardir))
        if not os.path.exists(self.vardir):
            os.makedirs(self.vardir)
        else:
            color_log(' | Found old workdir, deleting...\n')
            self.kill_old_server()
            self.cleanup()
        self.copy_files()

        if self.use_unix_sockets:
            path = os.path.join(self.vardir, self.name + ".socket-admin")
            warn_unix_socket(path)
            self._admin = path
        else:
            self._admin = find_port()

        if self.use_unix_sockets_iproto:
            path = os.path.join(self.vardir, self.name + ".socket-iproto")
            warn_unix_socket(path)
            self._iproto = path
        else:
            self._iproto = find_port()

        # these sockets will be created by tarantool itself
        path = os.path.join(self.vardir, self.name + '.control')
        warn_unix_socket(path)
예제 #8
0
 def deploy(self, vardir=None, silent=True, need_init=True):
     self.vardir = vardir
     if not os.access(self.vardir, os.F_OK):
         os.makedirs(self.vardir)
     if self.lua_libs:
         for i in self.lua_libs:
             source = os.path.join(self.testdir, i)
             try:
                 shutil.copy(source, self.vardir)
             except IOError as e:
                 if (e.errno == errno.ENOENT):
                     continue
                 raise
     os.putenv("LISTEN", str(find_port(34000)))
     shutil.copy(os.path.join(self.TEST_RUN_DIR, 'test_run.lua'),
                 self.vardir)
예제 #9
0
 def deploy(self, vardir=None, silent=True, need_init=True):
     self.vardir = vardir
     if not os.access(self.vardir, os.F_OK):
         os.makedirs(self.vardir)
     if self.lua_libs:
         for i in self.lua_libs:
             source = os.path.join(self.testdir, i)
             try:
                 if os.path.isdir(source):
                     shutil.copytree(source,
                                     os.path.join(self.vardir,
                                                  os.path.basename(source)))
                 else:
                     shutil.copy(source, self.vardir)
             except IOError as e:
                 if (e.errno == errno.ENOENT):
                     continue
                 raise
     os.putenv("LISTEN", str(find_port()))
     shutil.copy(os.path.join(self.TEST_RUN_DIR, 'test_run.lua'),
                 self.vardir)