本文整理汇总了Python中membase.api.rest_client.RestConnection.is_enterprise_edition方法的典型用法代码示例。如果您正苦于以下问题:Python RestConnection.is_enterprise_edition方法的具体用法?Python RestConnection.is_enterprise_edition怎么用?Python RestConnection.is_enterprise_edition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类membase.api.rest_client.RestConnection
的用法示例。
在下文中一共展示了RestConnection.is_enterprise_edition方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_zone_enable_after_upgrade_from_ce_to_ee
# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import is_enterprise_edition [as 别名]
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
示例2: setUp
# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import is_enterprise_edition [as 别名]
def setUp(self):
super(RackzoneBaseTest, self).setUp()
self.product = self.input.param("product", "cb")
self.vbuckets = self.input.param("vbuckets", 128)
self.version = self.input.param("version", "2.5.1-1082")
self.type = self.input.param('type', 'enterprise')
self.doc_ops = self.input.param("doc_ops", None)
if self.doc_ops is not None:
self.doc_ops = self.doc_ops.split(";")
self.defaul_map_func = "function (doc) {\n emit(doc._id, doc);\n}"
#define the data that will be used to test
self.blob_generator = self.input.param("blob_generator", True)
serverInfo = self.servers[0]
rest = RestConnection(serverInfo)
if not rest.is_enterprise_edition():
raise Exception("This couchbase server is not Enterprise Edition.\
This RZA feature requires Enterprise Edition to work")
if self.blob_generator:
#gen_load data is used for upload before each test(1000 items by default)
self.gen_load = BlobGenerator('test', 'test-', self.value_size, end=self.num_items)
#gen_update is used for doing mutation for 1/2th of uploaded data
self.gen_update = BlobGenerator('test', 'test-', self.value_size, end=(self.num_items / 2 - 1))
#upload data before each test
self._load_all_buckets(self.servers[0], self.gen_load, "create", 0)
else:
self._load_doc_data_all_buckets()
shell = RemoteMachineShellConnection(self.master)
type = shell.extract_remote_info().distribution_type
shell.disconnect()
if type.lower() == 'windows':
self.is_linux = False
else:
self.is_linux = True
示例3: __init__
# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import is_enterprise_edition [as 别名]
def __init__(self,
eventID=None,
host=None,
method='REST'):
rest = RestConnection(host)
if (rest.is_enterprise_edition()):
log.info ("Enterprise Edition, Audit is part of the test")
else:
raise Exception(" Install is not an enterprise edition, Audit requires enterprise edition.")
self.method = method
self.host = host
self.nonroot = False
shell = RemoteMachineShellConnection(self.host)
self.info = shell.extract_remote_info()
if self.info.distribution_type.lower() in LINUX_DISTRIBUTION_NAME and \
host.ssh_username != "root":
self.nonroot = True
shell.disconnect()
self.pathDescriptor = self.getAuditConfigElement("descriptors_path") + "/"
self.pathLogFile = self.getAuditLogPath()
self.defaultFields = ['id', 'name', 'description']
if (eventID is not None):
self.eventID = eventID
self.eventDef = self.returnEventsDef()
示例4: CommunityBaseTest
# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import is_enterprise_edition [as 别名]
class CommunityBaseTest(BaseTestCase):
def setUp(self):
super(CommunityBaseTest, self).setUp()
self.product = self.input.param("product", "cb")
self.vbuckets = self.input.param("vbuckets", 128)
self.version = self.input.param("version", "2.5.1-1082")
self.type = self.input.param('type', 'community')
self.doc_ops = self.input.param("doc_ops", None)
if self.doc_ops is not None:
self.doc_ops = self.doc_ops.split(";")
self.defaul_map_func = "function (doc) {\n emit(doc._id, doc);\n}"
self.couchbase_login = "%s:%s" % (self.input.membase_settings.rest_username,
self.input.membase_settings.rest_password)
self.backup_option = self.input.param("backup_option", '')
#define the data that will be used to test
self.blob_generator = self.input.param("blob_generator", True)
self.rest = RestConnection(self.master)
if self.rest.is_enterprise_edition():
raise Exception("This couchbase server is not Community Edition."
"Tests require Community Edition to test")
self.version = self.rest.get_nodes_version()[:5]
if self.blob_generator:
#gen_load data is used for upload before each test(1000 items by default)
self.gen_load = BlobGenerator('test', 'test-', self.value_size, end=self.num_items)
#gen_update is used for doing mutation for 1/2th of uploaded data
self.gen_update = BlobGenerator('test', 'test-', self.value_size, end=(self.num_items / 2 - 1))
#upload data before each test
self._load_all_buckets(self.servers[0], self.gen_load, "create", 0)
else:
self._load_doc_data_all_buckets()
self.remote = RemoteMachineShellConnection(self.master)
type = self.remote.extract_remote_info().distribution_type
self.backup_location = LINUX_BACKUP_PATH
self.backup_c_location = LINUX_BACKUP_PATH
self.bin_path = LINUX_COUCHBASE_BIN_PATH
self.file_extension = ""
if type.lower() == 'windows':
self.is_linux = False
self.backup_location = WIN_BACKUP_PATH
self.backup_c_location = WIN_BACKUP_C_PATH
self.bin_path = WIN_COUCHBASE_BIN_PATH
self.file_extension = ".exe"
else:
self.is_linux = True
def tearDown(self):
""" Some test involve kill couchbase server. If the test steps failed
right after kill erlang process, we need to start couchbase server
in teardown so that the next test will not be false failed """
super(CommunityBaseTest, self).tearDown()
示例5: int
# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import is_enterprise_edition [as 别名]
self.cluster.rebalance([ini_servers[0]], [self.servers[int(self.nodes_init) - (i -1)]], [self.servers[int(self.nodes_init) - i]])
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,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 """