def test_primary_cbas_shutdown(self):
     '''
     Description: This test will add the second cbas node then start rebalance and cancel rebalance
     before rebalance completes.
     
     Steps:
     1. Add first cbas node.
     2. Start rebalance, wait for rebalance complete.
     3. Create bucket, datasets, connect bucket. Data ingestion should start.
     4. Add another cbas node, rebalance.
     5. Stop Couchbase service for Node1 added in step 1. Failover the node and rebalance.
     6. Second cbas node added in step 4 should be able to serve queries.
     
     Author: Ritesh Agarwal
     '''
     self.load_sample_buckets(bucketName=self.cb_bucket_name, total_items=self.travel_sample_docs_count)
     otpNode = self.add_node(self.cbas_servers[0], services=["cbas"])
     self.setup_cbas_bucket_dataset_connect(self.cb_bucket_name, self.travel_sample_docs_count)
     self.add_node(self.cbas_servers[1], services=["cbas"])
     from fts.fts_base import NodeHelper
     NodeHelper.stop_couchbase(self.cbas_servers[0])
     self.rest.fail_over(otpNode=otpNode.id)
     self.rebalance()
     
     query = "select count(*) from {0};".format(self.cbas_dataset_name)
     self._run_concurrent_queries(query, "immediate", 100, rest=RestConnection(self.cbas_servers[1]))
     NodeHelper.start_couchbase(self.cbas_servers[0])
     NodeHelper.wait_service_started(self.cbas_servers[0])
 def test_primary_cbas_shutdown(self):
     '''
     Description: This test will add the second cbas node then start rebalance and cancel rebalance
     before rebalance completes.
     
     Steps:
     1. Add first cbas node.
     2. Start rebalance, wait for rebalance complete.
     3. Create bucket, datasets, connect bucket. Data ingestion should start.
     4. Add another cbas node, rebalance.
     5. Stop Couchbase service for Node1 added in step 1. Failover the node and rebalance.
     6. Second cbas node added in step 4 should be able to serve queries.
     
     Author: Ritesh Agarwal
     '''
     self.load_sample_buckets(bucketName=self.cb_bucket_name, total_items=self.travel_sample_docs_count)
     otpNode = self.add_node(self.cbas_servers[0], services=["cbas"])
     self.setup_cbas_bucket_dataset_connect(self.cb_bucket_name, self.travel_sample_docs_count)
     self.add_node(self.cbas_servers[1], services=["cbas"])
     from fts.fts_base import NodeHelper
     NodeHelper.stop_couchbase(self.cbas_servers[0])
     self.rest.fail_over(otpNode=otpNode.id)
     self.rebalance()
     
     query = "select count(*) from {0};".format(self.cbas_dataset_name)
     self._run_concurrent_queries(query, "immediate", 100, rest=RestConnection(self.cbas_servers[1]))
     NodeHelper.start_couchbase(self.cbas_servers[0])
     NodeHelper.wait_service_started(self.cbas_servers[0])
 def test_reboot_cbas(self):
     '''
     Description: This test will add the second cbas node then start rebalance and cancel rebalance
     before rebalance completes.
     
     Steps:
     1. Add first cbas node.
     2. Start rebalance, wait for rebalance complete.
     3. Create bucket, datasets, connect bucket. Data ingestion should start.
     4. Reboot CBAS node addd in Step 1.
     5. After reboot cbas node should be able to serve queries, validate items count.
     
     Author: Ritesh Agarwal
     '''
     self.load_sample_buckets(bucketName=self.cb_bucket_name, total_items=self.travel_sample_docs_count)
     self.add_node(self.cbas_node, services=["kv","cbas"])
     self.setup_cbas_bucket_dataset_connect(self.cb_bucket_name, self.travel_sample_docs_count)
     
     from fts.fts_base import NodeHelper
     NodeHelper.reboot_server(self.cbas_node, self)
     
     self.assertTrue(self.validate_cbas_dataset_items_count(self.cbas_dataset_name, self.travel_sample_docs_count),"Data loss in CBAS.")
 def test_reboot_cbas(self):
     '''
     Description: This test will add the second cbas node then start rebalance and cancel rebalance
     before rebalance completes.
     
     Steps:
     1. Add first cbas node.
     2. Start rebalance, wait for rebalance complete.
     3. Create bucket, datasets, connect bucket. Data ingestion should start.
     4. Reboot CBAS node addd in Step 1.
     5. After reboot cbas node should be able to serve queries, validate items count.
     
     Author: Ritesh Agarwal
     '''
     self.load_sample_buckets(bucketName=self.cb_bucket_name, total_items=self.travel_sample_docs_count)
     self.add_node(self.cbas_node, services=["kv","cbas"])
     self.setup_cbas_bucket_dataset_connect(self.cb_bucket_name, self.travel_sample_docs_count)
     
     from fts.fts_base import NodeHelper
     NodeHelper.reboot_server(self.cbas_node, self)
     
     self.assertTrue(self.validate_cbas_dataset_items_count(self.cbas_dataset_name, self.travel_sample_docs_count),"Data loss in CBAS.")
 def test_restart_cb(self):
     '''
     Description: This test will restart CB and verify that CBAS is also up and running with CB.
     
     Steps:
     1. Add first cbas node.
     2. Start rebalance, wait for rebalance complete.
     3. Stop Couchbase service, Start Couchbase Service. Wait for service to get started.
     4. Verify that CBAS service is also up Create bucket, datasets, connect bucket. Data ingestion should start.
     
     Author: Ritesh Agarwal
     '''
     self.load_sample_buckets(bucketName=self.cb_bucket_name, total_items=self.travel_sample_docs_count)
     self.add_node(self.cbas_servers[0], services=["cbas"])
     
     from fts.fts_base import NodeHelper
     NodeHelper.stop_couchbase(self.cbas_servers[0])
     NodeHelper.start_couchbase(self.cbas_servers[0])
     NodeHelper.wait_service_started(self.cbas_servers[0])
     
     self.setup_cbas_bucket_dataset_connect(self.cb_bucket_name, self.travel_sample_docs_count)
     self.assertTrue(self.validate_cbas_dataset_items_count(self.cbas_dataset_name, self.travel_sample_docs_count),"Data loss in CBAS.")
 def test_restart_cb(self):
     '''
     Description: This test will restart CB and verify that CBAS is also up and running with CB.
     
     Steps:
     1. Add first cbas node.
     2. Start rebalance, wait for rebalance complete.
     3. Stop Couchbase service, Start Couchbase Service. Wait for service to get started.
     4. Verify that CBAS service is also up Create bucket, datasets, connect bucket. Data ingestion should start.
     
     Author: Ritesh Agarwal
     '''
     self.load_sample_buckets(bucketName=self.cb_bucket_name, total_items=self.travel_sample_docs_count)
     self.add_node(self.cbas_servers[0], services=["cbas"])
     
     from fts.fts_base import NodeHelper
     NodeHelper.stop_couchbase(self.cbas_servers[0])
     NodeHelper.start_couchbase(self.cbas_servers[0])
     NodeHelper.wait_service_started(self.cbas_servers[0])
     
     self.setup_cbas_bucket_dataset_connect(self.cb_bucket_name, self.travel_sample_docs_count)
     self.assertTrue(self.validate_cbas_dataset_items_count(self.cbas_dataset_name, self.travel_sample_docs_count),"Data loss in CBAS.")