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


Python BucketOperationHelper.wait_for_bucket_deletion方法代码示例

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


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

示例1: check

# 需要导入模块: from membase.helper.bucket_helper import BucketOperationHelper [as 别名]
# 或者: from membase.helper.bucket_helper.BucketOperationHelper import wait_for_bucket_deletion [as 别名]
 def check(self, task_manager):
     rest = RestConnection(self.server)
     if BucketOperationHelper.wait_for_bucket_deletion(self.bucket, rest, 200):
         self.set_result(True)
     else:
         self.set_result(False)
     self.state = FINISHED
开发者ID:paul-guo-,项目名称:appstack,代码行数:9,代码来源:task.py

示例2: test_valid_bucket_name

# 需要导入模块: from membase.helper.bucket_helper import BucketOperationHelper [as 别名]
# 或者: from membase.helper.bucket_helper.BucketOperationHelper import wait_for_bucket_deletion [as 别名]
 def test_valid_bucket_name(self, password='password'):
         tasks = []
         if self.bucket_type == 'sasl':
             self.cluster.create_sasl_bucket(self.server, self.bucket_name, password, self.num_replicas, self.bucket_size)
             self.buckets.append(Bucket(name=self.bucket_name, authType="sasl", saslPassword=password, num_replicas=self.num_replicas,
                                        bucket_size=self.bucket_size, master_id=self.server))
         elif self.bucket_type == 'standard':
             self.cluster.create_standard_bucket(self.server, self.bucket_name, STANDARD_BUCKET_PORT + 1, self.bucket_size, self.num_replicas)
             self.buckets.append(Bucket(name=self.bucket_name, authType=None, saslPassword=None, num_replicas=self.num_replicas,
                                        bucket_size=self.bucket_size, port=STANDARD_BUCKET_PORT + 1, master_id=self.server))
         elif self.bucket_type == "memcached":
             tasks.append(self.cluster.async_create_memcached_bucket(self.server, self.bucket_name, STANDARD_BUCKET_PORT + 1,
                                                                     self.bucket_size, self.num_replicas))
             self.buckets.append(Bucket(name=self.bucket_name, authType=None, saslPassword=None, num_replicas=self.num_replicas,
                                        bucket_size=self.bucket_size, port=STANDARD_BUCKET_PORT + 1 , master_id=self.server, type='memcached'))
             for task in tasks:
                 task.result()
         else:
             self.log.error('Bucket type not specified')
             return
         self.assertTrue(BucketOperationHelper.wait_for_bucket_creation(self.bucket_name, self.rest),
                         msg='failed to start up bucket with name "{0}'.format(self.bucket_name))
         gen_load = BlobGenerator('buckettest', 'buckettest-', self.value_size, start=0, end=self.num_items)
         self._load_all_buckets(self.server, gen_load, "create", 0)
         self.cluster.bucket_delete(self.server, self.bucket_name)
         self.assertTrue(BucketOperationHelper.wait_for_bucket_deletion(self.bucket_name, self.rest, timeout_in_seconds=60),
                         msg='bucket "{0}" was not deleted even after waiting for 30 seconds'.format(self.bucket_name))
开发者ID:abhinavdangeti,项目名称:testrunner,代码行数:29,代码来源:buckettests.py

示例3: test_default_moxi

# 需要导入模块: from membase.helper.bucket_helper import BucketOperationHelper [as 别名]
# 或者: from membase.helper.bucket_helper.BucketOperationHelper import wait_for_bucket_deletion [as 别名]
    def test_default_moxi(self):
        name = 'default'
        for serverInfo in self.servers:
            rest = RestConnection(serverInfo)
            replicaNumber = 1
            proxyPort = rest.get_nodes_self().moxi
            rest.create_bucket(bucket=name,
                               ramQuotaMB=200,
                               replicaNumber=replicaNumber,
                               proxyPort=proxyPort)
            msg = 'create_bucket succeeded but bucket {0} does not exist'.format(name)
            self.assertTrue(BucketOperationHelper.wait_for_bucket_creation(name, rest), msg=msg)
            ready = BucketOperationHelper.wait_for_memcached(serverInfo, name)
            self.assertTrue(ready, "wait_for_memcached failed")
            inserted_keys = BucketOperationHelper.load_some_data(serverInfo, 1, name)
            self.assertTrue(inserted_keys, 'unable to insert any key to memcached')
            verified = BucketOperationHelper.verify_data(serverInfo, inserted_keys, True, False, self, bucket=name)
            self.assertTrue(verified, msg='verified all the keys stored')
            #verify keys
            rest.delete_bucket(name)
            msg = 'bucket "{0}" was not deleted even after waiting for two minutes'.format(name)
            self.assertTrue(BucketOperationHelper.wait_for_bucket_deletion(name, rest, timeout_in_seconds=60), msg=msg)

            rest.create_bucket(bucket=name,
                               ramQuotaMB=200,
                               replicaNumber=replicaNumber,
                               proxyPort=proxyPort)
            msg = 'create_bucket succeeded but bucket {0} does not exist'.format(name)
            self.assertTrue(BucketOperationHelper.wait_for_bucket_creation(name, rest), msg=msg)
            BucketOperationHelper.wait_for_memcached(serverInfo, name)
            #now let's recreate the bucket
            self.log.info('recreated the default bucket...')
            #loop over the keys make sure they dont exist
            self.assertTrue(BucketOperationHelper.keys_dont_exist(serverInfo, inserted_keys, name),
                            msg='at least one key found in the bucket')
开发者ID:steveyen,项目名称:testrunner,代码行数:37,代码来源:recreatebuckettests.py

示例4: check_bucket_deleted

# 需要导入模块: from membase.helper.bucket_helper import BucketOperationHelper [as 别名]
# 或者: from membase.helper.bucket_helper.BucketOperationHelper import wait_for_bucket_deletion [as 别名]
 def check_bucket_deleted(self):
     rest = RestConnection(self.server)
     if BucketOperationHelper.wait_for_bucket_deletion(self.bucket, rest, 200):
         self.set_result({"status": "success", "value": None})
     else:
         self.set_result({"status": "error",
                          "value": "{0} bucket took too long to delete".format(self.bucket)})
     self.state = "finished"
开发者ID:jchris,项目名称:testrunner,代码行数:10,代码来源:task.py

示例5: delete_all_buckets_or_assert

# 需要导入模块: from membase.helper.bucket_helper import BucketOperationHelper [as 别名]
# 或者: from membase.helper.bucket_helper.BucketOperationHelper import wait_for_bucket_deletion [as 别名]
 def delete_all_buckets_or_assert(ips, test_case):
     log.info('deleting existing buckets on {0}'.format(ips))
     for ip in ips:
         rest = RestConnection(ip=ip)
         buckets = rest.get_buckets()
         for bucket in buckets:
             rest.delete_bucket(bucket.name)
             log.info('deleted bucket : {0}'.format(bucket.name))
             msg = 'bucket "{0}" was not deleted even after waiting for two minutes'.format(bucket.name)
             test_case.assertTrue(BucketOperationHelper.wait_for_bucket_deletion(bucket.name, rest, 200), msg=msg)
开发者ID:jchris,项目名称:testrunner,代码行数:12,代码来源:rebalance_helper.py

示例6: check

# 需要导入模块: from membase.helper.bucket_helper import BucketOperationHelper [as 别名]
# 或者: from membase.helper.bucket_helper.BucketOperationHelper import wait_for_bucket_deletion [as 别名]
 def check(self, task_manager):
     rest = RestConnection(self.server)
     try:
         if BucketOperationHelper.wait_for_bucket_deletion(self.bucket, rest, 200):
             self.set_result(True)
         else:
             self.set_result(False)
         self.state = FINISHED
     #catch and set all unexpected exceptions
     except Exception as e:
         self.state = FINISHED
         self.log.info("Unexpected Exception Caught")
         self.set_exception(e)
开发者ID:jchris,项目名称:testrunner,代码行数:15,代码来源:task.py

示例7: test_ephemeral_buckets

# 需要导入模块: from membase.helper.bucket_helper import BucketOperationHelper [as 别名]
# 或者: from membase.helper.bucket_helper.BucketOperationHelper import wait_for_bucket_deletion [as 别名]
    def test_ephemeral_buckets(self):
        eviction_policy = self.input.param("eviction_policy", 'noEviction')
        shared_params = self._create_bucket_params(server=self.server, size=100,
                                                   replicas=self.num_replicas, bucket_type='ephemeral',
                                                   eviction_policy=eviction_policy)
        # just do sasl for now, pending decision on support of non-sasl buckets in 5.0
        self.cluster.create_sasl_bucket(name=self.bucket_name, password=self.sasl_password, bucket_params=shared_params)
        self.buckets.append(Bucket(name=self.bucket_name, authType="sasl", saslPassword=self.sasl_password,
                                           num_replicas=self.num_replicas,
                                           bucket_size=self.bucket_size, master_id=self.server))

        self.assertTrue(BucketOperationHelper.wait_for_bucket_creation(self.bucket_name, self.rest),
                            msg='failed to start up bucket with name "{0}'.format(self.bucket_name))
        gen_load = BlobGenerator('buckettest', 'buckettest-', self.value_size, start=0, end=self.num_items)
        self._load_all_buckets(self.server, gen_load, "create", 0)
        self.cluster.bucket_delete(self.server, self.bucket_name)
        self.assertTrue(BucketOperationHelper.wait_for_bucket_deletion(self.bucket_name, self.rest, timeout_in_seconds=60),
                            msg='bucket "{0}" was not deleted even after waiting for 30 seconds'.format(self.bucket_name))
开发者ID:mihirkamdarcouchbase,项目名称:testrunner,代码行数:20,代码来源:buckettests.py

示例8: test_default_moxi_sasl

# 需要导入模块: from membase.helper.bucket_helper import BucketOperationHelper [as 别名]
# 或者: from membase.helper.bucket_helper.BucketOperationHelper import wait_for_bucket_deletion [as 别名]
 def test_default_moxi_sasl(self):
     name = 'new-bucket-{0}'.format(uuid.uuid4())
     for serverInfo in self.servers:
         rest = RestConnection(serverInfo)
         replicaNumber = 1
         proxyPort = rest.get_nodes_self().moxi
         rest.create_bucket(bucket=name,
                            ramQuotaMB=200,
                            replicaNumber=replicaNumber,
                            proxyPort=proxyPort,
                            authType="sasl",
                            saslPassword='password')
         msg = 'create_bucket succeeded but bucket {0} does not exist'.format(name)
         self.assertTrue(BucketOperationHelper.wait_for_bucket_creation(name, rest), msg=msg)
         ready = BucketOperationHelper.wait_for_memcached(serverInfo, name)
         self.assertTrue(ready, "wait_for_memcached failed")
         rest.delete_bucket(name)
         msg = 'bucket "{0}" was not deleted even after waiting for two minutes'.format(name)
         self.assertTrue(BucketOperationHelper.wait_for_bucket_deletion(name, rest, timeout_in_seconds=30), msg=msg)
开发者ID:steveyen,项目名称:testrunner,代码行数:21,代码来源:recreatebuckettests.py

示例9: test_non_default_moxi

# 需要导入模块: from membase.helper.bucket_helper import BucketOperationHelper [as 别名]
# 或者: from membase.helper.bucket_helper.BucketOperationHelper import wait_for_bucket_deletion [as 别名]
 def test_non_default_moxi(self):
     name = "new-bucket-{0}".format(uuid.uuid4())
     for serverInfo in self.servers:
         replicas = [0, 1, 2, 3]
         for replicaNumber in replicas:
             rest = RestConnection(serverInfo)
             proxyPort = rest.get_nodes_self().moxi + 2000
             rest.create_bucket(bucket=name, ramQuotaMB=200, replicaNumber=replicaNumber, proxyPort=proxyPort)
             remote = RemoteMachineShellConnection(serverInfo)
             msg = "create_bucket succeeded but bucket {0} does not exist".format(name)
             self.assertTrue(BucketOperationHelper.wait_for_bucket_creation(name, rest), msg=msg)
             rest.delete_bucket(name)
             msg = 'bucket "{0}" was not deleted even after waiting for 30 seconds'.format(name)
             self.assertTrue(
                 BucketOperationHelper.wait_for_bucket_deletion(name, rest, timeout_in_seconds=30), msg=msg
             )
             msg = "bucket {0} data files are not deleted after bucket deleted from membase".format(name)
             self.assertTrue(
                 self.wait_for_data_files_deletion(name, remote_connection=remote, rest=rest, timeout_in_seconds=20),
                 msg=msg,
             )
             BucketOperationHelper.delete_bucket_or_assert(serverInfo, name, self)
开发者ID:vmx,项目名称:testrunner,代码行数:24,代码来源:deletebuckettests.py


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