コード例 #1
0
ファイル: Dmc.py プロジェクト: mnunberg/RLTest
 def PrintEnvData(self, prefix=''):
     print Colors.Yellow(prefix + 'dmc binary path: %s' % self.dmcBinaryPath)
     print Colors.Yellow(prefix + 'dmc env: %s' % str(self.env))
     print Colors.Yellow(prefix + 'dir path: %s' % str(self.directory))
     print Colors.Yellow(prefix + 'log file name: %s' % str(self.DMC_LOG_FILE_NAME))
     if self.libPath:
         print Colors.Yellow(prefix + 'lib path: %s' % str(self.libPath))
コード例 #2
0
ファイル: redis_cluster.py プロジェクト: rafie/RLTest
 def printEnvData(self, prefix=''):
     print(Colors.Yellow(prefix + 'info:'))
     print(Colors.Yellow(prefix + '\tshards count:%d' % len(self.shards)))
     if self.modulePath:
         print(Colors.Yellow(prefix + '\tzip module path:%s' % self.modulePath))
     if self.moduleArgs:
         print(Colors.Yellow(prefix + '\tmodule args:%s' % self.moduleArgs))
     for i, shard in enumerate(self.shards):
         print(Colors.Yellow(prefix + 'shard: %d' % (i + 1)))
         shard.printEnvData(prefix + '\t')
コード例 #3
0
    def download_binaries(self, binariesName='binaries.tar'):
        print(Colors.Yellow('installing enterprise binaries'))
        print(Colors.Yellow('creating RLTest working dir: %s' % self.root))
        try:
            shutil.rmtree(self.root)
            os.makedirs(self.root)
        except Exception:
            pass

        print(Colors.Yellow('download binaries'))
        args = ['wget', self.url, '-O', os.path.join(self.root, binariesName)]
        process = subprocess.Popen(args=args,
                                   stdout=sys.stdout,
                                   stderr=sys.stdout)
        process.wait()
        if process.poll() != 0:
            raise Exception('failed to download enterprise binaries from s3')

        print(Colors.Yellow('extracting binaries'))

        args = [
            'tar', '-xvf',
            os.path.join(self.root, binariesName), '--directory', self.root,
            self.debname
        ]
        process = subprocess.Popen(args=args,
                                   stdout=sys.stdout,
                                   stderr=sys.stdout)
        process.wait()
        if process.poll() != 0:
            raise Exception('failed to extract binaries to %s' %
                            self.self.root)

        # TODO: Support centos that does not have dpkg command
        args = ['dpkg', '-x', os.path.join(self.root, self.debname), self.root]
        process = subprocess.Popen(args=args,
                                   stdout=sys.stdout,
                                   stderr=sys.stdout)
        process.wait()
        if process.poll() != 0:
            raise Exception('failed to extract binaries to %s' %
                            self.self.root)

        print(Colors.Yellow('finished installing enterprise binaries'))
コード例 #4
0
 def printEnvData(self, prefix=''):
     print Colors.Yellow(prefix + 'bdb info:')
     print Colors.Yellow(prefix + '\tlistening port:%d' % self.DMC_PORT)
     print Colors.Yellow(prefix + '\tshards count:%d' % len(self.shards))
     if self.modulePath:
         print Colors.Yellow(prefix +
                             '\tzip module path:%s' % self.modulePath)
     if self.moduleSoFilePath:
         print Colors.Yellow(prefix +
                             '\tso module path:%s' % self.moduleSoFilePath)
     if self.moduleArgs:
         print Colors.Yellow(prefix + '\tmodule args:%s' % self.moduleArgs)
     for i, shard in enumerate(self.shards):
         print Colors.Yellow(prefix + 'shard: %d' % (i + 1))
         shard.printEnvData(prefix + '\t')
     print Colors.Yellow(prefix + 'ccs:')
     self.ccs.PrintEnvData(prefix + '\t')
     print Colors.Yellow(prefix + 'dmc:')
     self.dmc.PrintEnvData(prefix + '\t')
コード例 #5
0
ファイル: CcsMock.py プロジェクト: mnunberg/RLTest
 def PrintEnvData(self, prefix=''):
     print Colors.Yellow(prefix + 'pid: %d' % self.process.pid)
     print Colors.Yellow(prefix + 'unix socket: %s' %
                         self.CCS_UNIX_SOCKET_DEFAULT_PATH)
     print Colors.Yellow(prefix + 'binary path: %s' % self.redisBinaryPath)
     if self.directory:
         print Colors.Yellow(prefix + 'db dir path: %s' % (self.directory))
     print Colors.Yellow(prefix + 'rdb file name: %s' %
                         (self.CCS_DB_RDB_FILE_NAME))
     print Colors.Yellow(prefix + 'log file name: %s' %
                         (self.CCS_LOG_FILE_NAME))
     if self.libPath:
         print Colors.Yellow(prefix + 'lib path: %s' % (self.libPath))
コード例 #6
0
ファイル: __main__.py プロジェクト: rafie/RLTest
 def printError(self):
     print('\t' + Colors.Yellow('[ERROR]'))