code
stringlengths
3
6.57k
pytest.raises(coreapi.exceptions.ErrorMessage)
hp.host_create(utils.random_string(257)
allure.step('Check LONG_NAME error')
err.LONG_NAME.equal(e, 'Host name is too long. Max length is 256')
test_shouldnt_create_host_with_wrong_name(self, sdk_client_fs: ADCMClient)
sdk_client_fs.upload_from_fs(get_data_dir(__file__, 'hostprovider_simple')
bundle.provider_create(utils.random_string()
pytest.raises(coreapi.exceptions.ErrorMessage)
hp.host_create(utils.random_string()
utils.random_special_chars()
allure.step('Check WRONG_NAME error')
dots (.)
test_get_host_list(self, sdk_client_fs: ADCMClient)
set()
set()
sdk_client_fs.upload_from_fs(get_data_dir(__file__, 'hostprovider_simple')
bundle.provider_create(utils.random_string()
utils.random_string_list()
hp.host_create(fqdn)
expected_list.add(fqdn)
sdk_client_fs.host_list()
actual_list.add(host.fqdn)
allure.step('Check created hosts with the data from the API')
test_get_host_info(self, client)
steps.create_host_w_default_provider(client, utils.random_string()
steps.read_host(client, host['id'])
allure.step('Check created host with the data from the API')
test_delete_host(self, sdk_client_fs: ADCMClient)
sdk_client_fs.upload_from_fs(get_data_dir(__file__, 'hostprovider_simple')
bundle.provider_create(utils.random_string()
hp.host_create("deletion_host")
allure.step('delete host')
host.delete()
allure.step('Check that host is deleted')
test_should_return_correct_error_when_read_deleted(self, sdk_client_fs: ADCMClient)
sdk_client_fs.upload_from_fs(get_data_dir(__file__, 'hostprovider_simple')
bundle.provider_create(utils.random_string()
hp.host_create(utils.random_string()
allure.step('delete host')
host.delete()
pytest.raises(coreapi.exceptions.ErrorMessage)
host.reread()
allure.step('Check HOST_NOT_FOUND')
err.HOST_NOT_FOUND.equal(e)
sdk_client_fs.upload_from_fs(get_data_dir(__file__, 'hostprovider_simple')
bundle.provider_create(utils.random_string()
hp.host_create(utils.random_string()
allure.step('delete host')
host.delete()
allure.step('delete host second time')
pytest.raises(coreapi.exceptions.ErrorMessage)
host.delete()
allure.step('Check HOST_NOT_FOUND')
err.HOST_NOT_FOUND.equal(e, 'host doesn\'t exist')
test_create_hostcomponent(self, sdk_client_fs: ADCMClient)
sdk_client_fs.upload_from_fs(get_data_dir(__file__, 'hostprovider_simple')
bundle.cluster_create(utils.random_string()
bundle_hp.provider_create(utils.random_string()
hp.host_create(utils.random_string()
cluster.host_add(host)
cluster.service_add(name="ZOOKEEPER")
service.component_list()
service.component(name='ZOOKEEPER_CLIENT')
allure.step('Check component id and name')
test_get_hostcomponent_list(self, client)
steps.create_cluster(client)
steps.read_service(client, get_random_service(client)
utils.random_string_list()
steps.create_host_w_default_provider(client, fqdn)
steps.add_host_to_cluster(client, host, cluster)
random.choice(components)
client.cluster.hostcomponent.list(cluster_id=cluster['id'])
allure.step('Check created data with data from API')
test_config_history_url_must_point_to_the_host_config(self, client)
steps.create_host_w_default_provider(client, utils.random_string()
allure.step('Create host history')
random.randint(0, 10)
utils.random_string()
client.host.config.history.list(host_id=host['id'])
allure.step('Check host history')
assert ('host/{0}/config/'.format(host['id'])
steps.delete_all_data(client)
test_get_default_host_config(self, client)
steps.create_host_w_default_provider(client, utils.random_string()
allure.step('Get default configuration from host')
client.host.config.current.list(host_id=host['id'])
json.loads(json.dumps(config)
json.load(open(SCHEMAS + '/config_item_schema.json')
allure.step('Check config')
validate(config_json, schema)
steps.delete_all_data(client)
test_get_config_from_nonexistant_host(self, sdk_client_fs: ADCMClient)
bundle_hp.provider_create(utils.random_string()
allure.step('Get host config from a non existant host')
pytest.raises(coreapi.exceptions.ErrorMessage)
hp.host(host_id=random.randint(100, 500)
allure.step('Check error host doesn\'t exist')
err.HOST_NOT_FOUND.equal(e, 'host doesn\'t exist')
test_shouldnt_create_host_config_when_config_not_json_string(self, client)
steps.create_host_w_default_provider(client, utils.random_string()