当前位置: 首页>>代码示例>>Python>>正文


Python RemoteMachineShellConnection.execute_vbuckettool方法代码示例

本文整理汇总了Python中remote.remote_util.RemoteMachineShellConnection.execute_vbuckettool方法的典型用法代码示例。如果您正苦于以下问题:Python RemoteMachineShellConnection.execute_vbuckettool方法的具体用法?Python RemoteMachineShellConnection.execute_vbuckettool怎么用?Python RemoteMachineShellConnection.execute_vbuckettool使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在remote.remote_util.RemoteMachineShellConnection的用法示例。


在下文中一共展示了RemoteMachineShellConnection.execute_vbuckettool方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_vbuckets_ids

# 需要导入模块: from remote.remote_util import RemoteMachineShellConnection [as 别名]
# 或者: from remote.remote_util.RemoteMachineShellConnection import execute_vbuckettool [as 别名]
 def test_vbuckets_ids(self):
     self._load_by_vbuckets(self.buckets[0])
     shell = RemoteMachineShellConnection(self.master)
     try:
         prefix = 'curl http://localhost:%s/pools/default/buckets/%s |' % (
                   self.master.port or '8091', self.buckets[0].name)
         for vb, items in self.keys_per_vbuckets_dict.iteritems():
             o, _ = shell.execute_vbuckettool(items, prefix)
             result = self._parse_vbuckets(o)
             for item in items:
                 self.assertEqual(str(result[item][0]), str(vb.id),
                                  'Key: %s. Vbucket expected is %s. Actual: %s' % (
                                   item, vb.id, result[item]))
     finally:
         shell.disconnect()
开发者ID:uvenum,项目名称:testrunner,代码行数:17,代码来源:vbuckettooltest.py

示例2: test_vbuckets_master_replicas

# 需要导入模块: from remote.remote_util import RemoteMachineShellConnection [as 别名]
# 或者: from remote.remote_util.RemoteMachineShellConnection import execute_vbuckettool [as 别名]
 def test_vbuckets_master_replicas(self):
     self.assertTrue(self.num_servers >= self.num_replicas + 1,
                     'This test requires more servers')
     self._load_by_vbuckets(self.buckets[0])
     bucket = RestConnection(self.master).get_bucket(self.buckets[0])
     shell = RemoteMachineShellConnection(self.master)
     try:
         prefix = 'curl http://localhost:%s/pools/default/buckets/%s |' % (
                   self.master.port or '8091', bucket.name)
         for vb, items in self.keys_per_vbuckets_dict.iteritems():
             o, _ = shell.execute_vbuckettool(items, prefix)
             result = self._parse_vbuckets(o)
             for item in items:
                 self.assertTrue(result[item][1].startswith(bucket.vbuckets[vb.id].master),
                                 'Key: %s. Vbucket master expected is %s. Actual: %s' % (
                                  item, bucket.vbuckets[vb.id].master, result[item]))
                 self.assertFalse(set([replica[:replica.index(':')]
                                       for replica in result[item][2]]) -
                                  set(bucket.vbuckets[vb.id].replica),
                                 'Key: %s. Vbucket master expected is %s. Actual: %s' % (
                                  item, bucket.vbuckets[vb.id].replica, result[item]))
     finally:
         shell.disconnect()
开发者ID:uvenum,项目名称:testrunner,代码行数:25,代码来源:vbuckettooltest.py


注:本文中的remote.remote_util.RemoteMachineShellConnection.execute_vbuckettool方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。