Пример #1
0
 def setUp(self):
     super(EventingLogging, self).setUp()
     if self.create_functions_buckets:
         self.bucket_size = 100
         log.info(self.bucket_size)
         bucket_params = self._create_bucket_params(
             server=self.server,
             size=self.bucket_size,
             replicas=self.num_replicas)
         self.cluster.create_standard_bucket(name=self.src_bucket_name,
                                             port=STANDARD_BUCKET_PORT + 1,
                                             bucket_params=bucket_params)
         self.src_bucket = RestConnection(self.master).get_buckets()
         self.cluster.create_standard_bucket(name=self.dst_bucket_name,
                                             port=STANDARD_BUCKET_PORT + 1,
                                             bucket_params=bucket_params)
         self.cluster.create_standard_bucket(name=self.metadata_bucket_name,
                                             port=STANDARD_BUCKET_PORT + 1,
                                             bucket_params=bucket_params)
         self.buckets = RestConnection(self.master).get_buckets()
     self.gens_load = self.generate_docs(self.docs_per_day)
     self.expiry = 3
     auditing = audit(host=self.master)
     log.info("Enabling Audit")
     auditing.setAuditEnable('true')
     self.sleep(30)
Пример #2
0
 def setUp(self):
     try:
         super(ViewAuditLog, self).setUp()
         self.rest = RestConnection(self.master)
         self.rest.set_service_memoryQuota(service='memoryQuota', memoryQuota=1500)
         self.bucket_ddoc_map = {}
         self.ddoc_ops = self.input.param("ddoc_ops", None)
         self.boot_op = self.input.param("boot_op", None)
         self.test_with_view = self.input.param("test_with_view", False)
         self.num_views_per_ddoc = self.input.param("num_views_per_ddoc", 1)
         self.num_ddocs = self.input.param("num_ddocs", 1)
         self.gen = None
         self.is_crashed = Event()
         self.default_design_doc_name = "Doc1"
         self.default_map_func = 'function (doc) { emit(doc.age, doc.first_name);}'
         self.updated_map_func = 'function (doc) { emit(null, doc);}'
         self.default_view = View("View", self.default_map_func, None, False)
         self.fragmentation_value = self.input.param("fragmentation_value", 80)
         auditing = audit(host=self.master)
         log.info("Enabling Audit")
         auditing.setAuditEnable('true')
         self.sleep(30)
     except Exception as ex:
         self.input.test_params["stop-on-failure"] = True
         self.log.error("SETUP WAS FAILED. ALL TESTS WILL BE SKIPPED")
         self.fail(ex)
Пример #3
0
 def setUp(self):
     super(EventingLogging, self).setUp()
     if self.create_functions_buckets:
         self.bucket_size = 100
         log.info(self.bucket_size)
         bucket_params = self._create_bucket_params(server=self.server, size=self.bucket_size,
                                                    replicas=self.num_replicas)
         self.cluster.create_standard_bucket(name=self.src_bucket_name, port=STANDARD_BUCKET_PORT + 1,
                                             bucket_params=bucket_params)
         self.src_bucket = RestConnection(self.master).get_buckets()
         self.cluster.create_standard_bucket(name=self.dst_bucket_name, port=STANDARD_BUCKET_PORT + 1,
                                             bucket_params=bucket_params)
         self.cluster.create_standard_bucket(name=self.metadata_bucket_name, port=STANDARD_BUCKET_PORT + 1,
                                             bucket_params=bucket_params)
         self.buckets = RestConnection(self.master).get_buckets()
     self.gens_load = self.generate_docs(self.docs_per_day)
     self.expiry = 3
     auditing = audit(host=self.master)
     log.info("Enabling Audit")
     auditing.setAuditEnable('true')
     self.sleep(30)
Пример #4
0
 def check_config(self, event_id, host, expected_results):
     auditing = audit(eventID=event_id, host=host)
     _, value_verification = auditing.validateEvents(expected_results)
     self.assertTrue(value_verification, "Values for one of the fields is not matching")
Пример #5
0
 def check_config(self, event_id, host, expected_results):
     auditing = audit(eventID=event_id, host=host)
     _, value_verification = auditing.validateEvents(expected_results)
     self.assertTrue(value_verification,
                     "Values for one of the fields is not matching")
Пример #6
0
 def setUp(self):
     super(EventingLogging, self).setUp()
     self.rest.set_service_memoryQuota(service='memoryQuota',
                                       memoryQuota=1500)
     if self.create_functions_buckets:
         self.bucket_size = 100
         log.info(self.bucket_size)
         bucket_params = self._create_bucket_params(
             server=self.server,
             size=self.bucket_size,
             replicas=self.num_replicas)
         self.cluster.create_standard_bucket(name=self.src_bucket_name,
                                             port=STANDARD_BUCKET_PORT + 1,
                                             bucket_params=bucket_params)
         self.src_bucket = RestConnection(self.master).get_buckets()
         self.cluster.create_standard_bucket(name=self.dst_bucket_name,
                                             port=STANDARD_BUCKET_PORT + 1,
                                             bucket_params=bucket_params)
         self.cluster.create_standard_bucket(name=self.metadata_bucket_name,
                                             port=STANDARD_BUCKET_PORT + 1,
                                             bucket_params=bucket_params)
         self.buckets = RestConnection(self.master).get_buckets()
     self.gens_load = self.generate_docs(self.docs_per_day)
     self.expiry = 3
     auditing = audit(host=self.master)
     log.info("Enabling Audit")
     auditing.setAuditEnable('true')
     self.sleep(30)
     if self.non_default_collection:
         self.create_scope_collection(bucket=self.src_bucket_name,
                                      scope=self.src_bucket_name,
                                      collection=self.src_bucket_name)
         self.create_scope_collection(bucket=self.metadata_bucket_name,
                                      scope=self.metadata_bucket_name,
                                      collection=self.metadata_bucket_name)
         self.create_scope_collection(bucket=self.dst_bucket_name,
                                      scope=self.dst_bucket_name,
                                      collection=self.dst_bucket_name)
         expected_results_create_collection = {
             "real_userid:source":
             "builtin",
             "real_userid:user":
             "******",
             "id":
             8261,
             "name":
             "create collection",
             "description":
             "Collection was created",
             "bucket_name":
             self.dst_bucket_name,
             "collection_name":
             self.dst_bucket_name,
             "new_manifest_uid":
             RestConnection(self.master).get_bucket_manifest(
                 self.dst_bucket_name)['uid'],
             "scope_name":
             self.dst_bucket_name
         }
         self.check_config(8261, self.master,
                           expected_results_create_collection)