def test_specified_instance_webcli(self, config, instance_data, expected_data): resp = send_web_command(config, "redis-pl9nmstkrd5h", config["region"], "auth " + "1qaz2WSX") token = resp.result["token"] object = WebCommand(config, "redis-pl9nmstkrd5h", config["region"], token) object.runAllCommand()
def test_create_Backup(self, config, instance_data, expected_data): instance = instance_data["create_standard_specified"][0] expected_object = baseCheckPoint( expected_data[instance["cacheInstanceClass"]], instance["instance_password"]) client, _, instance_id = create_validate_instance( config, instance, expected_object) resp = create_backup(config, instance_id, client) assertRespNotNone(resp) assert check_backup(config, instance_id, str(resp.result["baseId"]), client) == True baseId = str(resp.result["baseId"]) expected_object.backup_list = [baseId] resp = send_web_command(config, instance_id, config["region"], "auth " + instance["instance_password"]) token = resp.result["token"] object = WebCommand(config, instance_id, config["region"], token) object.runAllCommand() assert check_admin_proxy_redis_configmap(instance_id, config, expected_object, 1) if instance_id is not None: delete_instance(config, instance_id, client)
def test_data_verify(self, init_instance, config): client, resp, instance_id = init_instance resp = send_web_command(config, instance_id, config["region"], "auth " + config["change_data"]["instancePassword"]) token = resp.result["token"] object = WebCommand(config, instance_id, config["region"], token) object.runAllCommand() if instance_id is not None: delete_instance(config, instance_id, client)
def test_modifyInstanceConfig_basecheck(self, config, instance_data, expected_data): instance = instance_data["create_standard_specified"][0] expected_object = baseCheckPoint( expected_data[instance["cacheInstanceClass"]], instance["instance_password"]) expected_object.backup_list = [] client, _, instance_id = create_validate_instance( config, instance, expected_object) resp = set_config(config, instance_id, config["instance_config"], client) assertRespNotNone(resp) # assert by db query_instance_recurrent(200, 5, instance_id, config, client) resp = get_config(config, instance_id, client) assertRespNotNone(resp) config_list = resp.result["instanceConfig"] policy = {"key": "configName", "value": "configValue"} listCompareJason(config_list, config["instance_config"], policy) config_param = { "hash-max-ziplist-entries": "511", "hash-max-ziplist-value": "511", "list-compress-depth": "511", "list-max-ziplist-size": "511", "maxmemory-policy": "allkeys-lru", "notify-keyspace-events": "AKE", "set-max-intset-entries": "511", "slowlog-log-slower-than": "511", "zset-max-ziplist-entries": "511", "zset-max-ziplist-value": "511" } config_param_s = dict(sorted(config_param.items(), key=lambda x: x[0])) expected_object.config_param = config_param_s resp = send_web_command(config, instance_id, config["region"], "auth " + instance["instance_password"]) token = resp.result["token"] object = WebCommand(config, instance_id, config["region"], token) object.runAllCommand() #assert check_admin_proxy_redis_configmap(instance_id, config, expected_object, 1) if instance_id is not None: delete_instance(config, instance_id, client)
def test_resetCacheInstancePassword_webcli(self, config, instance_data, expected_data): instance = instance_data["create_standard_specified"][0] expected_object = baseCheckPoint(expected_data[instance["cacheInstanceClass"]], instance["instance_password"]) client, _, instance_id = create_validate_instance(config, instance, expected_object) resp = reset_password(config, instance_id, config["change_data"]["instancePassword"], client) expected_object = baseCheckPoint(expected_data[instance["cacheInstanceClass"]], config["change_data"]["instancePassword"]) resp = send_web_command(config, instance_id, config["region"], "auth " + config["change_data"]["instancePassword"]) token = resp.result["token"] object = WebCommand(config, instance_id, config["region"], token) object.runAllCommand() assert check_admin_proxy_redis_configmap(instance_id, config, expected_object, 1) if instance_id is not None: delete_instance(config, instance_id, client)
def test_cli_createInstanceNobill(self, config, instance_data, expected_data): instance = instance_data["create_standard_specified"][0] client, resp, instance_id = create_instance_nobill(config, instance) '''instance = None if resp.error is None and instance_id is not None: instance = query_instance_recurrent(200, 5, instance_id, config, client, token=True) config["request_id"] = resp.request_id else: config["request_id"] = ""''' assert instance_id is not None time.sleep(120) resp = send_web_command(config, instance_id, config["region"], "auth " + instance["instance_password"]) token = resp.result["token"] object = WebCommand(config, instance_id, config["region"], token) object.runAllCommand() if instance_id is not None: delete_instance(config, instance_id, client, token=True)
def test_describeSlowlog(self, init_instance, config, instance_data): client, resp, instance_id = init_instance resp = query_slow_log(config, instance_id) assertRespNotNone(resp) time.sleep() print("=====set up slow log via instance config========") resp = set_config(config, instance_id, config["instance_config_slowlog"], client) assertRespNotNone(resp) print("=======exec redis cli===========") instance = instance_data["create_standard_specified"][0] resp = send_web_command(config, instance_id, config["region"], "auth " + instance["instance_password"]) token = resp.result["token"] object = WebCommand(config, instance_id, config["region"], token) time.sleep(120) resp = query_slow_log(config, instance_id) assertRespNotNone(resp)