コード例 #1
0
 def test_delete_nonexistant_scope(self):
     try:
         BucketUtils.drop_scope(self.cluster.master, self.bucket, "sumedh")
     except Exception as e:
         self.log.info("Non existant collection deletion failed as expected")
     else:
         self.fail("deletion of non existing scope did not fail")
コード例 #2
0
 def test_delete_default_scope(self):
     try:
         BucketUtils.drop_scope(self.cluster.master, self.bucket, "_default")
     except Exception as e:
         self.log.info("Deafult Scope deletion failed as expected")
     else:
         self.fail("Default scope deletion did not fail")
コード例 #3
0
 def test_delete_nonexistant_scope(self):
     try:
         BucketUtils.drop_scope(self.cluster.master, self.bucket,
                                "non_existent_col_123")
     except Exception:
         self.log.info("Drop scope failed as expected")
     else:
         self.fail("deletion of non existing scope did not fail")
コード例 #4
0
ファイル: basic_ops.py プロジェクト: ritalrw/TAF
    def test_create_delete_recreate_scope(self):
        bucket_dict = BucketUtils.get_random_scopes(self.bucket_util.buckets,
                                                    "all", 1)
        # Delete scopes
        for bucket_name, scope_dict in bucket_dict.items():
            bucket = BucketUtils.get_bucket_obj(self.bucket_util.buckets,
                                                bucket_name)
            for scope_name, _ in scope_dict["scopes"].items():
                BucketUtils.drop_scope(self.cluster.master, bucket, scope_name)

        # Recreate scopes
        for bucket_name, scope_dict in bucket_dict.items():
            bucket = BucketUtils.get_bucket_obj(self.bucket_util.buckets,
                                                bucket_name)
            for scope_name, _ in scope_dict["scopes"].items():
                BucketUtils.create_scope(self.cluster.master, bucket,
                                         scope_name)
        # Validate doc count as per bucket collections
        self.bucket_util.validate_docs_per_collections_all_buckets()
        self.validate_test_failure()
コード例 #5
0
ファイル: basic_ops.py プロジェクト: AnithaKuberan/TAF
    def test_create_delete_recreate_scope(self):
        scope_drop_fails = False
        bucket_dict = BucketUtils.get_random_scopes(self.bucket_util.buckets,
                                                    "all", 1)
        # Delete scopes
        for bucket_name, scope_dict in bucket_dict.items():
            bucket = BucketUtils.get_bucket_obj(self.bucket_util.buckets,
                                                bucket_name)
            for scope_name, _ in scope_dict["scopes"].items():
                if scope_name == CbServer.default_scope:
                    scope_drop_fails = True
                try:
                    BucketUtils.drop_scope(self.cluster.master, bucket,
                                           scope_name)
                    if scope_drop_fails:
                        raise Exception("default scope deleted")
                except Exception as drop_exception:
                    if scope_drop_fails \
                            and "delete_scope failed" in str(drop_exception):
                        pass
                    else:
                        raise drop_exception

        # Recreate scopes
        for bucket_name, scope_dict in bucket_dict.items():
            bucket = BucketUtils.get_bucket_obj(self.bucket_util.buckets,
                                                bucket_name)
            for scope_name, _ in scope_dict["scopes"].items():
                # Cannot create a _default scope
                if scope_name == CbServer.default_collection:
                    continue
                BucketUtils.create_scope(self.cluster.master, bucket,
                                         {"name": scope_name})
        # Validate doc count as per bucket collections
        self.bucket_util.validate_docs_per_collections_all_buckets()
        self.validate_test_failure()