def test_zone_enable_after_upgrade_from_ce_to_ee(self): params = {} params['product'] = self.product params['version'] = self.version params['vbuckets'] = [self.vbuckets] params['type'] = self.type """ install couchbasse server community edition to run the test """ InstallerJob().parallel_install(self.servers[:3], params) params["type"] = "enterprise" zone_name = "AAABBBCCCaakkkkmmm345672" serverInfo = self.servers[0] ini_servers = self.servers[:self.nodes_init] rest = RestConnection(serverInfo) self.user = serverInfo.rest_username self.password = serverInfo.rest_password if len(ini_servers) > 1: self.cluster.rebalance([ini_servers[0]], ini_servers[1:], []) rest = RestConnection(self.master) self._bucket_creation() """ verify all nodes in cluster in CE """ if rest.is_enterprise_edition(): raise Exception( "This test needs couchbase server community edition to run") self._load_all_buckets(self.servers[0], self.gen_load, "create", 0) try: self.log.info("create zone {0}".format(zone_name)) result = rest.add_zone(zone_name) if result: raise Exception( "Zone feature should not be available in CE version") except Exception, e: if "Failed" in e: pass
def test_verify_mb20463(self): src_version = NodeHelper.get_cb_version( self.src_cluster.get_master_node()) if float(src_version[:3]) != 4.5: self.log.info("Source cluster has to be at 4.5 for this test") return servs = self._input.servers[2:4] params = {} params['num_nodes'] = len(servs) params['product'] = 'cb' params['version'] = '4.1.2-6088' params['vbuckets'] = [1024] self.log.info("will install {0} on {1}".format('4.1.2-6088', [s.ip for s in servs])) InstallerJob().parallel_install(servs, params) if params['product'] in ["couchbase", "couchbase-server", "cb"]: success = True for server in servs: success &= RemoteMachineShellConnection( server).is_couchbase_installed() if not success: self.fail( "some nodes were not installed successfully on target cluster!" ) self.log.info("4.1.2 installed successfully on target cluster") conn = RestConnection(self.dest_cluster.get_master_node()) conn.add_node(user=self._input.servers[3].rest_username, password=self._input.servers[3].rest_password, remoteIp=self._input.servers[3].ip) self.sleep(30) conn.rebalance(otpNodes=[node.id for node in conn.node_statuses()]) self.sleep(30) conn.create_bucket(bucket='default', ramQuotaMB=512) tasks = self.setup_xdcr_async_load() self.sleep(30) NodeHelper.enable_firewall(self.dest_master) self.sleep(30) NodeHelper.disable_firewall(self.dest_master) for task in tasks: task.result() self._wait_for_replication_to_catchup(timeout=600) self.verify_results()
def _install(self, servers, version='1.8.1-937-rel', vbuckets=1024): params = {} params['num_nodes'] = len(servers) params['product'] = 'couchbase-server' params['version'] = version params['vbuckets'] = [vbuckets] InstallerJob().parallel_install(servers, params) success = True for server in servers: success &= RemoteMachineShellConnection( server).is_couchbase_installed() if not success: sys.exit("some nodes were not install successfully!")
def _install(self, servers): params = {} params['num_nodes'] = len(servers) params['product'] = self.product params['version'] = self.initial_version params['vbuckets'] = [self.initial_vbuckets] InstallerJob().parallel_install(servers, params) if self.product in ["couchbase", "couchbase-server", "cb"]: success = True for server in servers: success &= RemoteMachineShellConnection( server).is_couchbase_installed() if not success: self.log.info("some nodes were not install successfully!") sys.exit(1)
def _reinstall(self, version): servs = self.servers[:self.nodes_init] params = {} params['num_nodes'] = len(servs) params['product'] = 'cb' params['version'] = version params['vbuckets'] = [self.input.param('vbuckets', 1024)] self.log.info("will install {0} on {1}".format(version, [s.ip for s in servs])) InstallerJob().parallel_install(servs, params) if params['product'] in ["couchbase", "couchbase-server", "cb"]: success = True for server in servs: success &= RemoteMachineShellConnection(server).is_couchbase_installed() if not success: self.input.test_params["stop-on-failure"] = True self.log.error("Couchbase wasn't recovered. All downstream tests will be skipped") self.fail("some nodes were not install successfully!")
def install_builds(self, builds, servers=None): params = {} params['product'] = 'couchbase-server' builds_list = builds.split(";") st = 0 end = 1 if None in servers: servers_to_install = self.servers else: servers_to_install = servers for i in builds_list: params['version'] = i InstallerJob().sequential_install(servers_to_install[st:end], params) st = st + 1 end = end + 1 self.sleep(20) super(HostnameTests, self).setUp()
def test_zone_enable_after_upgrade_from_ce_to_ee(self): self.services = self.input.param("services", "kv") params = {} params['product'] = self.product params['version'] = self.version params['vbuckets'] = [self.vbuckets] params['type'] = self.type """ install couchbasse server community edition to run the test """ InstallerJob().parallel_install(self.servers[:3], params) params["type"] = "enterprise" zone_name = "AAABBBCCCaakkkkmmm345672" serverInfo = self.servers[0] ini_servers = self.servers[:self.nodes_init] rest = RestConnection(serverInfo) self.user = serverInfo.rest_username self.password = serverInfo.rest_password if len(ini_servers) > 1: self.cluster.rebalance([ini_servers[0]], ini_servers[1:], [],\ services = self.services) rest = RestConnection(self.master) self._bucket_creation() """ verify all nodes in cluster in CE """ if rest.is_enterprise_edition(): raise Exception( "This test needs couchbase server community edition to run") self._load_all_buckets(self.servers[0], self.gen_load, "create", 0) try: self.log.info("create zone {0}".format(zone_name)) result = rest.add_zone(zone_name) if result: raise Exception( "Zone feature should not be available in CE version") except Exception as e: if "Failed" in e: pass for i in range(1, int(self.nodes_init) + 1): if i == 1: """ install EE on one node to do swap rebalance """ InstallerJob().parallel_install(self.servers[3:], params) self.cluster.rebalance([ini_servers[0]], \ [self.servers[int(self.nodes_init)]],\ [self.servers[int(self.nodes_init) - i]], services = self.services) self.log.info("sleep 5 seconds") time.sleep(5) try: self.log.info( "try to create zone {0} " "when cluster is not completely EE".format(zone_name)) result = rest.add_zone(zone_name) if result: raise Exception(\ "Zone feature should not be available in CE version") except Exception as e: if "Failed" in e: pass else: InstallerJob().parallel_install([self.servers[int(self.nodes_init)\ - (i - 1)]], params) self.cluster.rebalance([ini_servers[0]],\ [self.servers[int(self.nodes_init) - (i -1)]], [self.servers[int(self.nodes_init) - i]], services = self.services) self.sleep(12, "wait 12 seconds after rebalance") if i < int(self.nodes_init): try: self.log.info( "try to create zone {0} " "when cluster is not completely EE".format( zone_name)) result = rest.add_zone(zone_name) if result: raise Exception(\ "Zone feature should not be available in CE version") except Exception as e: if "Failed" in e: pass serverInfo = self.servers[1] rest = RestConnection(serverInfo) self.user = serverInfo.rest_username self.password = serverInfo.rest_password if not rest.is_enterprise_edition(): raise Exception("Test failed to upgrade cluster from CE to EE") self.log.info("try to create zone {0} " "when cluster {1} is completely EE".format( zone_name, serverInfo.ip)) result = rest.add_zone(zone_name) self.log.info("sleep 5 seconds") time.sleep(5) if result: self.log.info("Zone feature is available in this cluster") else: raise Exception("Could not create zone with name: %s in cluster. " "It's a bug" % zone_name) if rest.is_zone_exist(zone_name.strip()): self.log.info("verified! zone '{0}' is existed".format( zone_name.strip())) else: raise Exception("There is not zone with name: %s in cluster. " "It's a bug" % zone_name) """ re-install enterprise edition for next test if there is any """ InstallerJob().parallel_install([self.servers[0]], params) """ reset master node to new node to teardown cluster """ self.log.info("Start to clean up cluster") self.master = self.servers[1] self.servers = self.servers[1:]
self._load_all_buckets(self.servers[0], self.gen_load, "create", 0) try: self.log.info("create zone {0}".format(zone_name)) result = rest.add_zone(zone_name) if result: raise Exception( "Zone feature should not be available in CE version") except Exception, e: if "Failed" in e: pass for i in range(1, int(self.nodes_init) + 1): if i == 1: """ install EE on one node to do swap rebalance """ InstallerJob().parallel_install(self.servers[3:], params) self.cluster.rebalance([ini_servers[0]], \ [self.servers[int(self.nodes_init)]],\ [self.servers[int(self.nodes_init) - i]], services = self.services) self.log.info("sleep 5 seconds") time.sleep(5) try: self.log.info( "try to create zone {0} " "when cluster is not completely EE".format(zone_name)) result = rest.add_zone(zone_name) if result: raise Exception(\ "Zone feature should not be available in CE version") except Exception, e: