Skip to content

Commit

Permalink
Changing expected API endpoints.
Browse files Browse the repository at this point in the history
Changes and their source:
/api/hosts/:host_id/subscriptions/events is marked as deprecated in 6.7;
reports dropped in https://bugzilla.redhat.com/show_bug.cgi?id=1791658;
scap_content_profiles in https://github.com/theforeman/foreman_openscap/pull/431/files;
override_values is in 6.7 already;
template=>templates is https://projects.theforeman.org/issues/28750/ (only category name changed, path is same);
status dropped in https://bugzilla.redhat.com/show_bug.cgi?id=1791656;
available_virtual_machines added in https://projects.theforeman.org/issues/28548;
recurring logics bulk_destroy added in theforeman/foreman-tasks#501;
bulk_cancel added in theforeman/foreman-tasks#516;
bulk_stop added in theforeman/foreman-tasks#543;
ansible_inventories endpoints added in https://github.com/theforeman/foreman_ansible/pull/265/files;
added /ansible/ prefix to ansible_inventory in https://bugzilla.redhat.com/show_bug.cgi?id=1677907;
docker_tags/:id/repositories added in Katello/katello#8658;
/api/hosts/:host_id/traces/resolve added in Katello/katello#8945;
autoattach_subscriptions marked as deprecated in 6.7;
/katello/api/subscriptions was there in 6.7;
template_combinations deprecated and changed to different paths;
upstream_subscriptions added in Katello/katello#8774;
https://bugzilla.redhat.com/show_bug.cgi?id=1887932 workarounded;
mail_notifications added in theforeman/foreman#7549
  • Loading branch information
lhellebr committed Oct 19, 2020
1 parent 97bc687 commit 1fdc69f
Showing 1 changed file with 44 additions and 16 deletions.
60 changes: 44 additions & 16 deletions tests/foreman/endtoend/test_api_endtoend.py
Expand Up @@ -46,6 +46,7 @@
from robottelo.decorators import upgrade
from robottelo.helpers import get_nailgun_config
from robottelo.test import TestCase
from robottelo.utils.issue_handlers import is_open

API_PATHS = {
# flake8:noqa (line-too-long)
Expand All @@ -68,8 +69,9 @@
'/katello/api/ansible_collections/:id',
),
'ansible_inventories': (
'/api/ansible_inventories/hosts',
'/api/ansible_inventories/schedule',
'/ansible/api/ansible_inventories/hosts',
'/ansible/api/ansible_inventories/hostgroups',
'/ansible/api/ansible_inventories/schedule',
),
'ansible_override_values': (
'/ansible/api/ansible_override_values',
Expand Down Expand Up @@ -193,6 +195,10 @@
'/api/compute_resources/:id/available_storage_pods',
'/api/compute_resources/:id/available_zones',
'/api/compute_resources/:id/refresh_cache',
'/api/compute_resources/:id/available_virtual_machines',
'/api/compute_resources/:id/available_virtual_machines/:vm_id',
'/api/compute_resources/:id/available_virtual_machines/:vm_id/power',
'/api/compute_resources/:id/available_virtual_machines/:vm_id',
'/api/compute_resources/:id/storage_domains/:storage_domain_id',
'/api/compute_resources/:id/storage_pods/:storage_pod_id',
),
Expand Down Expand Up @@ -315,7 +321,11 @@
'/katello/api/docker_manifest_lists/:id',
'/katello/api/docker_manifest_lists/compare',
),
'docker_tags': ('/katello/api/docker_tags/compare', '/katello/api/docker_tags/:id'),
'docker_tags': (
'/katello/api/docker_tags/compare',
'/katello/api/docker_tags/:id',
'/katello/api/docker_tags/:id/repositories',
),
'domains': (
'/api/domains',
'/api/domains',
Expand Down Expand Up @@ -366,6 +376,8 @@
'/foreman_tasks/api/tasks/:id/details',
'/foreman_tasks/api/tasks/:id/sub_tasks',
'/foreman_tasks/api/tasks/bulk_resume',
'/foreman_tasks/api/tasks/bulk_cancel',
'/foreman_tasks/api/tasks/bulk_stop',
'/foreman_tasks/api/tasks/bulk_search',
'/foreman_tasks/api/tasks/callback',
'/foreman_tasks/api/tasks/summary',
Expand Down Expand Up @@ -405,11 +417,10 @@
'/api/hosts/:host_id/subscriptions/auto_attach',
'/api/hosts/:host_id/subscriptions/available_release_versions',
'/api/hosts/:host_id/subscriptions/content_override',
'/api/hosts/:host_id/subscriptions/events',
'/api/hosts/:host_id/subscriptions/product_content',
'/api/hosts/subscriptions',
),
'host_tracer': ('/api/hosts/:host_id/traces',),
'host_tracer': ('/api/hosts/:host_id/traces', '/api/hosts/:host_id/traces/resolve',),
'hostgroup_classes': (
'/api/hostgroups/:hostgroup_id/puppetclass_ids',
'/api/hostgroups/:hostgroup_id/puppetclass_ids',
Expand All @@ -435,7 +446,7 @@
'/api/hosts/:id',
'/api/hosts/:id',
'/api/hosts/:id/enc',
'/api/hosts/:id/status',
'/api/hosts/:id/status/:type',
'/api/hosts/:id/status/:type',
'/api/hosts/:id/vm_compute_attributes',
'/api/hosts/:id/disassociate',
Expand Down Expand Up @@ -469,6 +480,8 @@
'/api/hosts/bulk/remove_host_collections',
'/api/hosts/bulk/remove_subscriptions',
'/api/hosts/bulk/update_content',
'/api/hosts/bulk/resolve_traces',
'/api/hosts/bulk/traces',
),
'host_errata': (
'/api/hosts/:host_id/errata',
Expand Down Expand Up @@ -537,7 +550,14 @@
'/api/locations/:id',
'/api/locations/:id',
),
'mail_notifications': ('/api/mail_notifications', '/api/mail_notifications/:id'),
'mail_notifications': (
'/api/mail_notifications',
'/api/mail_notifications/:id',
'/api/users/:user_id/mail_notifications',
'/api/users/:user_id/mail_notifications/:mail_notification_id',
'/api/users/:user_id/mail_notifications/:mail_notification_id',
'/api/users/:user_id/mail_notifications',
),
'media': ('/api/media', '/api/media', '/api/media/:id', '/api/media/:id', '/api/media/:id',),
'models': (
'/api/models',
Expand All @@ -561,7 +581,6 @@
'/katello/api/organizations/:id',
'/katello/api/organizations/:id',
'/katello/api/organizations/:id',
'/katello/api/organizations/:id/autoattach_subscriptions',
'/katello/api/organizations/:id/redhat_provider',
'/katello/api/organizations/:id/releases',
'/katello/api/organizations/:id/repo_discover',
Expand Down Expand Up @@ -671,19 +690,21 @@
'/foreman_tasks/api/recurring_logics/:id',
'/foreman_tasks/api/recurring_logics/:id',
'/foreman_tasks/api/recurring_logics/:id/cancel',
'/foreman_tasks/api/recurring_logics/bulk_destroy',
),
'remote_execution_features': (
'/api/remote_execution_features',
'/api/remote_execution_features/:id',
'/api/remote_execution_features/:id',
),
'reports': (
'/api/hosts/:host_id/reports/last',
'/api/reports',
'/api/reports',
'/api/reports/:id',
'/api/reports/:id',
'override_values': (
'/api/smart_class_parameters/:smart_class_parameter_id/override_values',
'/api/smart_class_parameters/:smart_class_parameter_id/override_values/:id',
'/api/smart_class_parameters/:smart_class_parameter_id/override_values',
'/api/smart_class_parameters/:smart_class_parameter_id/override_values/:id',
'/api/smart_class_parameters/:smart_class_parameter_id/override_values/:id',
),
'scap_content_profiles': ('/api/compliance/scap_content_profiles',),
'report_templates': (
'/api/report_templates',
'/api/report_templates/:id',
Expand Down Expand Up @@ -807,10 +828,12 @@
'/api/users/:user_id/table_preferences',
'/api/users/:user_id/table_preferences/:name',
),
'template': ('/api/templates/export', '/api/templates/import'),
'templates': ('/api/templates/export', '/api/templates/import'),
'template_combinations': (
'/api/provisioning_templates/:provisioning_template_id/template_combinations/:id',
'/api/provisioning_templates/:provisioning_template_id/template_combinations',
'/api/provisioning_templates/:provisioning_template_id/template_combinations',
'/api/template_combinations/:id',
'/api/provisioning_templates/:provisioning_template_id/template_combinations/:id',
'/api/template_combinations/:id',
),
'template_inputs': (
Expand All @@ -828,6 +851,7 @@
'/katello/api/organizations/:organization_id/upstream_subscriptions',
'/katello/api/organizations/:organization_id/upstream_subscriptions',
'/katello/api/organizations/:organization_id/upstream_subscriptions',
'/katello/api/organizations/:organization_id/upstream_subscriptions/ping',
),
'usergroups': (
'/api/usergroups',
Expand All @@ -846,6 +870,10 @@
),
}

if is_open('BZ:1887932'):
missing = '/katello/api/activation_keys/:activation_key_id/subscriptions'
API_PATHS['subscriptions'] = tuple([subscription for subscription in API_PATHS['subscriptions'] if subscription != missing])


class AvailableURLsTestCase(TestCase):
"""Tests for ``api/v2``."""
Expand Down

0 comments on commit 1fdc69f

Please sign in to comment.