def test_mobile_url_centos6(): server_config = CouchbaseServerConfig(version="4.1.1") cb_server = CouchbaseServer("http://192.168.33.20:8091") cbs_platform = "centos6" base_url, package_name = server_config.get_baseurl_package( cb_server, cbs_platform) assert base_url == "http://cbmobile-packages.s3.amazonaws.com" assert package_name == "couchbase-server-enterprise-4.1.1-5914-centos6.x86_64.rpm"
def test_enterprise_centos6(): server_config = CouchbaseServerConfig(version="4.1.1-5914") cb_server = CouchbaseServer("http://192.168.33.20:8091") cbs_platform = "centos6" base_url, package_name = server_config.get_baseurl_package( cb_server, cbs_platform) assert base_url == "http://latestbuilds.service.couchbase.com/builds/latestbuilds/couchbase-server/sherlock/5914" assert package_name == "couchbase-server-enterprise-4.1.1-5914-centos6.x86_64.rpm"
def provision_or_reset_cluster(provision_or_reset, sg_deploy_type, couchbase_server_version, sync_gateway_version, sync_gateway_commit, sync_gateway_config_file, cluster_config): server_config = CouchbaseServerConfig(version=couchbase_server_version) version_number, build_number = version_and_build(sync_gateway_version) sync_gateway_conf = SyncGatewayConfig(version_number=version_number, build_number=build_number, commit=sync_gateway_commit, build_flags="", config_path=sync_gateway_config_file, skip_bucketcreation=False) # Don't specify version number on a source build if sg_deploy_type == "Source": sync_gateway_conf.version_number = None else: # Likewise, don't specify commmit on a package build sync_gateway_conf.commit = None if provision_or_reset == "Provision": print("provisioning cluster") provision_cluster(cluster_config=cluster_config, couchbase_server_config=server_config, sync_gateway_config=sync_gateway_conf) elif provision_or_reset == "Reset": print("resetting cluster") cluster = Cluster(config=cluster_config) cluster.reset(sync_gateway_config_file)
def provision_cluster(self, cluster_config, server_version, sync_gateway_version, sync_gateway_config, race_enabled=False, sg_ce=False, cbs_platform="centos7", sg_platform="centos", sa_platform="centos"): if server_version is None or sync_gateway_version is None or sync_gateway_version is None: raise ProvisioningError("Please make sure you have server_version, sync_gateway_version, and sync_gateway_config are set") # Dirty hack -- these have to be put here in order to avoid circular imports from libraries.provision.install_couchbase_server import CouchbaseServerConfig from libraries.provision.provision_cluster import provision_cluster from libraries.provision.install_sync_gateway import SyncGatewayConfig cbs_config = CouchbaseServerConfig(server_version) if version_is_binary(sync_gateway_version): if race_enabled: raise ProvisioningError("Race should only be enabled for source builds") version, build = version_and_build(sync_gateway_version) sg_config = SyncGatewayConfig( commit=None, version_number=version, build_number=build, config_path=sync_gateway_config, build_flags="", skip_bucketcreation=False ) else: build_flags = "" if race_enabled: build_flags = "-race" sg_config = SyncGatewayConfig( commit=sync_gateway_version, version_number=None, build_number=None, config_path=sync_gateway_config, build_flags=build_flags, skip_bucketcreation=False ) provision_cluster( cluster_config=cluster_config, couchbase_server_config=cbs_config, sync_gateway_config=sg_config, sg_ce=sg_ce, cbs_platform=cbs_platform, sg_platform=sg_platform, sa_platform=sa_platform ) # verify running services are the expected versions self.verify_cluster_versions(cluster_config, server_version, sync_gateway_version)
def test_version_only(): server_config = CouchbaseServerConfig(version="4.1.1") assert server_config.version == "4.1.1" assert server_config.build is None
def test_version_build(): server_config = CouchbaseServerConfig(version="4.1.1-5914") assert server_config.version == "4.1.1" assert server_config.build == "5914"