本文整理汇总了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()
示例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()