From 0a28da20aa66d3b283535669c8cb53b68f78a8c1 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Mon, 10 Jul 2023 10:20:27 +0200 Subject: [PATCH 01/19] bump version to 3.13.0-dev --- galaxy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/galaxy.yml b/galaxy.yml index 813fa9412..996d68e65 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -93,7 +93,7 @@ authors: - "metalcated " - "russianguppie <46544650+russianguppie@users.noreply.github.com>" - "willtome " -version: "3.12.0" +version: "3.13.0-dev" license: - "GPL-3.0-or-later" tags: From 0373cbd1ff48fd34fcb1363834ff2657689b9c2d Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Mon, 10 Jul 2023 11:16:02 +0200 Subject: [PATCH 02/19] don't mention "Foreman" in locations role readme other roles don't either, so lets be consistent --- roles/locations/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/locations/README.md b/roles/locations/README.md index 61f2d715b..8b290a6d8 100644 --- a/roles/locations/README.md +++ b/roles/locations/README.md @@ -1,7 +1,7 @@ theforeman.foreman.locations =================================== -This role creates and manages Foreman locations. +This role creates and manages locations. Role Variables -------------- From c0e22b00419d6aab9dfd1481f592b93add5075b0 Mon Sep 17 00:00:00 2001 From: alesc Date: Mon, 10 Jul 2023 14:35:49 +0200 Subject: [PATCH 03/19] add OpenStack to compute_resource --- changelogs/fragments/1641-openstack.yml | 2 + plugins/modules/compute_resource.py | 49 +++++++++++++++++++++++-- 2 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 changelogs/fragments/1641-openstack.yml diff --git a/changelogs/fragments/1641-openstack.yml b/changelogs/fragments/1641-openstack.yml new file mode 100644 index 000000000..57669e191 --- /dev/null +++ b/changelogs/fragments/1641-openstack.yml @@ -0,0 +1,2 @@ +minor_changes: + - compute_resource - add support for OpenStack \ No newline at end of file diff --git a/plugins/modules/compute_resource.py b/plugins/modules/compute_resource.py index 8c0a03d25..ff8ff5f32 100644 --- a/plugins/modules/compute_resource.py +++ b/plugins/modules/compute_resource.py @@ -49,7 +49,7 @@ provider: description: Compute resource provider. Required if I(state=present_with_defaults). required: false - choices: ["vmware", "libvirt", "ovirt", "proxmox", "EC2", "AzureRm", "GCE"] + choices: ["vmware", "libvirt", "ovirt", "proxmox", "EC2", "AzureRm", "GCE", "Openstack"] type: str provider_params: description: Parameter specific to compute resource provider. Required if I(state=present_with_defaults). @@ -74,7 +74,7 @@ type: str tenant: description: - - AzureRM tenant + - AzureRM tenant, Openstack project name type: str app_ident: description: @@ -184,6 +184,18 @@ - X509 Certification Authorities, only valid for I(provider=ovirt) type: str version_added: 2.0.0 + domain: + description: + - Auth domain for users, only valid for I(provider=Openstack) + type: str + project_domain_name: + description: + - Project domain name, only valid for I(provider=Openstack) + type: str + project_domain_id: + description: + - Project domain id, only valid for I(provider=Openstack) + type: str extends_documentation_fragment: - theforeman.foreman.foreman - theforeman.foreman.foreman.entity_state_with_defaults @@ -346,6 +358,28 @@ password: "changeme" state: present +- name: create Openstack compute resource + theforeman.foreman.compute_resource: + name: Openstack compute resource + description: Openstack + locations: + - DC1 + organizations: + - ACME + provider: Openstack + provider_params: + url: "https://Openstack.example.com:5000/v3" + user: admin + password: secret + tenant: "MyProject" + domain: "example.com" + project_domain_name: "example.com" + project_domain_id: "0123456789a0123456789b0123456789" + server_url: "https://foreman.example.com" + username: "admin" + password: "changeme" + state: present + ''' RETURN = ''' @@ -388,6 +422,9 @@ def get_provider_info(provider): elif provider_name == 'gce': return 'GCE', ['project', 'email', 'key_path', 'zone'] + elif provider_name == 'openstack': + return 'Openstack', ['url', 'user', 'password', 'tenant', 'domain', 'project_domain_name', 'project_domain_id'] + else: return '', [] @@ -402,7 +439,7 @@ def main(): name=dict(required=True), updated_name=dict(), description=dict(), - provider=dict(choices=['vmware', 'libvirt', 'ovirt', 'proxmox', 'EC2', 'AzureRm', 'GCE']), + provider=dict(choices=['vmware', 'libvirt', 'ovirt', 'proxmox', 'EC2', 'AzureRm', 'GCE', 'Openstack']), display_type=dict(invisible=True), datacenter=dict(invisible=True), url=dict(invisible=True), @@ -424,6 +461,9 @@ def main(): keyboard_layout=dict(invisible=True), public_key=dict(invisible=True), sub_id=dict(invisible=True), + domain=dict(invisible=True), + project_domain_name=dict(invisible=True), + project_domain_id=dict(invisible=True), ), argument_spec=dict( provider_params=dict(type='dict', options=dict( @@ -449,6 +489,9 @@ def main(): 'is', 'lt', 'nl', 'pl', 'ru', 'th', 'de', 'en-us', 'fi', 'fr-be', 'hr', 'it', 'lv', 'nl-be', 'pt', 'sl', 'tr']), public_key=dict(), sub_id=dict(), + domain=dict(), + project_domain_name=dict(), + project_domain_id=dict(), ), mutually_exclusive=[['user', 'sub_id']], ), From 7e36b39a1c33a70a3e65cc8f5cd1073d343e491b Mon Sep 17 00:00:00 2001 From: Andrea Perotti Date: Fri, 14 Jul 2023 20:42:40 +0200 Subject: [PATCH 04/19] Small typo fix: Red hat -> Red Hat --- roles/convert2rhel/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/convert2rhel/README.md b/roles/convert2rhel/README.md index ac17d670b..63a2d7e22 100644 --- a/roles/convert2rhel/README.md +++ b/roles/convert2rhel/README.md @@ -1,7 +1,7 @@ theforeman.foreman.convert2rhel =============================== -This role creates a basic configuration for everything needed to register and convert CentOS clients to Red hat Enterprise Linux. +This role creates a basic configuration for everything needed to register and convert CentOS clients to Red Hat Enterprise Linux. First step is upload of manifest and synchronization of RHEL repositories. For more detail see [content_rhel Role](https://github.com/theforeman/foreman-ansible-modules/blob/develop/roles/content_rhel/README.md). From b3b271601da2305bbe6efd8bc99bf36d6e67d6a0 Mon Sep 17 00:00:00 2001 From: yuqo2450 <79540477+yuqo2450@users.noreply.github.com> Date: Mon, 24 Jul 2023 09:56:32 +0200 Subject: [PATCH 05/19] changed parameter_type to be None instead of empty string when override is set to false --- ...4-smart_class_parameter-override_false.yml | 2 + plugins/modules/smart_class_parameter.py | 2 +- .../fixtures/smart_class_parameter-0.yml | 43 ++-- .../fixtures/smart_class_parameter-1.yml | 28 +-- .../fixtures/smart_class_parameter-10.yml | 87 ++----- .../fixtures/smart_class_parameter-11.yml | 42 ++-- .../fixtures/smart_class_parameter-12.yml | 87 ++----- .../fixtures/smart_class_parameter-13.yml | 87 +++++-- .../fixtures/smart_class_parameter-14.yml | 42 ++-- .../fixtures/smart_class_parameter-15.yml | 87 +++++-- .../fixtures/smart_class_parameter-16.yml | 87 ++----- .../fixtures/smart_class_parameter-17.yml | 87 +++++-- .../fixtures/smart_class_parameter-18.yml | 94 ++----- .../fixtures/smart_class_parameter-19.yml | 93 +++++-- .../fixtures/smart_class_parameter-2.yml | 38 +-- .../fixtures/smart_class_parameter-20.yml | 34 +-- .../fixtures/smart_class_parameter-21.yml | 43 ++-- .../fixtures/smart_class_parameter-22.yml | 28 +-- .../fixtures/smart_class_parameter-23.yml | 146 ++--------- .../fixtures/smart_class_parameter-24.yml | 89 +++++-- .../fixtures/smart_class_parameter-25.yml | 89 ++----- .../fixtures/smart_class_parameter-26.yml | 148 +++++++++-- .../fixtures/smart_class_parameter-27.yml | 148 ++--------- .../fixtures/smart_class_parameter-28.yml | 90 +++++-- .../fixtures/smart_class_parameter-29.yml | 96 ++------ .../fixtures/smart_class_parameter-3.yml | 28 +-- .../fixtures/smart_class_parameter-30.yml | 152 ++++++++++-- .../fixtures/smart_class_parameter-31.yml | 35 +-- .../fixtures/smart_class_parameter-32.yml | 43 ++-- .../fixtures/smart_class_parameter-33.yml | 28 +-- .../fixtures/smart_class_parameter-34.yml | 146 ++--------- .../fixtures/smart_class_parameter-35.yml | 89 +++++-- .../fixtures/smart_class_parameter-36.yml | 87 ++----- .../fixtures/smart_class_parameter-37.yml | 147 +++++++++-- .../fixtures/smart_class_parameter-38.yml | 96 ++------ .../fixtures/smart_class_parameter-39.yml | 93 +++++-- .../fixtures/smart_class_parameter-4.yml | 28 +-- .../fixtures/smart_class_parameter-40.yml | 35 +-- .../fixtures/smart_class_parameter-41.yml | 43 ++-- .../fixtures/smart_class_parameter-42.yml | 28 +-- .../fixtures/smart_class_parameter-43.yml | 146 ++--------- .../fixtures/smart_class_parameter-44.yml | 89 +++++-- .../fixtures/smart_class_parameter-45.yml | 87 ++----- .../fixtures/smart_class_parameter-46.yml | 147 +++++++++-- .../fixtures/smart_class_parameter-47.yml | 97 ++------ .../fixtures/smart_class_parameter-48.yml | 93 +++++-- .../fixtures/smart_class_parameter-49.yml | 94 ++----- .../fixtures/smart_class_parameter-5.yml | 42 ++-- .../fixtures/smart_class_parameter-50.yml | 89 +++++-- .../fixtures/smart_class_parameter-51.yml | 28 +-- .../fixtures/smart_class_parameter-52.yml | 109 ++------- .../fixtures/smart_class_parameter-53.yml | 30 ++- .../fixtures/smart_class_parameter-54.yml | 87 ++----- .../fixtures/smart_class_parameter-55.yml | 147 +++++++++-- .../fixtures/smart_class_parameter-56.yml | 31 +-- .../fixtures/smart_class_parameter-57.yml | 53 ++-- .../fixtures/smart_class_parameter-58.yml | 30 +-- .../fixtures/smart_class_parameter-59.yml | 170 +++++++++++++ .../fixtures/smart_class_parameter-6.yml | 28 +-- .../fixtures/smart_class_parameter-60.yml | 231 ++++++++++++++++++ .../fixtures/smart_class_parameter-61.yml | 170 +++++++++++++ .../fixtures/smart_class_parameter-7.yml | 87 +++++-- .../fixtures/smart_class_parameter-8.yml | 40 +-- .../fixtures/smart_class_parameter-9.yml | 28 +-- .../test_playbooks/smart_class_parameter.yml | 18 ++ 65 files changed, 2855 insertions(+), 2211 deletions(-) create mode 100644 changelogs/fragments/1644-smart_class_parameter-override_false.yml create mode 100644 tests/test_playbooks/fixtures/smart_class_parameter-59.yml create mode 100644 tests/test_playbooks/fixtures/smart_class_parameter-60.yml create mode 100644 tests/test_playbooks/fixtures/smart_class_parameter-61.yml diff --git a/changelogs/fragments/1644-smart_class_parameter-override_false.yml b/changelogs/fragments/1644-smart_class_parameter-override_false.yml new file mode 100644 index 000000000..07bfcce41 --- /dev/null +++ b/changelogs/fragments/1644-smart_class_parameter-override_false.yml @@ -0,0 +1,2 @@ +bugfixes: + - smart_class_parameter - correctly allow setting ``override`` to ``false`` (https://github.com/theforeman/foreman-ansible-modules/issues/1644) \ No newline at end of file diff --git a/plugins/modules/smart_class_parameter.py b/plugins/modules/smart_class_parameter.py index e8f345821..c71e2c95c 100644 --- a/plugins/modules/smart_class_parameter.py +++ b/plugins/modules/smart_class_parameter.py @@ -252,7 +252,7 @@ def main(): module.set_entity('entity', entity) # When override is set to false, foreman API don't accept parameter_type and all 'override options' have to be set to false if present if not module_params.get('override', False): - module_params['parameter_type'] = '' + module_params['parameter_type'] = None for override_option in ['merge_default', 'merge_overrides', 'avoid_duplicates']: if override_option in entity and entity[override_option]: module_params[override_option] = False diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-0.yml b/tests/test_playbooks/fixtures/smart_class_parameter-0.yml index fc8b044a0..dac160f17 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-0.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-0.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=logfile\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":false,\"parameter_type\":\"\",\"hidden_value?\":false,\"omit\":null,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:46:51 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"\",\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":false,\"parameter_type\":\"\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:24:05 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"\",\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '672' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,13 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/16 response: body: - string: '{"description":"","override":false,"parameter_type":"","hidden_value?":false,"omit":null,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:46:51 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"","override":false,"parameter_type":"","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:05 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '595' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -146,13 +148,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -167,8 +167,7 @@ interactions: code: 200 message: OK - request: - body: '{"smart_class_parameter": {"override": true, "description": "ntp log file", - "omit": false}}' + body: '{"smart_class_parameter": {"override": true, "description": "ntp log file"}}' headers: Accept: - application/json;version=2 @@ -177,7 +176,7 @@ interactions: Connection: - keep-alive Content-Length: - - '91' + - '76' Content-Type: - application/json User-Agent: @@ -186,13 +185,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/16 response: body: - string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:46:53 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:08 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '606' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -206,13 +207,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-1.yml b/tests/test_playbooks/fixtures/smart_class_parameter-1.yml index 72898c16d..3286184cd 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-1.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-1.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=logfile\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"ntp log file\",\"override\":true,\"parameter_type\":\"\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:46:53 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"\",\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"ntp log file\",\"override\":true,\"parameter_type\":\"\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:24:08 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"\",\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '683' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,13 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/16 response: body: - string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:46:53 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:08 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '606' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -146,13 +148,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-10.yml b/tests/test_playbooks/fixtures/smart_class_parameter-10.yml index 14055f905..1114bf04c 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-10.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-10.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=logfile\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"ntp log file\",\"override\":true,\"parameter_type\":\"\",\"hidden_value?\":true,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:46:58 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"*****\",\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"ntp log file\",\"override\":true,\"parameter_type\":\"\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:24:17 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"\",\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '683' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,72 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/16 response: body: - string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":true,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:46:58 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"*****","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:17 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive - Content-Security-Policy: - - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; - img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; - style-src ''unsafe-inline'' ''self''' - Content-Type: - - application/json; charset=utf-8 - Foreman_api_version: - - '2' - Foreman_current_location: - - ; ANY - Foreman_current_organization: - - ; ANY - Foreman_version: - - 3.5.0-rc1 - Keep-Alive: - - timeout=15, max=98 - Strict-Transport-Security: - - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Frame-Options: - - sameorigin - X-Permitted-Cross-Domain-Policies: - - none - X-XSS-Protection: - - 1; mode=block - status: - code: 200 - message: OK -- request: - body: '{"smart_class_parameter": {"default_value": "/var/log/ntp.log"}}' - headers: - Accept: - - application/json;version=2 - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive Content-Length: - - '64' - Content-Type: - - application/json - User-Agent: - - apypie (https://github.com/Apipie/apypie) - method: PUT - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/16 - response: - body: - string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":true,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:46:59 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"*****","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' - headers: - Cache-Control: - - max-age=0, private, must-revalidate - Connection: - - Keep-Alive + - '606' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -205,13 +148,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - - timeout=15, max=97 + - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-11.yml b/tests/test_playbooks/fixtures/smart_class_parameter-11.yml index dd0f4ba0d..5082d0bbb 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-11.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-11.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=logfile\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"ntp log file\",\"override\":true,\"parameter_type\":\"\",\"hidden_value?\":true,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:46:59 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"*****\",\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"ntp log file\",\"override\":true,\"parameter_type\":\"\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:24:17 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"\",\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '683' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,13 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/16 response: body: - string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":true,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:46:59 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"*****","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:17 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '606' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -146,13 +148,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -167,7 +167,7 @@ interactions: code: 200 message: OK - request: - body: '{"smart_class_parameter": {"default_value": "/var/log/ntp.log"}}' + body: '{"smart_class_parameter": {"hidden_value": true}}' headers: Accept: - application/json;version=2 @@ -176,7 +176,7 @@ interactions: Connection: - keep-alive Content-Length: - - '64' + - '49' Content-Type: - application/json User-Agent: @@ -185,13 +185,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/16 response: body: - string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":true,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:46:59 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"*****","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":true,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:21 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"*****","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '610' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -205,13 +207,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-12.yml b/tests/test_playbooks/fixtures/smart_class_parameter-12.yml index 0f4176384..c5c87bb2c 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-12.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-12.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=logfile\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"ntp log file\",\"override\":true,\"parameter_type\":\"\",\"hidden_value?\":true,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:46:59 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"*****\",\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"ntp log file\",\"override\":true,\"parameter_type\":\"\",\"hidden_value?\":true,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:24:21 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"*****\",\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '687' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,72 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/16 response: body: - string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":true,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:46:59 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"*****","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":true,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:21 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"*****","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive - Content-Security-Policy: - - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; - img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; - style-src ''unsafe-inline'' ''self''' - Content-Type: - - application/json; charset=utf-8 - Foreman_api_version: - - '2' - Foreman_current_location: - - ; ANY - Foreman_current_organization: - - ; ANY - Foreman_version: - - 3.5.0-rc1 - Keep-Alive: - - timeout=15, max=98 - Strict-Transport-Security: - - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Frame-Options: - - sameorigin - X-Permitted-Cross-Domain-Policies: - - none - X-XSS-Protection: - - 1; mode=block - status: - code: 200 - message: OK -- request: - body: '{"smart_class_parameter": {"hidden_value": false}}' - headers: - Accept: - - application/json;version=2 - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive Content-Length: - - '50' - Content-Type: - - application/json - User-Agent: - - apypie (https://github.com/Apipie/apypie) - method: PUT - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/16 - response: - body: - string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:00 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"/var/log/ntp.log","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' - headers: - Cache-Control: - - max-age=0, private, must-revalidate - Connection: - - Keep-Alive + - '610' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -205,13 +148,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - - timeout=15, max=97 + - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-13.yml b/tests/test_playbooks/fixtures/smart_class_parameter-13.yml index edb169380..893eb46a5 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-13.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-13.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=logfile\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"ntp log file\",\"override\":true,\"parameter_type\":\"\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:00 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"/var/log/ntp.log\",\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"ntp log file\",\"override\":true,\"parameter_type\":\"\",\"hidden_value?\":true,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:24:21 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"*****\",\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '687' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,13 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/16 response: body: - string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:00 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"/var/log/ntp.log","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":true,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:21 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"*****","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '610' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -146,13 +148,70 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: '{"smart_class_parameter": {"default_value": "/var/log/ntp.log"}}' + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '64' + Content-Type: + - application/json + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: PUT + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/16 + response: + body: + string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":true,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:23 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"*****","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '610' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=97 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-14.yml b/tests/test_playbooks/fixtures/smart_class_parameter-14.yml index 44b93ada2..a2e8b0b21 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-14.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-14.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=logfile\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"ntp log file\",\"override\":true,\"parameter_type\":\"\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:00 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"/var/log/ntp.log\",\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"ntp log file\",\"override\":true,\"parameter_type\":\"\",\"hidden_value?\":true,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:24:23 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"*****\",\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '687' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,13 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/16 response: body: - string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:00 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"/var/log/ntp.log","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":true,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:23 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"*****","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '610' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -146,13 +148,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -167,7 +167,7 @@ interactions: code: 200 message: OK - request: - body: '{"smart_class_parameter": {"override_value_order": "fqdn\ndomain\nlocation\nhostgroup"}}' + body: '{"smart_class_parameter": {"default_value": "/var/log/ntp.log"}}' headers: Accept: - application/json;version=2 @@ -176,7 +176,7 @@ interactions: Connection: - keep-alive Content-Length: - - '88' + - '64' Content-Type: - application/json User-Agent: @@ -185,13 +185,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/16 response: body: - string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\ndomain\nlocation\nhostgroup","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:01 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"/var/log/ntp.log","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":true,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:23 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"*****","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '610' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -205,13 +207,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-15.yml b/tests/test_playbooks/fixtures/smart_class_parameter-15.yml index 71c95074a..1a9ba5db4 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-15.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-15.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=logfile\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"ntp log file\",\"override\":true,\"parameter_type\":\"\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\ndomain\\nlocation\\nhostgroup\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:01 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"/var/log/ntp.log\",\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"ntp log file\",\"override\":true,\"parameter_type\":\"\",\"hidden_value?\":true,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:24:23 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"*****\",\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '687' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,13 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/16 response: body: - string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\ndomain\nlocation\nhostgroup","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:01 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"/var/log/ntp.log","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":true,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:23 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"*****","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '610' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -146,13 +148,70 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: '{"smart_class_parameter": {"hidden_value": false}}' + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '50' + Content-Type: + - application/json + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: PUT + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/16 + response: + body: + string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:26 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"/var/log/ntp.log","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '622' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=97 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-16.yml b/tests/test_playbooks/fixtures/smart_class_parameter-16.yml index be44f350c..32c703d4a 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-16.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-16.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=logfile\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"ntp log file\",\"override\":true,\"parameter_type\":\"\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\ndomain\\nlocation\\nhostgroup\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:01 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"/var/log/ntp.log\",\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"ntp log file\",\"override\":true,\"parameter_type\":\"\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:24:26 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"/var/log/ntp.log\",\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '699' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,72 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/16 response: body: - string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\ndomain\nlocation\nhostgroup","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:01 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"/var/log/ntp.log","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:26 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"/var/log/ntp.log","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive - Content-Security-Policy: - - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; - img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; - style-src ''unsafe-inline'' ''self''' - Content-Type: - - application/json; charset=utf-8 - Foreman_api_version: - - '2' - Foreman_current_location: - - ; ANY - Foreman_current_organization: - - ; ANY - Foreman_version: - - 3.5.0-rc1 - Keep-Alive: - - timeout=15, max=98 - Strict-Transport-Security: - - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Frame-Options: - - sameorigin - X-Permitted-Cross-Domain-Policies: - - none - X-XSS-Protection: - - 1; mode=block - status: - code: 200 - message: OK -- request: - body: '{"smart_class_parameter": {"override_value_order": "fqdn\nhostgroup\nos\ndomain"}}' - headers: - Accept: - - application/json;version=2 - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive Content-Length: - - '82' - Content-Type: - - application/json - User-Agent: - - apypie (https://github.com/Apipie/apypie) - method: PUT - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/16 - response: - body: - string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:02 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"/var/log/ntp.log","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' - headers: - Cache-Control: - - max-age=0, private, must-revalidate - Connection: - - Keep-Alive + - '622' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -205,13 +148,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - - timeout=15, max=97 + - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-17.yml b/tests/test_playbooks/fixtures/smart_class_parameter-17.yml index eac874c55..9c6d6e0b8 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-17.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-17.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=logfile\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"ntp log file\",\"override\":true,\"parameter_type\":\"\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:02 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"/var/log/ntp.log\",\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"ntp log file\",\"override\":true,\"parameter_type\":\"\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:24:26 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"/var/log/ntp.log\",\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '699' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,13 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/16 response: body: - string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:02 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"/var/log/ntp.log","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:26 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"/var/log/ntp.log","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '622' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -146,13 +148,70 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: '{"smart_class_parameter": {"override_value_order": "fqdn\ndomain\nlocation\nhostgroup"}}' + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '88' + Content-Type: + - application/json + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: PUT + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/16 + response: + body: + string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\ndomain\nlocation\nhostgroup","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:28 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"/var/log/ntp.log","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '628' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=97 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-18.yml b/tests/test_playbooks/fixtures/smart_class_parameter-18.yml index 5df391df9..d44475325 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-18.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-18.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -65,19 +65,21 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters?search=puppetclass_name%3Dntp+and+parameter%3Dconfig_dir&per_page=4294967296 + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters?search=puppetclass_name%3Dntp+and+parameter%3Dlogfile&per_page=4294967296 response: body: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": - 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=config_dir\",\n + 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=logfile\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":false,\"parameter_type\":\"\",\"hidden_value?\":false,\"omit\":null,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:46:51 UTC\",\"parameter\":\"config_dir\",\"id\":4,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"\",\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"ntp log file\",\"override\":true,\"parameter_type\":\"\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\ndomain\\nlocation\\nhostgroup\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:24:28 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"/var/log/ntp.log\",\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '705' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -123,76 +123,18 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/4 + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/16 response: body: - string: '{"description":"","override":false,"parameter_type":"","hidden_value?":false,"omit":null,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:46:51 UTC","parameter":"config_dir","id":4,"puppetclass_id":2,"override_values_count":0,"default_value":"","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\ndomain\nlocation\nhostgroup","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:28 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"/var/log/ntp.log","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive - Content-Security-Policy: - - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; - img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; - style-src ''unsafe-inline'' ''self''' - Content-Type: - - application/json; charset=utf-8 - Foreman_api_version: - - '2' - Foreman_current_location: - - ; ANY - Foreman_current_organization: - - ; ANY - Foreman_version: - - 3.5.0-rc1 - Keep-Alive: - - timeout=15, max=98 - Strict-Transport-Security: - - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Frame-Options: - - sameorigin - X-Permitted-Cross-Domain-Policies: - - none - X-XSS-Protection: - - 1; mode=block - status: - code: 200 - message: OK -- request: - body: '{"smart_class_parameter": {"override": true, "default_value": "/etc/ntpd-foo", - "omit": false, "parameter_type": "string"}}' - headers: - Accept: - - application/json;version=2 - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive Content-Length: - - '122' - Content-Type: - - application/json - User-Agent: - - apypie (https://github.com/Apipie/apypie) - method: PUT - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/4 - response: - body: - string: '{"description":"","override":true,"parameter_type":"string","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:04 UTC","parameter":"config_dir","id":4,"puppetclass_id":2,"override_values_count":0,"default_value":"/etc/ntpd-foo","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' - headers: - Cache-Control: - - max-age=0, private, must-revalidate - Connection: - - Keep-Alive + - '628' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -206,13 +148,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - - timeout=15, max=97 + - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-19.yml b/tests/test_playbooks/fixtures/smart_class_parameter-19.yml index 3319319a6..bfd22c554 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-19.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-19.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -65,19 +65,21 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters?search=puppetclass_name%3Dntp+and+parameter%3Dconfig_dir&per_page=4294967296 + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters?search=puppetclass_name%3Dntp+and+parameter%3Dlogfile&per_page=4294967296 response: body: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": - 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=config_dir\",\n + 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=logfile\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":true,\"parameter_type\":\"string\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:04 UTC\",\"parameter\":\"config_dir\",\"id\":4,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"/etc/ntpd-foo\",\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"ntp log file\",\"override\":true,\"parameter_type\":\"\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\ndomain\\nlocation\\nhostgroup\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:24:28 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"/var/log/ntp.log\",\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '705' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -123,16 +123,18 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/4 + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/16 response: body: - string: '{"description":"","override":true,"parameter_type":"string","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:04 UTC","parameter":"config_dir","id":4,"puppetclass_id":2,"override_values_count":0,"default_value":"/etc/ntpd-foo","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\ndomain\nlocation\nhostgroup","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:28 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"/var/log/ntp.log","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '628' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -146,13 +148,70 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: '{"smart_class_parameter": {"override_value_order": "fqdn\nhostgroup\nos\ndomain"}}' + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '82' + Content-Type: + - application/json + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: PUT + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/16 + response: + body: + string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:30 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"/var/log/ntp.log","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '622' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=97 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-2.yml b/tests/test_playbooks/fixtures/smart_class_parameter-2.yml index 1b5616f8d..df36d1035 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-2.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-2.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=logfile\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"ntp log file\",\"override\":true,\"parameter_type\":\"\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:46:53 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"\",\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"ntp log file\",\"override\":true,\"parameter_type\":\"\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:24:08 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"\",\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '683' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,13 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/16 response: body: - string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:46:53 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:08 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '606' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -146,13 +148,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -185,13 +185,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/16 response: body: - string: '{"description":"ntp log file","override":true,"parameter_type":"string","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:46:55 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"ntp log file","override":true,"parameter_type":"string","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:10 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '612' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -205,13 +207,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-20.yml b/tests/test_playbooks/fixtures/smart_class_parameter-20.yml index 3319319a6..bef025eb9 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-20.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-20.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -65,19 +65,21 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters?search=puppetclass_name%3Dntp+and+parameter%3Dconfig_dir&per_page=4294967296 + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters?search=puppetclass_name%3Dntp+and+parameter%3Dlogfile&per_page=4294967296 response: body: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": - 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=config_dir\",\n + 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=logfile\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":true,\"parameter_type\":\"string\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:04 UTC\",\"parameter\":\"config_dir\",\"id\":4,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"/etc/ntpd-foo\",\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"ntp log file\",\"override\":true,\"parameter_type\":\"\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:24:30 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"/var/log/ntp.log\",\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '699' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -123,16 +123,18 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/4 + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/16 response: body: - string: '{"description":"","override":true,"parameter_type":"string","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:04 UTC","parameter":"config_dir","id":4,"puppetclass_id":2,"override_values_count":0,"default_value":"/etc/ntpd-foo","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:30 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"/var/log/ntp.log","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '622' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -146,13 +148,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-21.yml b/tests/test_playbooks/fixtures/smart_class_parameter-21.yml index bbf08fd73..3d656a835 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-21.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-21.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=config_dir\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":true,\"parameter_type\":\"string\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:04 UTC\",\"parameter\":\"config_dir\",\"id\":4,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"/etc/ntpd-foo\",\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":false,\"parameter_type\":\"\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:30 UTC\",\"updated_at\":\"2023-07-26 08:24:05 UTC\",\"parameter\":\"config_dir\",\"id\":4,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"\",\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '677' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,13 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/4 response: body: - string: '{"description":"","override":true,"parameter_type":"string","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:04 UTC","parameter":"config_dir","id":4,"puppetclass_id":2,"override_values_count":0,"default_value":"/etc/ntpd-foo","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"","override":false,"parameter_type":"","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:30 UTC","updated_at":"2023-07-26 08:24:05 UTC","parameter":"config_dir","id":4,"puppetclass_id":2,"override_values_count":0,"default_value":"","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '597' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -146,13 +148,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -167,7 +167,8 @@ interactions: code: 200 message: OK - request: - body: '{"smart_class_parameter": {"default_value": "/etc/ntpd"}}' + body: '{"smart_class_parameter": {"override": true, "default_value": "/etc/ntpd-foo", + "parameter_type": "string"}}' headers: Accept: - application/json;version=2 @@ -176,7 +177,7 @@ interactions: Connection: - keep-alive Content-Length: - - '57' + - '107' Content-Type: - application/json User-Agent: @@ -185,13 +186,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/4 response: body: - string: '{"description":"","override":true,"parameter_type":"string","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:05 UTC","parameter":"config_dir","id":4,"puppetclass_id":2,"override_values_count":0,"default_value":"/etc/ntpd","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"","override":true,"parameter_type":"string","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:30 UTC","updated_at":"2023-07-26 08:24:33 UTC","parameter":"config_dir","id":4,"puppetclass_id":2,"override_values_count":0,"default_value":"/etc/ntpd-foo","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '615' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -205,13 +208,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-22.yml b/tests/test_playbooks/fixtures/smart_class_parameter-22.yml index c9e3d6e7b..81cea1dda 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-22.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-22.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=config_dir\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":true,\"parameter_type\":\"string\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:05 UTC\",\"parameter\":\"config_dir\",\"id\":4,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"/etc/ntpd\",\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":true,\"parameter_type\":\"string\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:30 UTC\",\"updated_at\":\"2023-07-26 08:24:33 UTC\",\"parameter\":\"config_dir\",\"id\":4,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"/etc/ntpd-foo\",\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '695' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,13 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/4 response: body: - string: '{"description":"","override":true,"parameter_type":"string","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:05 UTC","parameter":"config_dir","id":4,"puppetclass_id":2,"override_values_count":0,"default_value":"/etc/ntpd","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"","override":true,"parameter_type":"string","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:30 UTC","updated_at":"2023-07-26 08:24:33 UTC","parameter":"config_dir","id":4,"puppetclass_id":2,"override_values_count":0,"default_value":"/etc/ntpd-foo","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '615' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -146,13 +148,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-23.yml b/tests/test_playbooks/fixtures/smart_class_parameter-23.yml index 5d7725ce0..81cea1dda 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-23.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-23.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=config_dir\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":true,\"parameter_type\":\"string\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:05 UTC\",\"parameter\":\"config_dir\",\"id\":4,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"/etc/ntpd\",\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":true,\"parameter_type\":\"string\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:30 UTC\",\"updated_at\":\"2023-07-26 08:24:33 UTC\",\"parameter\":\"config_dir\",\"id\":4,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"/etc/ntpd-foo\",\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '695' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,13 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/4 response: body: - string: '{"description":"","override":true,"parameter_type":"string","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:05 UTC","parameter":"config_dir","id":4,"puppetclass_id":2,"override_values_count":0,"default_value":"/etc/ntpd","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"","override":true,"parameter_type":"string","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:30 UTC","updated_at":"2023-07-26 08:24:33 UTC","parameter":"config_dir","id":4,"puppetclass_id":2,"override_values_count":0,"default_value":"/etc/ntpd-foo","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '615' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -146,13 +148,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -166,122 +166,4 @@ interactions: status: code: 200 message: OK -- request: - body: '{"override_value": {"match": "domain=example.com", "value": "/etc/ntpd/foo"}}' - headers: - Accept: - - application/json;version=2 - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '77' - Content-Type: - - application/json - User-Agent: - - apypie (https://github.com/Apipie/apypie) - method: POST - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/4/override_values - response: - body: - string: '{"created_at":"2022-11-25 11:47:06 UTC","updated_at":"2022-11-25 11:47:06 - UTC","id":1,"match":"domain=example.com","value":"/etc/ntpd/foo","omit":false}' - headers: - Cache-Control: - - max-age=0, private, must-revalidate - Connection: - - Keep-Alive - Content-Security-Policy: - - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; - img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; - style-src ''unsafe-inline'' ''self''' - Content-Type: - - application/json; charset=utf-8 - Foreman_api_version: - - '2' - Foreman_current_location: - - ; ANY - Foreman_current_organization: - - ; ANY - Foreman_version: - - 3.5.0-rc1 - Keep-Alive: - - timeout=15, max=97 - Strict-Transport-Security: - - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Frame-Options: - - sameorigin - X-Permitted-Cross-Domain-Policies: - - none - X-XSS-Protection: - - 1; mode=block - status: - code: 201 - message: Created -- request: - body: '{"override_value": {"match": "hostgroup=test_hostgroup", "omit": true}}' - headers: - Accept: - - application/json;version=2 - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '71' - Content-Type: - - application/json - User-Agent: - - apypie (https://github.com/Apipie/apypie) - method: POST - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/4/override_values - response: - body: - string: '{"created_at":"2022-11-25 11:47:06 UTC","updated_at":"2022-11-25 11:47:06 - UTC","id":2,"match":"hostgroup=test_hostgroup","value":null,"omit":true}' - headers: - Cache-Control: - - max-age=0, private, must-revalidate - Connection: - - Keep-Alive - Content-Security-Policy: - - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; - img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; - style-src ''unsafe-inline'' ''self''' - Content-Type: - - application/json; charset=utf-8 - Foreman_api_version: - - '2' - Foreman_current_location: - - ; ANY - Foreman_current_organization: - - ; ANY - Foreman_version: - - 3.5.0-rc1 - Keep-Alive: - - timeout=15, max=96 - Strict-Transport-Security: - - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Frame-Options: - - sameorigin - X-Permitted-Cross-Domain-Policies: - - none - X-XSS-Protection: - - 1; mode=block - status: - code: 201 - message: Created version: 1 diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-24.yml b/tests/test_playbooks/fixtures/smart_class_parameter-24.yml index 76248b50c..f33aedc79 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-24.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-24.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=config_dir\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":true,\"parameter_type\":\"string\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:05 UTC\",\"parameter\":\"config_dir\",\"id\":4,\"puppetclass_id\":2,\"override_values_count\":2,\"default_value\":\"/etc/ntpd\",\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":true,\"parameter_type\":\"string\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:30 UTC\",\"updated_at\":\"2023-07-26 08:24:33 UTC\",\"parameter\":\"config_dir\",\"id\":4,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"/etc/ntpd-foo\",\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '695' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,15 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/4 response: body: - string: '{"description":"","override":true,"parameter_type":"string","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:05 UTC","parameter":"config_dir","id":4,"puppetclass_id":2,"override_values_count":2,"default_value":"/etc/ntpd","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[{"created_at":"2022-11-25 - 11:47:06 UTC","updated_at":"2022-11-25 11:47:06 UTC","id":1,"match":"domain=example.com","value":"/etc/ntpd/foo","omit":false},{"created_at":"2022-11-25 - 11:47:06 UTC","updated_at":"2022-11-25 11:47:06 UTC","id":2,"match":"hostgroup=test_hostgroup","value":null,"omit":true}]}' + string: '{"description":"","override":true,"parameter_type":"string","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:30 UTC","updated_at":"2023-07-26 08:24:33 UTC","parameter":"config_dir","id":4,"puppetclass_id":2,"override_values_count":0,"default_value":"/etc/ntpd-foo","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '615' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -148,13 +148,70 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: '{"smart_class_parameter": {"default_value": "/etc/ntpd"}}' + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '57' + Content-Type: + - application/json + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: PUT + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/4 + response: + body: + string: '{"description":"","override":true,"parameter_type":"string","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:30 UTC","updated_at":"2023-07-26 08:24:36 UTC","parameter":"config_dir","id":4,"puppetclass_id":2,"override_values_count":0,"default_value":"/etc/ntpd","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '611' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=97 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-25.yml b/tests/test_playbooks/fixtures/smart_class_parameter-25.yml index 9bc534467..65ec5e1da 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-25.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-25.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=config_dir\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":true,\"parameter_type\":\"string\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:05 UTC\",\"parameter\":\"config_dir\",\"id\":4,\"puppetclass_id\":2,\"override_values_count\":2,\"default_value\":\"/etc/ntpd\",\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":true,\"parameter_type\":\"string\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:30 UTC\",\"updated_at\":\"2023-07-26 08:24:36 UTC\",\"parameter\":\"config_dir\",\"id\":4,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"/etc/ntpd\",\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '691' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,74 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/4 response: body: - string: '{"description":"","override":true,"parameter_type":"string","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:05 UTC","parameter":"config_dir","id":4,"puppetclass_id":2,"override_values_count":2,"default_value":"/etc/ntpd","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[{"created_at":"2022-11-25 - 11:47:06 UTC","updated_at":"2022-11-25 11:47:06 UTC","id":1,"match":"domain=example.com","value":"/etc/ntpd/foo","omit":false},{"created_at":"2022-11-25 - 11:47:06 UTC","updated_at":"2022-11-25 11:47:06 UTC","id":2,"match":"hostgroup=test_hostgroup","value":null,"omit":true}]}' + string: '{"description":"","override":true,"parameter_type":"string","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:30 UTC","updated_at":"2023-07-26 08:24:36 UTC","parameter":"config_dir","id":4,"puppetclass_id":2,"override_values_count":0,"default_value":"/etc/ntpd","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive - Content-Security-Policy: - - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; - img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; - style-src ''unsafe-inline'' ''self''' - Content-Type: - - application/json; charset=utf-8 - Foreman_api_version: - - '2' - Foreman_current_location: - - ; ANY - Foreman_current_organization: - - ; ANY - Foreman_version: - - 3.5.0-rc1 - Keep-Alive: - - timeout=15, max=98 - Strict-Transport-Security: - - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Frame-Options: - - sameorigin - X-Permitted-Cross-Domain-Policies: - - none - X-XSS-Protection: - - 1; mode=block - status: - code: 200 - message: OK -- request: - body: '{"override_value": {"value": "/etc/ntpd/foonew"}}' - headers: - Accept: - - application/json;version=2 - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive Content-Length: - - '49' - Content-Type: - - application/json - User-Agent: - - apypie (https://github.com/Apipie/apypie) - method: PUT - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/4/override_values/1 - response: - body: - string: '{"created_at":"2022-11-25 11:47:06 UTC","updated_at":"2022-11-25 11:47:08 - UTC","id":1,"match":"domain=example.com","value":"/etc/ntpd/foonew","omit":false}' - headers: - Cache-Control: - - max-age=0, private, must-revalidate - Connection: - - Keep-Alive + - '611' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -207,13 +148,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - - timeout=15, max=97 + - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-26.yml b/tests/test_playbooks/fixtures/smart_class_parameter-26.yml index 7ee6c52f3..8535b949c 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-26.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-26.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=config_dir\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":true,\"parameter_type\":\"string\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:05 UTC\",\"parameter\":\"config_dir\",\"id\":4,\"puppetclass_id\":2,\"override_values_count\":2,\"default_value\":\"/etc/ntpd\",\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":true,\"parameter_type\":\"string\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:30 UTC\",\"updated_at\":\"2023-07-26 08:24:36 UTC\",\"parameter\":\"config_dir\",\"id\":4,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"/etc/ntpd\",\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '691' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,15 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/4 response: body: - string: '{"description":"","override":true,"parameter_type":"string","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:05 UTC","parameter":"config_dir","id":4,"puppetclass_id":2,"override_values_count":2,"default_value":"/etc/ntpd","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[{"created_at":"2022-11-25 - 11:47:06 UTC","updated_at":"2022-11-25 11:47:08 UTC","id":1,"match":"domain=example.com","value":"/etc/ntpd/foonew","omit":false},{"created_at":"2022-11-25 - 11:47:06 UTC","updated_at":"2022-11-25 11:47:06 UTC","id":2,"match":"hostgroup=test_hostgroup","value":null,"omit":true}]}' + string: '{"description":"","override":true,"parameter_type":"string","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:30 UTC","updated_at":"2023-07-26 08:24:36 UTC","parameter":"config_dir","id":4,"puppetclass_id":2,"override_values_count":0,"default_value":"/etc/ntpd","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '611' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -148,13 +148,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -168,4 +166,122 @@ interactions: status: code: 200 message: OK +- request: + body: '{"override_value": {"match": "domain=example.com", "value": "/etc/ntpd/foo"}}' + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '77' + Content-Type: + - application/json + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: POST + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/4/override_values + response: + body: + string: '{"created_at":"2023-07-26 08:24:38 UTC","updated_at":"2023-07-26 08:24:38 + UTC","id":25,"match":"domain=example.com","value":"/etc/ntpd/foo","omit":false}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '153' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=97 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 201 + message: Created +- request: + body: '{"override_value": {"match": "hostgroup=test_hostgroup", "omit": true}}' + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '71' + Content-Type: + - application/json + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: POST + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/4/override_values + response: + body: + string: '{"created_at":"2023-07-26 08:24:38 UTC","updated_at":"2023-07-26 08:24:38 + UTC","id":26,"match":"hostgroup=test_hostgroup","value":null,"omit":true}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '147' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=96 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 201 + message: Created version: 1 diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-27.yml b/tests/test_playbooks/fixtures/smart_class_parameter-27.yml index eca17d097..a880827b5 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-27.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-27.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=config_dir\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":true,\"parameter_type\":\"string\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:05 UTC\",\"parameter\":\"config_dir\",\"id\":4,\"puppetclass_id\":2,\"override_values_count\":2,\"default_value\":\"/etc/ntpd\",\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":true,\"parameter_type\":\"string\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:30 UTC\",\"updated_at\":\"2023-07-26 08:24:36 UTC\",\"parameter\":\"config_dir\",\"id\":4,\"puppetclass_id\":2,\"override_values_count\":2,\"default_value\":\"/etc/ntpd\",\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '691' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,74 +126,17 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/4 response: body: - string: '{"description":"","override":true,"parameter_type":"string","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:05 UTC","parameter":"config_dir","id":4,"puppetclass_id":2,"override_values_count":2,"default_value":"/etc/ntpd","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[{"created_at":"2022-11-25 - 11:47:06 UTC","updated_at":"2022-11-25 11:47:08 UTC","id":1,"match":"domain=example.com","value":"/etc/ntpd/foonew","omit":false},{"created_at":"2022-11-25 - 11:47:06 UTC","updated_at":"2022-11-25 11:47:06 UTC","id":2,"match":"hostgroup=test_hostgroup","value":null,"omit":true}]}' + string: '{"description":"","override":true,"parameter_type":"string","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:30 UTC","updated_at":"2023-07-26 08:24:36 UTC","parameter":"config_dir","id":4,"puppetclass_id":2,"override_values_count":2,"default_value":"/etc/ntpd","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[{"created_at":"2023-07-26 + 08:24:38 UTC","updated_at":"2023-07-26 08:24:38 UTC","id":25,"match":"domain=example.com","value":"/etc/ntpd/foo","omit":false},{"created_at":"2023-07-26 + 08:24:38 UTC","updated_at":"2023-07-26 08:24:38 UTC","id":26,"match":"hostgroup=test_hostgroup","value":null,"omit":true}]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive - Content-Security-Policy: - - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; - img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; - style-src ''unsafe-inline'' ''self''' - Content-Type: - - application/json; charset=utf-8 - Foreman_api_version: - - '2' - Foreman_current_location: - - ; ANY - Foreman_current_organization: - - ; ANY - Foreman_version: - - 3.5.0-rc1 - Keep-Alive: - - timeout=15, max=98 - Strict-Transport-Security: - - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Frame-Options: - - sameorigin - X-Permitted-Cross-Domain-Policies: - - none - X-XSS-Protection: - - 1; mode=block - status: - code: 200 - message: OK -- request: - body: '{"override_value": {"value": "/etc/ntpd/foo"}}' - headers: - Accept: - - application/json;version=2 - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive Content-Length: - - '46' - Content-Type: - - application/json - User-Agent: - - apypie (https://github.com/Apipie/apypie) - method: PUT - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/4/override_values/1 - response: - body: - string: '{"created_at":"2022-11-25 11:47:06 UTC","updated_at":"2022-11-25 11:47:09 - UTC","id":1,"match":"domain=example.com","value":"/etc/ntpd/foo","omit":false}' - headers: - Cache-Control: - - max-age=0, private, must-revalidate - Connection: - - Keep-Alive + - '912' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -207,70 +150,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - - timeout=15, max=97 - Strict-Transport-Security: - - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Frame-Options: - - sameorigin - X-Permitted-Cross-Domain-Policies: - - none - X-XSS-Protection: - - 1; mode=block - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json;version=2 - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - User-Agent: - - apypie (https://github.com/Apipie/apypie) - method: DELETE - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/4/override_values/2 - response: - body: - string: '{"created_at":"2022-11-25 11:47:06 UTC","updated_at":"2022-11-25 11:47:06 - UTC","id":2,"match":"hostgroup=test_hostgroup","value":null,"omit":true}' - headers: - Cache-Control: - - max-age=0, private, must-revalidate - Connection: - - Keep-Alive - Content-Security-Policy: - - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; - img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; - style-src ''unsafe-inline'' ''self''' - Content-Type: - - application/json; charset=utf-8 - Foreman_api_version: - - '2' - Foreman_current_location: - - ; ANY - Foreman_current_organization: - - ; ANY - Foreman_version: - - 3.5.0-rc1 - Keep-Alive: - - timeout=15, max=96 + - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-28.yml b/tests/test_playbooks/fixtures/smart_class_parameter-28.yml index 1bbf1312b..621209c6a 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-28.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-28.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=config_dir\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":true,\"parameter_type\":\"string\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:05 UTC\",\"parameter\":\"config_dir\",\"id\":4,\"puppetclass_id\":2,\"override_values_count\":1,\"default_value\":\"/etc/ntpd\",\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":true,\"parameter_type\":\"string\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:30 UTC\",\"updated_at\":\"2023-07-26 08:24:36 UTC\",\"parameter\":\"config_dir\",\"id\":4,\"puppetclass_id\":2,\"override_values_count\":2,\"default_value\":\"/etc/ntpd\",\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '691' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,14 +126,17 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/4 response: body: - string: '{"description":"","override":true,"parameter_type":"string","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:05 UTC","parameter":"config_dir","id":4,"puppetclass_id":2,"override_values_count":1,"default_value":"/etc/ntpd","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[{"created_at":"2022-11-25 - 11:47:06 UTC","updated_at":"2022-11-25 11:47:09 UTC","id":1,"match":"domain=example.com","value":"/etc/ntpd/foo","omit":false}]}' + string: '{"description":"","override":true,"parameter_type":"string","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:30 UTC","updated_at":"2023-07-26 08:24:36 UTC","parameter":"config_dir","id":4,"puppetclass_id":2,"override_values_count":2,"default_value":"/etc/ntpd","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[{"created_at":"2023-07-26 + 08:24:38 UTC","updated_at":"2023-07-26 08:24:38 UTC","id":25,"match":"domain=example.com","value":"/etc/ntpd/foo","omit":false},{"created_at":"2023-07-26 + 08:24:38 UTC","updated_at":"2023-07-26 08:24:38 UTC","id":26,"match":"hostgroup=test_hostgroup","value":null,"omit":true}]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '912' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -147,13 +150,70 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: '{"override_value": {"value": "/etc/ntpd/foonew"}}' + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '49' + Content-Type: + - application/json + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: PUT + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/4/override_values/25 + response: + body: + string: '{"created_at":"2023-07-26 08:24:38 UTC","updated_at":"2023-07-26 08:24:40 + UTC","id":25,"match":"domain=example.com","value":"/etc/ntpd/foonew","omit":false}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '156' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=97 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-29.yml b/tests/test_playbooks/fixtures/smart_class_parameter-29.yml index 824290cc3..c2d03a763 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-29.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-29.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -65,19 +65,21 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters?search=puppetclass_name%3Dntp+and+parameter%3Dburst&per_page=4294967296 + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters?search=puppetclass_name%3Dntp+and+parameter%3Dconfig_dir&per_page=4294967296 response: body: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": - 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=burst\",\n + 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=config_dir\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":false,\"parameter_type\":\"\",\"hidden_value?\":false,\"omit\":null,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:46:52 UTC\",\"parameter\":\"burst\",\"id\":2,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"\",\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":true,\"parameter_type\":\"string\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:30 UTC\",\"updated_at\":\"2023-07-26 08:24:36 UTC\",\"parameter\":\"config_dir\",\"id\":4,\"puppetclass_id\":2,\"override_values_count\":2,\"default_value\":\"/etc/ntpd\",\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '691' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -123,76 +123,20 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/2 + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/4 response: body: - string: '{"description":"","override":false,"parameter_type":"","hidden_value?":false,"omit":null,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:46:52 UTC","parameter":"burst","id":2,"puppetclass_id":2,"override_values_count":0,"default_value":"","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"","override":true,"parameter_type":"string","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:30 UTC","updated_at":"2023-07-26 08:24:36 UTC","parameter":"config_dir","id":4,"puppetclass_id":2,"override_values_count":2,"default_value":"/etc/ntpd","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[{"created_at":"2023-07-26 + 08:24:38 UTC","updated_at":"2023-07-26 08:24:38 UTC","id":26,"match":"hostgroup=test_hostgroup","value":null,"omit":true},{"created_at":"2023-07-26 + 08:24:38 UTC","updated_at":"2023-07-26 08:24:40 UTC","id":25,"match":"domain=example.com","value":"/etc/ntpd/foonew","omit":false}]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive - Content-Security-Policy: - - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; - img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; - style-src ''unsafe-inline'' ''self''' - Content-Type: - - application/json; charset=utf-8 - Foreman_api_version: - - '2' - Foreman_current_location: - - ; ANY - Foreman_current_organization: - - ; ANY - Foreman_version: - - 3.5.0-rc1 - Keep-Alive: - - timeout=15, max=98 - Strict-Transport-Security: - - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Frame-Options: - - sameorigin - X-Permitted-Cross-Domain-Policies: - - none - X-XSS-Protection: - - 1; mode=block - status: - code: 200 - message: OK -- request: - body: '{"smart_class_parameter": {"override": true, "default_value": true, "omit": - false, "parameter_type": "boolean"}}' - headers: - Accept: - - application/json;version=2 - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive Content-Length: - - '112' - Content-Type: - - application/json - User-Agent: - - apypie (https://github.com/Apipie/apypie) - method: PUT - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/2 - response: - body: - string: '{"description":"","override":true,"parameter_type":"boolean","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:10 UTC","parameter":"burst","id":2,"puppetclass_id":2,"override_values_count":0,"default_value":true,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' - headers: - Cache-Control: - - max-age=0, private, must-revalidate - Connection: - - Keep-Alive + - '915' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -206,13 +150,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - - timeout=15, max=97 + - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-3.yml b/tests/test_playbooks/fixtures/smart_class_parameter-3.yml index e73be2226..df2adcec8 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-3.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-3.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=logfile\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"ntp log file\",\"override\":true,\"parameter_type\":\"string\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:46:55 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"\",\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"ntp log file\",\"override\":true,\"parameter_type\":\"string\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:24:10 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"\",\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '689' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,13 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/16 response: body: - string: '{"description":"ntp log file","override":true,"parameter_type":"string","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:46:55 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"ntp log file","override":true,"parameter_type":"string","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:10 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '612' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -146,13 +148,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-30.yml b/tests/test_playbooks/fixtures/smart_class_parameter-30.yml index f2abd2797..42715dbf3 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-30.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-30.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -65,19 +65,21 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters?search=puppetclass_name%3Dntp+and+parameter%3Dburst&per_page=4294967296 + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters?search=puppetclass_name%3Dntp+and+parameter%3Dconfig_dir&per_page=4294967296 response: body: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": - 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=burst\",\n + 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=config_dir\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":true,\"parameter_type\":\"boolean\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:10 UTC\",\"parameter\":\"burst\",\"id\":2,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":true,\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":true,\"parameter_type\":\"string\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:30 UTC\",\"updated_at\":\"2023-07-26 08:24:36 UTC\",\"parameter\":\"config_dir\",\"id\":4,\"puppetclass_id\":2,\"override_values_count\":2,\"default_value\":\"/etc/ntpd\",\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '691' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -123,16 +123,20 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/2 + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/4 response: body: - string: '{"description":"","override":true,"parameter_type":"boolean","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:10 UTC","parameter":"burst","id":2,"puppetclass_id":2,"override_values_count":0,"default_value":true,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"","override":true,"parameter_type":"string","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:30 UTC","updated_at":"2023-07-26 08:24:36 UTC","parameter":"config_dir","id":4,"puppetclass_id":2,"override_values_count":2,"default_value":"/etc/ntpd","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[{"created_at":"2023-07-26 + 08:24:38 UTC","updated_at":"2023-07-26 08:24:38 UTC","id":26,"match":"hostgroup=test_hostgroup","value":null,"omit":true},{"created_at":"2023-07-26 + 08:24:38 UTC","updated_at":"2023-07-26 08:24:40 UTC","id":25,"match":"domain=example.com","value":"/etc/ntpd/foonew","omit":false}]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '915' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -146,13 +150,127 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: '{"override_value": {"value": "/etc/ntpd/foo"}}' + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '46' + Content-Type: + - application/json + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: PUT + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/4/override_values/25 + response: + body: + string: '{"created_at":"2023-07-26 08:24:38 UTC","updated_at":"2023-07-26 08:24:42 + UTC","id":25,"match":"domain=example.com","value":"/etc/ntpd/foo","omit":false}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '153' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=97 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: DELETE + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/4/override_values/26 + response: + body: + string: '{"created_at":"2023-07-26 08:24:38 UTC","updated_at":"2023-07-26 08:24:38 + UTC","id":26,"match":"hostgroup=test_hostgroup","value":null,"omit":true}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '147' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=96 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-31.yml b/tests/test_playbooks/fixtures/smart_class_parameter-31.yml index f2abd2797..41a707bff 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-31.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-31.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -65,19 +65,21 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters?search=puppetclass_name%3Dntp+and+parameter%3Dburst&per_page=4294967296 + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters?search=puppetclass_name%3Dntp+and+parameter%3Dconfig_dir&per_page=4294967296 response: body: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": - 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=burst\",\n + 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=config_dir\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":true,\"parameter_type\":\"boolean\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:10 UTC\",\"parameter\":\"burst\",\"id\":2,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":true,\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":true,\"parameter_type\":\"string\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:30 UTC\",\"updated_at\":\"2023-07-26 08:24:36 UTC\",\"parameter\":\"config_dir\",\"id\":4,\"puppetclass_id\":2,\"override_values_count\":1,\"default_value\":\"/etc/ntpd\",\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '691' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -123,16 +123,19 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/2 + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/4 response: body: - string: '{"description":"","override":true,"parameter_type":"boolean","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:10 UTC","parameter":"burst","id":2,"puppetclass_id":2,"override_values_count":0,"default_value":true,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"","override":true,"parameter_type":"string","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:30 UTC","updated_at":"2023-07-26 08:24:36 UTC","parameter":"config_dir","id":4,"puppetclass_id":2,"override_values_count":1,"default_value":"/etc/ntpd","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[{"created_at":"2023-07-26 + 08:24:38 UTC","updated_at":"2023-07-26 08:24:42 UTC","id":25,"match":"domain=example.com","value":"/etc/ntpd/foo","omit":false}]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '764' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -146,13 +149,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-32.yml b/tests/test_playbooks/fixtures/smart_class_parameter-32.yml index 1178c089f..2651557c0 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-32.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-32.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=burst\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":true,\"parameter_type\":\"boolean\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:10 UTC\",\"parameter\":\"burst\",\"id\":2,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":true,\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":false,\"parameter_type\":\"\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:30 UTC\",\"updated_at\":\"2023-07-26 08:24:06 UTC\",\"parameter\":\"burst\",\"id\":2,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"\",\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '667' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,13 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/2 response: body: - string: '{"description":"","override":true,"parameter_type":"boolean","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:10 UTC","parameter":"burst","id":2,"puppetclass_id":2,"override_values_count":0,"default_value":true,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"","override":false,"parameter_type":"","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:30 UTC","updated_at":"2023-07-26 08:24:06 UTC","parameter":"burst","id":2,"puppetclass_id":2,"override_values_count":0,"default_value":"","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '592' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -146,13 +148,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -167,7 +167,8 @@ interactions: code: 200 message: OK - request: - body: '{"smart_class_parameter": {"default_value": false}}' + body: '{"smart_class_parameter": {"override": true, "default_value": true, "parameter_type": + "boolean"}}' headers: Accept: - application/json;version=2 @@ -176,7 +177,7 @@ interactions: Connection: - keep-alive Content-Length: - - '51' + - '97' Content-Type: - application/json User-Agent: @@ -185,13 +186,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/2 response: body: - string: '{"description":"","override":true,"parameter_type":"boolean","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:11 UTC","parameter":"burst","id":2,"puppetclass_id":2,"override_values_count":0,"default_value":false,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"","override":true,"parameter_type":"boolean","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:30 UTC","updated_at":"2023-07-26 08:24:44 UTC","parameter":"burst","id":2,"puppetclass_id":2,"override_values_count":0,"default_value":true,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '600' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -205,13 +208,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-33.yml b/tests/test_playbooks/fixtures/smart_class_parameter-33.yml index 1e62f7a2b..0349aeba6 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-33.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-33.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=burst\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":true,\"parameter_type\":\"boolean\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:11 UTC\",\"parameter\":\"burst\",\"id\":2,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":false,\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":true,\"parameter_type\":\"boolean\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:30 UTC\",\"updated_at\":\"2023-07-26 08:24:44 UTC\",\"parameter\":\"burst\",\"id\":2,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":true,\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '675' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,13 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/2 response: body: - string: '{"description":"","override":true,"parameter_type":"boolean","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:11 UTC","parameter":"burst","id":2,"puppetclass_id":2,"override_values_count":0,"default_value":false,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"","override":true,"parameter_type":"boolean","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:30 UTC","updated_at":"2023-07-26 08:24:44 UTC","parameter":"burst","id":2,"puppetclass_id":2,"override_values_count":0,"default_value":true,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '600' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -146,13 +148,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-34.yml b/tests/test_playbooks/fixtures/smart_class_parameter-34.yml index 45ba97296..0349aeba6 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-34.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-34.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=burst\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":true,\"parameter_type\":\"boolean\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:11 UTC\",\"parameter\":\"burst\",\"id\":2,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":false,\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":true,\"parameter_type\":\"boolean\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:30 UTC\",\"updated_at\":\"2023-07-26 08:24:44 UTC\",\"parameter\":\"burst\",\"id\":2,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":true,\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '675' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,13 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/2 response: body: - string: '{"description":"","override":true,"parameter_type":"boolean","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:11 UTC","parameter":"burst","id":2,"puppetclass_id":2,"override_values_count":0,"default_value":false,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"","override":true,"parameter_type":"boolean","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:30 UTC","updated_at":"2023-07-26 08:24:44 UTC","parameter":"burst","id":2,"puppetclass_id":2,"override_values_count":0,"default_value":true,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '600' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -146,13 +148,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -166,122 +166,4 @@ interactions: status: code: 200 message: OK -- request: - body: '{"override_value": {"match": "domain=example.com", "value": true}}' - headers: - Accept: - - application/json;version=2 - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '66' - Content-Type: - - application/json - User-Agent: - - apypie (https://github.com/Apipie/apypie) - method: POST - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/2/override_values - response: - body: - string: '{"created_at":"2022-11-25 11:47:13 UTC","updated_at":"2022-11-25 11:47:13 - UTC","id":3,"match":"domain=example.com","value":true,"omit":false}' - headers: - Cache-Control: - - max-age=0, private, must-revalidate - Connection: - - Keep-Alive - Content-Security-Policy: - - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; - img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; - style-src ''unsafe-inline'' ''self''' - Content-Type: - - application/json; charset=utf-8 - Foreman_api_version: - - '2' - Foreman_current_location: - - ; ANY - Foreman_current_organization: - - ; ANY - Foreman_version: - - 3.5.0-rc1 - Keep-Alive: - - timeout=15, max=97 - Strict-Transport-Security: - - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Frame-Options: - - sameorigin - X-Permitted-Cross-Domain-Policies: - - none - X-XSS-Protection: - - 1; mode=block - status: - code: 201 - message: Created -- request: - body: '{"override_value": {"match": "hostgroup=test_hostgroup", "omit": true}}' - headers: - Accept: - - application/json;version=2 - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '71' - Content-Type: - - application/json - User-Agent: - - apypie (https://github.com/Apipie/apypie) - method: POST - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/2/override_values - response: - body: - string: '{"created_at":"2022-11-25 11:47:13 UTC","updated_at":"2022-11-25 11:47:13 - UTC","id":4,"match":"hostgroup=test_hostgroup","value":null,"omit":true}' - headers: - Cache-Control: - - max-age=0, private, must-revalidate - Connection: - - Keep-Alive - Content-Security-Policy: - - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; - img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; - style-src ''unsafe-inline'' ''self''' - Content-Type: - - application/json; charset=utf-8 - Foreman_api_version: - - '2' - Foreman_current_location: - - ; ANY - Foreman_current_organization: - - ; ANY - Foreman_version: - - 3.5.0-rc1 - Keep-Alive: - - timeout=15, max=96 - Strict-Transport-Security: - - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Frame-Options: - - sameorigin - X-Permitted-Cross-Domain-Policies: - - none - X-XSS-Protection: - - 1; mode=block - status: - code: 201 - message: Created version: 1 diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-35.yml b/tests/test_playbooks/fixtures/smart_class_parameter-35.yml index 03dd20c5c..05a7ca227 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-35.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-35.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=burst\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":true,\"parameter_type\":\"boolean\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:11 UTC\",\"parameter\":\"burst\",\"id\":2,\"puppetclass_id\":2,\"override_values_count\":2,\"default_value\":false,\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":true,\"parameter_type\":\"boolean\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:30 UTC\",\"updated_at\":\"2023-07-26 08:24:44 UTC\",\"parameter\":\"burst\",\"id\":2,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":true,\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '675' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,15 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/2 response: body: - string: '{"description":"","override":true,"parameter_type":"boolean","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:11 UTC","parameter":"burst","id":2,"puppetclass_id":2,"override_values_count":2,"default_value":false,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[{"created_at":"2022-11-25 - 11:47:13 UTC","updated_at":"2022-11-25 11:47:13 UTC","id":3,"match":"domain=example.com","value":true,"omit":false},{"created_at":"2022-11-25 - 11:47:13 UTC","updated_at":"2022-11-25 11:47:13 UTC","id":4,"match":"hostgroup=test_hostgroup","value":null,"omit":true}]}' + string: '{"description":"","override":true,"parameter_type":"boolean","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:30 UTC","updated_at":"2023-07-26 08:24:44 UTC","parameter":"burst","id":2,"puppetclass_id":2,"override_values_count":0,"default_value":true,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '600' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -148,13 +148,70 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: '{"smart_class_parameter": {"default_value": false}}' + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '51' + Content-Type: + - application/json + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: PUT + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/2 + response: + body: + string: '{"description":"","override":true,"parameter_type":"boolean","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:30 UTC","updated_at":"2023-07-26 08:24:46 UTC","parameter":"burst","id":2,"puppetclass_id":2,"override_values_count":0,"default_value":false,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '601' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=97 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-36.yml b/tests/test_playbooks/fixtures/smart_class_parameter-36.yml index 40588e57c..c0d88dcf7 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-36.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-36.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=burst\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":true,\"parameter_type\":\"boolean\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:11 UTC\",\"parameter\":\"burst\",\"id\":2,\"puppetclass_id\":2,\"override_values_count\":2,\"default_value\":false,\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":true,\"parameter_type\":\"boolean\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:30 UTC\",\"updated_at\":\"2023-07-26 08:24:46 UTC\",\"parameter\":\"burst\",\"id\":2,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":false,\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '676' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,72 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/2 response: body: - string: '{"description":"","override":true,"parameter_type":"boolean","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:11 UTC","parameter":"burst","id":2,"puppetclass_id":2,"override_values_count":2,"default_value":false,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[{"created_at":"2022-11-25 - 11:47:13 UTC","updated_at":"2022-11-25 11:47:13 UTC","id":3,"match":"domain=example.com","value":true,"omit":false},{"created_at":"2022-11-25 - 11:47:13 UTC","updated_at":"2022-11-25 11:47:13 UTC","id":4,"match":"hostgroup=test_hostgroup","value":null,"omit":true}]}' + string: '{"description":"","override":true,"parameter_type":"boolean","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:30 UTC","updated_at":"2023-07-26 08:24:46 UTC","parameter":"burst","id":2,"puppetclass_id":2,"override_values_count":0,"default_value":false,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive - Content-Security-Policy: - - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; - img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; - style-src ''unsafe-inline'' ''self''' - Content-Type: - - application/json; charset=utf-8 - Foreman_api_version: - - '2' - Foreman_current_location: - - ; ANY - Foreman_current_organization: - - ; ANY - Foreman_version: - - 3.5.0-rc1 - Keep-Alive: - - timeout=15, max=98 - Strict-Transport-Security: - - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Frame-Options: - - sameorigin - X-Permitted-Cross-Domain-Policies: - - none - X-XSS-Protection: - - 1; mode=block - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json;version=2 - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive Content-Length: - - '0' - User-Agent: - - apypie (https://github.com/Apipie/apypie) - method: DELETE - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/2/override_values/4 - response: - body: - string: '{"created_at":"2022-11-25 11:47:13 UTC","updated_at":"2022-11-25 11:47:13 - UTC","id":4,"match":"hostgroup=test_hostgroup","value":null,"omit":true}' - headers: - Cache-Control: - - max-age=0, private, must-revalidate - Connection: - - Keep-Alive + - '601' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -205,13 +148,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - - timeout=15, max=97 + - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-37.yml b/tests/test_playbooks/fixtures/smart_class_parameter-37.yml index 3defd628d..91df750ab 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-37.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-37.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=burst\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":true,\"parameter_type\":\"boolean\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:11 UTC\",\"parameter\":\"burst\",\"id\":2,\"puppetclass_id\":2,\"override_values_count\":1,\"default_value\":false,\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":true,\"parameter_type\":\"boolean\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:30 UTC\",\"updated_at\":\"2023-07-26 08:24:46 UTC\",\"parameter\":\"burst\",\"id\":2,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":false,\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '676' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,14 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/2 response: body: - string: '{"description":"","override":true,"parameter_type":"boolean","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:11 UTC","parameter":"burst","id":2,"puppetclass_id":2,"override_values_count":1,"default_value":false,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[{"created_at":"2022-11-25 - 11:47:13 UTC","updated_at":"2022-11-25 11:47:13 UTC","id":3,"match":"domain=example.com","value":true,"omit":false}]}' + string: '{"description":"","override":true,"parameter_type":"boolean","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:30 UTC","updated_at":"2023-07-26 08:24:46 UTC","parameter":"burst","id":2,"puppetclass_id":2,"override_values_count":0,"default_value":false,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '601' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -147,13 +148,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -167,4 +166,122 @@ interactions: status: code: 200 message: OK +- request: + body: '{"override_value": {"match": "domain=example.com", "value": true}}' + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '66' + Content-Type: + - application/json + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: POST + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/2/override_values + response: + body: + string: '{"created_at":"2023-07-26 08:24:48 UTC","updated_at":"2023-07-26 08:24:48 + UTC","id":27,"match":"domain=example.com","value":true,"omit":false}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '142' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=97 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 201 + message: Created +- request: + body: '{"override_value": {"match": "hostgroup=test_hostgroup", "omit": true}}' + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '71' + Content-Type: + - application/json + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: POST + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/2/override_values + response: + body: + string: '{"created_at":"2023-07-26 08:24:48 UTC","updated_at":"2023-07-26 08:24:48 + UTC","id":28,"match":"hostgroup=test_hostgroup","value":null,"omit":true}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '147' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=96 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 201 + message: Created version: 1 diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-38.yml b/tests/test_playbooks/fixtures/smart_class_parameter-38.yml index c4b7277d0..f843e3d1b 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-38.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-38.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -65,19 +65,21 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters?search=puppetclass_name%3Dntp+and+parameter%3Dstepout&per_page=4294967296 + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters?search=puppetclass_name%3Dntp+and+parameter%3Dburst&per_page=4294967296 response: body: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": - 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=stepout\",\n + 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=burst\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":false,\"parameter_type\":\"\",\"hidden_value?\":false,\"omit\":null,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:46:53 UTC\",\"parameter\":\"stepout\",\"id\":52,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"\",\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":true,\"parameter_type\":\"boolean\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:30 UTC\",\"updated_at\":\"2023-07-26 08:24:46 UTC\",\"parameter\":\"burst\",\"id\":2,\"puppetclass_id\":2,\"override_values_count\":2,\"default_value\":false,\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '676' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -123,76 +123,20 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/52 + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/2 response: body: - string: '{"description":"","override":false,"parameter_type":"","hidden_value?":false,"omit":null,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:46:53 UTC","parameter":"stepout","id":52,"puppetclass_id":2,"override_values_count":0,"default_value":"","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"","override":true,"parameter_type":"boolean","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:30 UTC","updated_at":"2023-07-26 08:24:46 UTC","parameter":"burst","id":2,"puppetclass_id":2,"override_values_count":2,"default_value":false,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[{"created_at":"2023-07-26 + 08:24:48 UTC","updated_at":"2023-07-26 08:24:48 UTC","id":27,"match":"domain=example.com","value":true,"omit":false},{"created_at":"2023-07-26 + 08:24:48 UTC","updated_at":"2023-07-26 08:24:48 UTC","id":28,"match":"hostgroup=test_hostgroup","value":null,"omit":true}]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive - Content-Security-Policy: - - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; - img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; - style-src ''unsafe-inline'' ''self''' - Content-Type: - - application/json; charset=utf-8 - Foreman_api_version: - - '2' - Foreman_current_location: - - ; ANY - Foreman_current_organization: - - ; ANY - Foreman_version: - - 3.5.0-rc1 - Keep-Alive: - - timeout=15, max=98 - Strict-Transport-Security: - - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Frame-Options: - - sameorigin - X-Permitted-Cross-Domain-Policies: - - none - X-XSS-Protection: - - 1; mode=block - status: - code: 200 - message: OK -- request: - body: '{"smart_class_parameter": {"override": true, "default_value": "3", "omit": - false, "parameter_type": "integer"}}' - headers: - Accept: - - application/json;version=2 - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive Content-Length: - - '111' - Content-Type: - - application/json - User-Agent: - - apypie (https://github.com/Apipie/apypie) - method: PUT - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/52 - response: - body: - string: '{"description":"","override":true,"parameter_type":"integer","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:15 UTC","parameter":"stepout","id":52,"puppetclass_id":2,"override_values_count":0,"default_value":3,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' - headers: - Cache-Control: - - max-age=0, private, must-revalidate - Connection: - - Keep-Alive + - '891' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -206,13 +150,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - - timeout=15, max=97 + - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-39.yml b/tests/test_playbooks/fixtures/smart_class_parameter-39.yml index bba370eeb..9d310a665 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-39.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-39.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -65,19 +65,21 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters?search=puppetclass_name%3Dntp+and+parameter%3Dstepout&per_page=4294967296 + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters?search=puppetclass_name%3Dntp+and+parameter%3Dburst&per_page=4294967296 response: body: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": - 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=stepout\",\n + 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=burst\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":true,\"parameter_type\":\"integer\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:15 UTC\",\"parameter\":\"stepout\",\"id\":52,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":3,\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":true,\"parameter_type\":\"boolean\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:30 UTC\",\"updated_at\":\"2023-07-26 08:24:46 UTC\",\"parameter\":\"burst\",\"id\":2,\"puppetclass_id\":2,\"override_values_count\":2,\"default_value\":false,\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '676' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -123,16 +123,20 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/52 + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/2 response: body: - string: '{"description":"","override":true,"parameter_type":"integer","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:15 UTC","parameter":"stepout","id":52,"puppetclass_id":2,"override_values_count":0,"default_value":3,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"","override":true,"parameter_type":"boolean","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:30 UTC","updated_at":"2023-07-26 08:24:46 UTC","parameter":"burst","id":2,"puppetclass_id":2,"override_values_count":2,"default_value":false,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[{"created_at":"2023-07-26 + 08:24:48 UTC","updated_at":"2023-07-26 08:24:48 UTC","id":27,"match":"domain=example.com","value":true,"omit":false},{"created_at":"2023-07-26 + 08:24:48 UTC","updated_at":"2023-07-26 08:24:48 UTC","id":28,"match":"hostgroup=test_hostgroup","value":null,"omit":true}]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '891' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -146,13 +150,68 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: DELETE + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/2/override_values/28 + response: + body: + string: '{"created_at":"2023-07-26 08:24:48 UTC","updated_at":"2023-07-26 08:24:48 + UTC","id":28,"match":"hostgroup=test_hostgroup","value":null,"omit":true}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '147' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=97 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-4.yml b/tests/test_playbooks/fixtures/smart_class_parameter-4.yml index e73be2226..df2adcec8 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-4.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-4.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=logfile\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"ntp log file\",\"override\":true,\"parameter_type\":\"string\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:46:55 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"\",\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"ntp log file\",\"override\":true,\"parameter_type\":\"string\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:24:10 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"\",\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '689' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,13 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/16 response: body: - string: '{"description":"ntp log file","override":true,"parameter_type":"string","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:46:55 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"ntp log file","override":true,"parameter_type":"string","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:10 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '612' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -146,13 +148,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-40.yml b/tests/test_playbooks/fixtures/smart_class_parameter-40.yml index bba370eeb..c318827e0 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-40.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-40.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -65,19 +65,21 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters?search=puppetclass_name%3Dntp+and+parameter%3Dstepout&per_page=4294967296 + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters?search=puppetclass_name%3Dntp+and+parameter%3Dburst&per_page=4294967296 response: body: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": - 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=stepout\",\n + 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=burst\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":true,\"parameter_type\":\"integer\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:15 UTC\",\"parameter\":\"stepout\",\"id\":52,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":3,\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":true,\"parameter_type\":\"boolean\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:30 UTC\",\"updated_at\":\"2023-07-26 08:24:46 UTC\",\"parameter\":\"burst\",\"id\":2,\"puppetclass_id\":2,\"override_values_count\":1,\"default_value\":false,\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '676' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -123,16 +123,19 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/52 + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/2 response: body: - string: '{"description":"","override":true,"parameter_type":"integer","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:15 UTC","parameter":"stepout","id":52,"puppetclass_id":2,"override_values_count":0,"default_value":3,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"","override":true,"parameter_type":"boolean","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:30 UTC","updated_at":"2023-07-26 08:24:46 UTC","parameter":"burst","id":2,"puppetclass_id":2,"override_values_count":1,"default_value":false,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[{"created_at":"2023-07-26 + 08:24:48 UTC","updated_at":"2023-07-26 08:24:48 UTC","id":27,"match":"domain=example.com","value":true,"omit":false}]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '743' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -146,13 +149,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-41.yml b/tests/test_playbooks/fixtures/smart_class_parameter-41.yml index a190165ea..241dd8f17 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-41.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-41.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=stepout\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":true,\"parameter_type\":\"integer\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:15 UTC\",\"parameter\":\"stepout\",\"id\":52,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":3,\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":false,\"parameter_type\":\"\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:24:07 UTC\",\"parameter\":\"stepout\",\"id\":52,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"\",\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '672' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,13 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/52 response: body: - string: '{"description":"","override":true,"parameter_type":"integer","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:15 UTC","parameter":"stepout","id":52,"puppetclass_id":2,"override_values_count":0,"default_value":3,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"","override":false,"parameter_type":"","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:07 UTC","parameter":"stepout","id":52,"puppetclass_id":2,"override_values_count":0,"default_value":"","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '595' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -146,13 +148,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -167,7 +167,8 @@ interactions: code: 200 message: OK - request: - body: '{"smart_class_parameter": {"default_value": "5"}}' + body: '{"smart_class_parameter": {"override": true, "default_value": "3", "parameter_type": + "integer"}}' headers: Accept: - application/json;version=2 @@ -176,7 +177,7 @@ interactions: Connection: - keep-alive Content-Length: - - '49' + - '96' Content-Type: - application/json User-Agent: @@ -185,13 +186,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/52 response: body: - string: '{"description":"","override":true,"parameter_type":"integer","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:17 UTC","parameter":"stepout","id":52,"puppetclass_id":2,"override_values_count":0,"default_value":5,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"","override":true,"parameter_type":"integer","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:52 UTC","parameter":"stepout","id":52,"puppetclass_id":2,"override_values_count":0,"default_value":3,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '600' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -205,13 +208,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-42.yml b/tests/test_playbooks/fixtures/smart_class_parameter-42.yml index 6b2b54fd4..26a3d7a38 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-42.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-42.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=stepout\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":true,\"parameter_type\":\"integer\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:17 UTC\",\"parameter\":\"stepout\",\"id\":52,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":5,\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":true,\"parameter_type\":\"integer\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:24:52 UTC\",\"parameter\":\"stepout\",\"id\":52,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":3,\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '677' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,13 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/52 response: body: - string: '{"description":"","override":true,"parameter_type":"integer","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:17 UTC","parameter":"stepout","id":52,"puppetclass_id":2,"override_values_count":0,"default_value":5,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"","override":true,"parameter_type":"integer","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:52 UTC","parameter":"stepout","id":52,"puppetclass_id":2,"override_values_count":0,"default_value":3,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '600' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -146,13 +148,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-43.yml b/tests/test_playbooks/fixtures/smart_class_parameter-43.yml index e7910d792..26a3d7a38 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-43.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-43.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=stepout\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":true,\"parameter_type\":\"integer\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:17 UTC\",\"parameter\":\"stepout\",\"id\":52,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":5,\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":true,\"parameter_type\":\"integer\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:24:52 UTC\",\"parameter\":\"stepout\",\"id\":52,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":3,\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '677' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,13 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/52 response: body: - string: '{"description":"","override":true,"parameter_type":"integer","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:17 UTC","parameter":"stepout","id":52,"puppetclass_id":2,"override_values_count":0,"default_value":5,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"","override":true,"parameter_type":"integer","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:52 UTC","parameter":"stepout","id":52,"puppetclass_id":2,"override_values_count":0,"default_value":3,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '600' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -146,13 +148,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -166,122 +166,4 @@ interactions: status: code: 200 message: OK -- request: - body: '{"override_value": {"match": "domain=example.com", "value": "42"}}' - headers: - Accept: - - application/json;version=2 - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '66' - Content-Type: - - application/json - User-Agent: - - apypie (https://github.com/Apipie/apypie) - method: POST - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/52/override_values - response: - body: - string: '{"created_at":"2022-11-25 11:47:18 UTC","updated_at":"2022-11-25 11:47:18 - UTC","id":5,"match":"domain=example.com","value":42,"omit":false}' - headers: - Cache-Control: - - max-age=0, private, must-revalidate - Connection: - - Keep-Alive - Content-Security-Policy: - - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; - img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; - style-src ''unsafe-inline'' ''self''' - Content-Type: - - application/json; charset=utf-8 - Foreman_api_version: - - '2' - Foreman_current_location: - - ; ANY - Foreman_current_organization: - - ; ANY - Foreman_version: - - 3.5.0-rc1 - Keep-Alive: - - timeout=15, max=97 - Strict-Transport-Security: - - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Frame-Options: - - sameorigin - X-Permitted-Cross-Domain-Policies: - - none - X-XSS-Protection: - - 1; mode=block - status: - code: 201 - message: Created -- request: - body: '{"override_value": {"match": "hostgroup=test_hostgroup", "omit": true}}' - headers: - Accept: - - application/json;version=2 - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '71' - Content-Type: - - application/json - User-Agent: - - apypie (https://github.com/Apipie/apypie) - method: POST - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/52/override_values - response: - body: - string: '{"created_at":"2022-11-25 11:47:18 UTC","updated_at":"2022-11-25 11:47:18 - UTC","id":6,"match":"hostgroup=test_hostgroup","value":null,"omit":true}' - headers: - Cache-Control: - - max-age=0, private, must-revalidate - Connection: - - Keep-Alive - Content-Security-Policy: - - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; - img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; - style-src ''unsafe-inline'' ''self''' - Content-Type: - - application/json; charset=utf-8 - Foreman_api_version: - - '2' - Foreman_current_location: - - ; ANY - Foreman_current_organization: - - ; ANY - Foreman_version: - - 3.5.0-rc1 - Keep-Alive: - - timeout=15, max=96 - Strict-Transport-Security: - - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Frame-Options: - - sameorigin - X-Permitted-Cross-Domain-Policies: - - none - X-XSS-Protection: - - 1; mode=block - status: - code: 201 - message: Created version: 1 diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-44.yml b/tests/test_playbooks/fixtures/smart_class_parameter-44.yml index 77e51546d..6a2d65fcf 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-44.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-44.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=stepout\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":true,\"parameter_type\":\"integer\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:17 UTC\",\"parameter\":\"stepout\",\"id\":52,\"puppetclass_id\":2,\"override_values_count\":2,\"default_value\":5,\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":true,\"parameter_type\":\"integer\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:24:52 UTC\",\"parameter\":\"stepout\",\"id\":52,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":3,\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '677' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,15 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/52 response: body: - string: '{"description":"","override":true,"parameter_type":"integer","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:17 UTC","parameter":"stepout","id":52,"puppetclass_id":2,"override_values_count":2,"default_value":5,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[{"created_at":"2022-11-25 - 11:47:18 UTC","updated_at":"2022-11-25 11:47:18 UTC","id":5,"match":"domain=example.com","value":42,"omit":false},{"created_at":"2022-11-25 - 11:47:18 UTC","updated_at":"2022-11-25 11:47:18 UTC","id":6,"match":"hostgroup=test_hostgroup","value":null,"omit":true}]}' + string: '{"description":"","override":true,"parameter_type":"integer","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:52 UTC","parameter":"stepout","id":52,"puppetclass_id":2,"override_values_count":0,"default_value":3,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '600' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -148,13 +148,70 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: '{"smart_class_parameter": {"default_value": "5"}}' + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '49' + Content-Type: + - application/json + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: PUT + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/52 + response: + body: + string: '{"description":"","override":true,"parameter_type":"integer","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:54 UTC","parameter":"stepout","id":52,"puppetclass_id":2,"override_values_count":0,"default_value":5,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '600' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=97 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-45.yml b/tests/test_playbooks/fixtures/smart_class_parameter-45.yml index ac052fa6d..73d0751b4 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-45.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-45.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=stepout\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":true,\"parameter_type\":\"integer\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:17 UTC\",\"parameter\":\"stepout\",\"id\":52,\"puppetclass_id\":2,\"override_values_count\":2,\"default_value\":5,\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":true,\"parameter_type\":\"integer\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:24:54 UTC\",\"parameter\":\"stepout\",\"id\":52,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":5,\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '677' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,72 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/52 response: body: - string: '{"description":"","override":true,"parameter_type":"integer","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:17 UTC","parameter":"stepout","id":52,"puppetclass_id":2,"override_values_count":2,"default_value":5,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[{"created_at":"2022-11-25 - 11:47:18 UTC","updated_at":"2022-11-25 11:47:18 UTC","id":5,"match":"domain=example.com","value":42,"omit":false},{"created_at":"2022-11-25 - 11:47:18 UTC","updated_at":"2022-11-25 11:47:18 UTC","id":6,"match":"hostgroup=test_hostgroup","value":null,"omit":true}]}' + string: '{"description":"","override":true,"parameter_type":"integer","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:54 UTC","parameter":"stepout","id":52,"puppetclass_id":2,"override_values_count":0,"default_value":5,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive - Content-Security-Policy: - - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; - img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; - style-src ''unsafe-inline'' ''self''' - Content-Type: - - application/json; charset=utf-8 - Foreman_api_version: - - '2' - Foreman_current_location: - - ; ANY - Foreman_current_organization: - - ; ANY - Foreman_version: - - 3.5.0-rc1 - Keep-Alive: - - timeout=15, max=98 - Strict-Transport-Security: - - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Frame-Options: - - sameorigin - X-Permitted-Cross-Domain-Policies: - - none - X-XSS-Protection: - - 1; mode=block - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json;version=2 - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive Content-Length: - - '0' - User-Agent: - - apypie (https://github.com/Apipie/apypie) - method: DELETE - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/52/override_values/6 - response: - body: - string: '{"created_at":"2022-11-25 11:47:18 UTC","updated_at":"2022-11-25 11:47:18 - UTC","id":6,"match":"hostgroup=test_hostgroup","value":null,"omit":true}' - headers: - Cache-Control: - - max-age=0, private, must-revalidate - Connection: - - Keep-Alive + - '600' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -205,13 +148,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - - timeout=15, max=97 + - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-46.yml b/tests/test_playbooks/fixtures/smart_class_parameter-46.yml index 70fa6c343..65d12dc13 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-46.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-46.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=stepout\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":true,\"parameter_type\":\"integer\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:17 UTC\",\"parameter\":\"stepout\",\"id\":52,\"puppetclass_id\":2,\"override_values_count\":1,\"default_value\":5,\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":true,\"parameter_type\":\"integer\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:24:54 UTC\",\"parameter\":\"stepout\",\"id\":52,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":5,\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '677' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,14 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/52 response: body: - string: '{"description":"","override":true,"parameter_type":"integer","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:17 UTC","parameter":"stepout","id":52,"puppetclass_id":2,"override_values_count":1,"default_value":5,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[{"created_at":"2022-11-25 - 11:47:18 UTC","updated_at":"2022-11-25 11:47:18 UTC","id":5,"match":"domain=example.com","value":42,"omit":false}]}' + string: '{"description":"","override":true,"parameter_type":"integer","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:54 UTC","parameter":"stepout","id":52,"puppetclass_id":2,"override_values_count":0,"default_value":5,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '600' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -147,13 +148,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -167,4 +166,122 @@ interactions: status: code: 200 message: OK +- request: + body: '{"override_value": {"match": "domain=example.com", "value": "42"}}' + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '66' + Content-Type: + - application/json + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: POST + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/52/override_values + response: + body: + string: '{"created_at":"2023-07-26 08:24:56 UTC","updated_at":"2023-07-26 08:24:56 + UTC","id":29,"match":"domain=example.com","value":42,"omit":false}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '140' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=97 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 201 + message: Created +- request: + body: '{"override_value": {"match": "hostgroup=test_hostgroup", "omit": true}}' + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '71' + Content-Type: + - application/json + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: POST + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/52/override_values + response: + body: + string: '{"created_at":"2023-07-26 08:24:56 UTC","updated_at":"2023-07-26 08:24:56 + UTC","id":30,"match":"hostgroup=test_hostgroup","value":null,"omit":true}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '147' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=96 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 201 + message: Created version: 1 diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-47.yml b/tests/test_playbooks/fixtures/smart_class_parameter-47.yml index b3d370e1d..e156a88c5 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-47.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-47.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -65,19 +65,21 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters?search=puppetclass_name%3Dntp+and+parameter%3Dservers&per_page=4294967296 + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters?search=puppetclass_name%3Dntp+and+parameter%3Dstepout&per_page=4294967296 response: body: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": - 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=servers\",\n + 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=stepout\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":false,\"parameter_type\":\"\",\"hidden_value?\":false,\"omit\":null,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:46:52 UTC\",\"parameter\":\"servers\",\"id\":41,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"\",\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":true,\"parameter_type\":\"integer\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:24:54 UTC\",\"parameter\":\"stepout\",\"id\":52,\"puppetclass_id\":2,\"override_values_count\":2,\"default_value\":5,\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '677' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -123,77 +123,20 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/41 + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/52 response: body: - string: '{"description":"","override":false,"parameter_type":"","hidden_value?":false,"omit":null,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:46:52 UTC","parameter":"servers","id":41,"puppetclass_id":2,"override_values_count":0,"default_value":"","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"","override":true,"parameter_type":"integer","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:54 UTC","parameter":"stepout","id":52,"puppetclass_id":2,"override_values_count":2,"default_value":5,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[{"created_at":"2023-07-26 + 08:24:56 UTC","updated_at":"2023-07-26 08:24:56 UTC","id":29,"match":"domain=example.com","value":42,"omit":false},{"created_at":"2023-07-26 + 08:24:56 UTC","updated_at":"2023-07-26 08:24:56 UTC","id":30,"match":"hostgroup=test_hostgroup","value":null,"omit":true}]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive - Content-Security-Policy: - - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; - img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; - style-src ''unsafe-inline'' ''self''' - Content-Type: - - application/json; charset=utf-8 - Foreman_api_version: - - '2' - Foreman_current_location: - - ; ANY - Foreman_current_organization: - - ; ANY - Foreman_version: - - 3.5.0-rc1 - Keep-Alive: - - timeout=15, max=98 - Strict-Transport-Security: - - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Frame-Options: - - sameorigin - X-Permitted-Cross-Domain-Policies: - - none - X-XSS-Protection: - - 1; mode=block - status: - code: 200 - message: OK -- request: - body: '{"smart_class_parameter": {"override": true, "default_value": "[\"foo.ntp.org\", - \"bar.ntp.org\", \"bar.ntp.org\"]", "omit": false, "parameter_type": "array", - "merge_overrides": true, "merge_default": true, "avoid_duplicates": true}}' - headers: - Accept: - - application/json;version=2 - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive Content-Length: - - '233' - Content-Type: - - application/json - User-Agent: - - apypie (https://github.com/Apipie/apypie) - method: PUT - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/41 - response: - body: - string: '{"description":"","override":true,"parameter_type":"array","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":true,"merge_default":true,"avoid_duplicates":true,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:20 UTC","parameter":"servers","id":41,"puppetclass_id":2,"override_values_count":0,"default_value":["foo.ntp.org","bar.ntp.org","bar.ntp.org"],"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' - headers: - Cache-Control: - - max-age=0, private, must-revalidate - Connection: - - Keep-Alive + - '888' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -207,13 +150,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - - timeout=15, max=97 + - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-48.yml b/tests/test_playbooks/fixtures/smart_class_parameter-48.yml index 583ee4448..635c32bd9 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-48.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-48.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -65,19 +65,21 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters?search=puppetclass_name%3Dntp+and+parameter%3Dservers&per_page=4294967296 + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters?search=puppetclass_name%3Dntp+and+parameter%3Dstepout&per_page=4294967296 response: body: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": - 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=servers\",\n + 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=stepout\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":true,\"parameter_type\":\"array\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":true,\"merge_default\":true,\"avoid_duplicates\":true,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:20 UTC\",\"parameter\":\"servers\",\"id\":41,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":[\"foo.ntp.org\",\"bar.ntp.org\",\"bar.ntp.org\"],\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":true,\"parameter_type\":\"integer\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:24:54 UTC\",\"parameter\":\"stepout\",\"id\":52,\"puppetclass_id\":2,\"override_values_count\":2,\"default_value\":5,\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '677' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -123,16 +123,20 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/41 + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/52 response: body: - string: '{"description":"","override":true,"parameter_type":"array","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":true,"merge_default":true,"avoid_duplicates":true,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:20 UTC","parameter":"servers","id":41,"puppetclass_id":2,"override_values_count":0,"default_value":["foo.ntp.org","bar.ntp.org","bar.ntp.org"],"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"","override":true,"parameter_type":"integer","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:54 UTC","parameter":"stepout","id":52,"puppetclass_id":2,"override_values_count":2,"default_value":5,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[{"created_at":"2023-07-26 + 08:24:56 UTC","updated_at":"2023-07-26 08:24:56 UTC","id":29,"match":"domain=example.com","value":42,"omit":false},{"created_at":"2023-07-26 + 08:24:56 UTC","updated_at":"2023-07-26 08:24:56 UTC","id":30,"match":"hostgroup=test_hostgroup","value":null,"omit":true}]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '888' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -146,13 +150,68 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: DELETE + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/52/override_values/30 + response: + body: + string: '{"created_at":"2023-07-26 08:24:56 UTC","updated_at":"2023-07-26 08:24:56 + UTC","id":30,"match":"hostgroup=test_hostgroup","value":null,"omit":true}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '147' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=97 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-49.yml b/tests/test_playbooks/fixtures/smart_class_parameter-49.yml index 139f80972..49359d312 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-49.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-49.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -65,19 +65,21 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters?search=puppetclass_name%3Dntp+and+parameter%3Dservers&per_page=4294967296 + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters?search=puppetclass_name%3Dntp+and+parameter%3Dstepout&per_page=4294967296 response: body: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": - 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=servers\",\n + 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=stepout\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":true,\"parameter_type\":\"array\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":true,\"merge_default\":true,\"avoid_duplicates\":true,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:20 UTC\",\"parameter\":\"servers\",\"id\":41,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":[\"foo.ntp.org\",\"bar.ntp.org\",\"bar.ntp.org\"],\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":true,\"parameter_type\":\"integer\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:24:54 UTC\",\"parameter\":\"stepout\",\"id\":52,\"puppetclass_id\":2,\"override_values_count\":1,\"default_value\":5,\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '677' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -123,75 +123,19 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/41 + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/52 response: body: - string: '{"description":"","override":true,"parameter_type":"array","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":true,"merge_default":true,"avoid_duplicates":true,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:20 UTC","parameter":"servers","id":41,"puppetclass_id":2,"override_values_count":0,"default_value":["foo.ntp.org","bar.ntp.org","bar.ntp.org"],"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"","override":true,"parameter_type":"integer","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:54 UTC","parameter":"stepout","id":52,"puppetclass_id":2,"override_values_count":1,"default_value":5,"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[{"created_at":"2023-07-26 + 08:24:56 UTC","updated_at":"2023-07-26 08:24:56 UTC","id":29,"match":"domain=example.com","value":42,"omit":false}]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive - Content-Security-Policy: - - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; - img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; - style-src ''unsafe-inline'' ''self''' - Content-Type: - - application/json; charset=utf-8 - Foreman_api_version: - - '2' - Foreman_current_location: - - ; ANY - Foreman_current_organization: - - ; ANY - Foreman_version: - - 3.5.0-rc1 - Keep-Alive: - - timeout=15, max=98 - Strict-Transport-Security: - - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Frame-Options: - - sameorigin - X-Permitted-Cross-Domain-Policies: - - none - X-XSS-Protection: - - 1; mode=block - status: - code: 200 - message: OK -- request: - body: '{"smart_class_parameter": {"default_value": "[\"foo.ntp.org\", \"bar.ntp.org\"]"}}' - headers: - Accept: - - application/json;version=2 - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive Content-Length: - - '82' - Content-Type: - - application/json - User-Agent: - - apypie (https://github.com/Apipie/apypie) - method: PUT - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/41 - response: - body: - string: '{"description":"","override":true,"parameter_type":"array","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":true,"merge_default":true,"avoid_duplicates":true,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:21 UTC","parameter":"servers","id":41,"puppetclass_id":2,"override_values_count":0,"default_value":["foo.ntp.org","bar.ntp.org"],"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' - headers: - Cache-Control: - - max-age=0, private, must-revalidate - Connection: - - Keep-Alive + - '740' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -205,13 +149,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - - timeout=15, max=97 + - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-5.yml b/tests/test_playbooks/fixtures/smart_class_parameter-5.yml index 42e41a7f7..130c4f9b0 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-5.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-5.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=logfile\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"ntp log file\",\"override\":true,\"parameter_type\":\"string\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:46:55 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"\",\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"ntp log file\",\"override\":true,\"parameter_type\":\"string\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:24:10 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"\",\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '689' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,13 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/16 response: body: - string: '{"description":"ntp log file","override":true,"parameter_type":"string","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:46:55 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"ntp log file","override":true,"parameter_type":"string","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:10 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '612' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -146,13 +148,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -167,7 +167,7 @@ interactions: code: 200 message: OK - request: - body: '{"smart_class_parameter": {"parameter_type": ""}}' + body: '{"smart_class_parameter": {"override": false}}' headers: Accept: - application/json;version=2 @@ -176,7 +176,7 @@ interactions: Connection: - keep-alive Content-Length: - - '49' + - '46' Content-Type: - application/json User-Agent: @@ -185,13 +185,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/16 response: body: - string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:46:56 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"ntp log file","override":false,"parameter_type":"string","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:14 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '613' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -205,13 +207,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-50.yml b/tests/test_playbooks/fixtures/smart_class_parameter-50.yml index a818704c8..ad16bbd31 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-50.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-50.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=servers\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":true,\"parameter_type\":\"array\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":true,\"merge_default\":true,\"avoid_duplicates\":true,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:21 UTC\",\"parameter\":\"servers\",\"id\":41,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":[\"foo.ntp.org\",\"bar.ntp.org\"],\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":false,\"parameter_type\":\"\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:24:06 UTC\",\"parameter\":\"servers\",\"id\":41,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"\",\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '672' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,13 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/41 response: body: - string: '{"description":"","override":true,"parameter_type":"array","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":true,"merge_default":true,"avoid_duplicates":true,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:21 UTC","parameter":"servers","id":41,"puppetclass_id":2,"override_values_count":0,"default_value":["foo.ntp.org","bar.ntp.org"],"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"","override":false,"parameter_type":"","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:06 UTC","parameter":"servers","id":41,"puppetclass_id":2,"override_values_count":0,"default_value":"","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '595' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -146,13 +148,72 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: '{"smart_class_parameter": {"override": true, "default_value": "[\"foo.ntp.org\", + \"bar.ntp.org\", \"bar.ntp.org\"]", "parameter_type": "array", "merge_overrides": + true, "merge_default": true, "avoid_duplicates": true}}' + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '218' + Content-Type: + - application/json + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: PUT + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/41 + response: + body: + string: '{"description":"","override":true,"parameter_type":"array","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":true,"merge_default":true,"avoid_duplicates":true,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:25:00 UTC","parameter":"servers","id":41,"puppetclass_id":2,"override_values_count":0,"default_value":["foo.ntp.org","bar.ntp.org","bar.ntp.org"],"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '637' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=97 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-51.yml b/tests/test_playbooks/fixtures/smart_class_parameter-51.yml index a818704c8..48c6fbada 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-51.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-51.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=servers\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":true,\"parameter_type\":\"array\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":true,\"merge_default\":true,\"avoid_duplicates\":true,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:21 UTC\",\"parameter\":\"servers\",\"id\":41,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":[\"foo.ntp.org\",\"bar.ntp.org\"],\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":true,\"parameter_type\":\"array\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":true,\"merge_default\":true,\"avoid_duplicates\":true,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:25:00 UTC\",\"parameter\":\"servers\",\"id\":41,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":[\"foo.ntp.org\",\"bar.ntp.org\",\"bar.ntp.org\"],\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '714' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,13 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/41 response: body: - string: '{"description":"","override":true,"parameter_type":"array","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":true,"merge_default":true,"avoid_duplicates":true,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:21 UTC","parameter":"servers","id":41,"puppetclass_id":2,"override_values_count":0,"default_value":["foo.ntp.org","bar.ntp.org"],"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"","override":true,"parameter_type":"array","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":true,"merge_default":true,"avoid_duplicates":true,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:25:00 UTC","parameter":"servers","id":41,"puppetclass_id":2,"override_values_count":0,"default_value":["foo.ntp.org","bar.ntp.org","bar.ntp.org"],"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '637' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -146,13 +148,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-52.yml b/tests/test_playbooks/fixtures/smart_class_parameter-52.yml index 344cd50ac..fb6169897 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-52.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-52.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=servers\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":true,\"parameter_type\":\"array\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":true,\"merge_default\":true,\"avoid_duplicates\":true,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:21 UTC\",\"parameter\":\"servers\",\"id\":41,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":[\"foo.ntp.org\",\"bar.ntp.org\"],\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":true,\"parameter_type\":\"array\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":true,\"merge_default\":true,\"avoid_duplicates\":true,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:25:00 UTC\",\"parameter\":\"servers\",\"id\":41,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":[\"foo.ntp.org\",\"bar.ntp.org\",\"bar.ntp.org\"],\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '714' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,13 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/41 response: body: - string: '{"description":"","override":true,"parameter_type":"array","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":true,"merge_default":true,"avoid_duplicates":true,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:21 UTC","parameter":"servers","id":41,"puppetclass_id":2,"override_values_count":0,"default_value":["foo.ntp.org","bar.ntp.org"],"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"","override":true,"parameter_type":"array","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":true,"merge_default":true,"avoid_duplicates":true,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:25:00 UTC","parameter":"servers","id":41,"puppetclass_id":2,"override_values_count":0,"default_value":["foo.ntp.org","bar.ntp.org","bar.ntp.org"],"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '637' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -146,13 +148,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -167,7 +167,7 @@ interactions: code: 200 message: OK - request: - body: '{"override_value": {"match": "domain=example.com", "value": "[\"baz.ntp.org\"]"}}' + body: '{"smart_class_parameter": {"default_value": "[\"foo.ntp.org\", \"bar.ntp.org\"]"}}' headers: Accept: - application/json;version=2 @@ -176,81 +176,24 @@ interactions: Connection: - keep-alive Content-Length: - - '81' + - '82' Content-Type: - application/json User-Agent: - apypie (https://github.com/Apipie/apypie) - method: POST - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/41/override_values + method: PUT + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/41 response: body: - string: '{"created_at":"2022-11-25 11:47:23 UTC","updated_at":"2022-11-25 11:47:23 - UTC","id":7,"match":"domain=example.com","value":["baz.ntp.org"],"omit":false}' + string: '{"description":"","override":true,"parameter_type":"array","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":true,"merge_default":true,"avoid_duplicates":true,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:25:02 UTC","parameter":"servers","id":41,"puppetclass_id":2,"override_values_count":0,"default_value":["foo.ntp.org","bar.ntp.org"],"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive - Content-Security-Policy: - - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; - img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; - style-src ''unsafe-inline'' ''self''' - Content-Type: - - application/json; charset=utf-8 - Foreman_api_version: - - '2' - Foreman_current_location: - - ; ANY - Foreman_current_organization: - - ; ANY - Foreman_version: - - 3.5.0-rc1 - Keep-Alive: - - timeout=15, max=97 - Strict-Transport-Security: - - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Frame-Options: - - sameorigin - X-Permitted-Cross-Domain-Policies: - - none - X-XSS-Protection: - - 1; mode=block - status: - code: 201 - message: Created -- request: - body: '{"override_value": {"match": "hostgroup=test_hostgroup", "omit": true}}' - headers: - Accept: - - application/json;version=2 - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive Content-Length: - - '71' - Content-Type: - - application/json - User-Agent: - - apypie (https://github.com/Apipie/apypie) - method: POST - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/41/override_values - response: - body: - string: '{"created_at":"2022-11-25 11:47:23 UTC","updated_at":"2022-11-25 11:47:23 - UTC","id":8,"match":"hostgroup=test_hostgroup","value":null,"omit":true}' - headers: - Cache-Control: - - max-age=0, private, must-revalidate - Connection: - - Keep-Alive + - '623' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -264,13 +207,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - - timeout=15, max=96 + - timeout=15, max=97 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -282,6 +223,6 @@ interactions: X-XSS-Protection: - 1; mode=block status: - code: 201 - message: Created + code: 200 + message: OK version: 1 diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-53.yml b/tests/test_playbooks/fixtures/smart_class_parameter-53.yml index e676c6336..3d5a22003 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-53.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-53.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=servers\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":true,\"parameter_type\":\"array\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":true,\"merge_default\":true,\"avoid_duplicates\":true,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:21 UTC\",\"parameter\":\"servers\",\"id\":41,\"puppetclass_id\":2,\"override_values_count\":2,\"default_value\":[\"foo.ntp.org\",\"bar.ntp.org\"],\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":true,\"parameter_type\":\"array\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":true,\"merge_default\":true,\"avoid_duplicates\":true,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:25:02 UTC\",\"parameter\":\"servers\",\"id\":41,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":[\"foo.ntp.org\",\"bar.ntp.org\"],\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '700' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,15 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/41 response: body: - string: '{"description":"","override":true,"parameter_type":"array","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":true,"merge_default":true,"avoid_duplicates":true,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:21 UTC","parameter":"servers","id":41,"puppetclass_id":2,"override_values_count":2,"default_value":["foo.ntp.org","bar.ntp.org"],"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[{"created_at":"2022-11-25 - 11:47:23 UTC","updated_at":"2022-11-25 11:47:23 UTC","id":7,"match":"domain=example.com","value":["baz.ntp.org"],"omit":false},{"created_at":"2022-11-25 - 11:47:23 UTC","updated_at":"2022-11-25 11:47:23 UTC","id":8,"match":"hostgroup=test_hostgroup","value":null,"omit":true}]}' + string: '{"description":"","override":true,"parameter_type":"array","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":true,"merge_default":true,"avoid_duplicates":true,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:25:02 UTC","parameter":"servers","id":41,"puppetclass_id":2,"override_values_count":0,"default_value":["foo.ntp.org","bar.ntp.org"],"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '623' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -148,13 +148,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-54.yml b/tests/test_playbooks/fixtures/smart_class_parameter-54.yml index 418d19f76..3d5a22003 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-54.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-54.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=servers\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":true,\"parameter_type\":\"array\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":true,\"merge_default\":true,\"avoid_duplicates\":true,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:21 UTC\",\"parameter\":\"servers\",\"id\":41,\"puppetclass_id\":2,\"override_values_count\":2,\"default_value\":[\"foo.ntp.org\",\"bar.ntp.org\"],\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":true,\"parameter_type\":\"array\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":true,\"merge_default\":true,\"avoid_duplicates\":true,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:25:02 UTC\",\"parameter\":\"servers\",\"id\":41,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":[\"foo.ntp.org\",\"bar.ntp.org\"],\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '700' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,72 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/41 response: body: - string: '{"description":"","override":true,"parameter_type":"array","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":true,"merge_default":true,"avoid_duplicates":true,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:21 UTC","parameter":"servers","id":41,"puppetclass_id":2,"override_values_count":2,"default_value":["foo.ntp.org","bar.ntp.org"],"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[{"created_at":"2022-11-25 - 11:47:23 UTC","updated_at":"2022-11-25 11:47:23 UTC","id":7,"match":"domain=example.com","value":["baz.ntp.org"],"omit":false},{"created_at":"2022-11-25 - 11:47:23 UTC","updated_at":"2022-11-25 11:47:23 UTC","id":8,"match":"hostgroup=test_hostgroup","value":null,"omit":true}]}' + string: '{"description":"","override":true,"parameter_type":"array","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":true,"merge_default":true,"avoid_duplicates":true,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:25:02 UTC","parameter":"servers","id":41,"puppetclass_id":2,"override_values_count":0,"default_value":["foo.ntp.org","bar.ntp.org"],"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive - Content-Security-Policy: - - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; - img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; - style-src ''unsafe-inline'' ''self''' - Content-Type: - - application/json; charset=utf-8 - Foreman_api_version: - - '2' - Foreman_current_location: - - ; ANY - Foreman_current_organization: - - ; ANY - Foreman_version: - - 3.5.0-rc1 - Keep-Alive: - - timeout=15, max=98 - Strict-Transport-Security: - - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Frame-Options: - - sameorigin - X-Permitted-Cross-Domain-Policies: - - none - X-XSS-Protection: - - 1; mode=block - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json;version=2 - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive Content-Length: - - '0' - User-Agent: - - apypie (https://github.com/Apipie/apypie) - method: DELETE - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/41/override_values/7 - response: - body: - string: '{"created_at":"2022-11-25 11:47:23 UTC","updated_at":"2022-11-25 11:47:23 - UTC","id":7,"match":"domain=example.com","value":["baz.ntp.org"],"omit":false}' - headers: - Cache-Control: - - max-age=0, private, must-revalidate - Connection: - - Keep-Alive + - '623' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -205,13 +148,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - - timeout=15, max=97 + - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-55.yml b/tests/test_playbooks/fixtures/smart_class_parameter-55.yml index 9a10757ca..dc1eb1568 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-55.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-55.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=servers\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":true,\"parameter_type\":\"array\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":true,\"merge_default\":true,\"avoid_duplicates\":true,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:21 UTC\",\"parameter\":\"servers\",\"id\":41,\"puppetclass_id\":2,\"override_values_count\":1,\"default_value\":[\"foo.ntp.org\",\"bar.ntp.org\"],\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":true,\"parameter_type\":\"array\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":true,\"merge_default\":true,\"avoid_duplicates\":true,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:25:02 UTC\",\"parameter\":\"servers\",\"id\":41,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":[\"foo.ntp.org\",\"bar.ntp.org\"],\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '700' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,14 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/41 response: body: - string: '{"description":"","override":true,"parameter_type":"array","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":true,"merge_default":true,"avoid_duplicates":true,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:21 UTC","parameter":"servers","id":41,"puppetclass_id":2,"override_values_count":1,"default_value":["foo.ntp.org","bar.ntp.org"],"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[{"created_at":"2022-11-25 - 11:47:23 UTC","updated_at":"2022-11-25 11:47:23 UTC","id":8,"match":"hostgroup=test_hostgroup","value":null,"omit":true}]}' + string: '{"description":"","override":true,"parameter_type":"array","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":true,"merge_default":true,"avoid_duplicates":true,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:25:02 UTC","parameter":"servers","id":41,"puppetclass_id":2,"override_values_count":0,"default_value":["foo.ntp.org","bar.ntp.org"],"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '623' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -147,13 +148,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -167,4 +166,122 @@ interactions: status: code: 200 message: OK +- request: + body: '{"override_value": {"match": "domain=example.com", "value": "[\"baz.ntp.org\"]"}}' + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '81' + Content-Type: + - application/json + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: POST + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/41/override_values + response: + body: + string: '{"created_at":"2023-07-26 08:25:04 UTC","updated_at":"2023-07-26 08:25:04 + UTC","id":31,"match":"domain=example.com","value":["baz.ntp.org"],"omit":false}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '153' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=97 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 201 + message: Created +- request: + body: '{"override_value": {"match": "hostgroup=test_hostgroup", "omit": true}}' + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '71' + Content-Type: + - application/json + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: POST + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/41/override_values + response: + body: + string: '{"created_at":"2023-07-26 08:25:04 UTC","updated_at":"2023-07-26 08:25:04 + UTC","id":32,"match":"hostgroup=test_hostgroup","value":null,"omit":true}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '147' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=96 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 201 + message: Created version: 1 diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-56.yml b/tests/test_playbooks/fixtures/smart_class_parameter-56.yml index 9a10757ca..6fb5d9463 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-56.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-56.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=servers\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":true,\"parameter_type\":\"array\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":true,\"merge_default\":true,\"avoid_duplicates\":true,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:21 UTC\",\"parameter\":\"servers\",\"id\":41,\"puppetclass_id\":2,\"override_values_count\":1,\"default_value\":[\"foo.ntp.org\",\"bar.ntp.org\"],\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":true,\"parameter_type\":\"array\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":true,\"merge_default\":true,\"avoid_duplicates\":true,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:25:02 UTC\",\"parameter\":\"servers\",\"id\":41,\"puppetclass_id\":2,\"override_values_count\":2,\"default_value\":[\"foo.ntp.org\",\"bar.ntp.org\"],\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '700' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,14 +126,17 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/41 response: body: - string: '{"description":"","override":true,"parameter_type":"array","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":true,"merge_default":true,"avoid_duplicates":true,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:21 UTC","parameter":"servers","id":41,"puppetclass_id":2,"override_values_count":1,"default_value":["foo.ntp.org","bar.ntp.org"],"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[{"created_at":"2022-11-25 - 11:47:23 UTC","updated_at":"2022-11-25 11:47:23 UTC","id":8,"match":"hostgroup=test_hostgroup","value":null,"omit":true}]}' + string: '{"description":"","override":true,"parameter_type":"array","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":true,"merge_default":true,"avoid_duplicates":true,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:25:02 UTC","parameter":"servers","id":41,"puppetclass_id":2,"override_values_count":2,"default_value":["foo.ntp.org","bar.ntp.org"],"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[{"created_at":"2023-07-26 + 08:25:04 UTC","updated_at":"2023-07-26 08:25:04 UTC","id":31,"match":"domain=example.com","value":["baz.ntp.org"],"omit":false},{"created_at":"2023-07-26 + 08:25:04 UTC","updated_at":"2023-07-26 08:25:04 UTC","id":32,"match":"hostgroup=test_hostgroup","value":null,"omit":true}]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '924' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -147,13 +150,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-57.yml b/tests/test_playbooks/fixtures/smart_class_parameter-57.yml index 12912cd3c..a685dd625 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-57.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-57.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=servers\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":true,\"parameter_type\":\"array\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":true,\"merge_default\":true,\"avoid_duplicates\":true,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:21 UTC\",\"parameter\":\"servers\",\"id\":41,\"puppetclass_id\":2,\"override_values_count\":1,\"default_value\":[\"foo.ntp.org\",\"bar.ntp.org\"],\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":true,\"parameter_type\":\"array\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":true,\"merge_default\":true,\"avoid_duplicates\":true,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:25:02 UTC\",\"parameter\":\"servers\",\"id\":41,\"puppetclass_id\":2,\"override_values_count\":2,\"default_value\":[\"foo.ntp.org\",\"bar.ntp.org\"],\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '700' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,14 +126,17 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/41 response: body: - string: '{"description":"","override":true,"parameter_type":"array","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":true,"merge_default":true,"avoid_duplicates":true,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:21 UTC","parameter":"servers","id":41,"puppetclass_id":2,"override_values_count":1,"default_value":["foo.ntp.org","bar.ntp.org"],"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[{"created_at":"2022-11-25 - 11:47:23 UTC","updated_at":"2022-11-25 11:47:23 UTC","id":8,"match":"hostgroup=test_hostgroup","value":null,"omit":true}]}' + string: '{"description":"","override":true,"parameter_type":"array","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":true,"merge_default":true,"avoid_duplicates":true,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:25:02 UTC","parameter":"servers","id":41,"puppetclass_id":2,"override_values_count":2,"default_value":["foo.ntp.org","bar.ntp.org"],"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[{"created_at":"2023-07-26 + 08:25:04 UTC","updated_at":"2023-07-26 08:25:04 UTC","id":31,"match":"domain=example.com","value":["baz.ntp.org"],"omit":false},{"created_at":"2023-07-26 + 08:25:04 UTC","updated_at":"2023-07-26 08:25:04 UTC","id":32,"match":"hostgroup=test_hostgroup","value":null,"omit":true}]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '924' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -147,13 +150,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -168,8 +169,7 @@ interactions: code: 200 message: OK - request: - body: '{"smart_class_parameter": {"merge_overrides": false, "merge_default": false, - "avoid_duplicates": false}}' + body: null headers: Accept: - application/json;version=2 @@ -178,23 +178,22 @@ interactions: Connection: - keep-alive Content-Length: - - '104' - Content-Type: - - application/json + - '0' User-Agent: - apypie (https://github.com/Apipie/apypie) - method: PUT - uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/41 + method: DELETE + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/41/override_values/31 response: body: - string: '{"description":"","override":true,"parameter_type":"array","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:26 UTC","parameter":"servers","id":41,"puppetclass_id":2,"override_values_count":1,"default_value":["foo.ntp.org","bar.ntp.org"],"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[{"created_at":"2022-11-25 - 11:47:23 UTC","updated_at":"2022-11-25 11:47:23 UTC","id":8,"match":"hostgroup=test_hostgroup","value":null,"omit":true}]}' + string: '{"created_at":"2023-07-26 08:25:04 UTC","updated_at":"2023-07-26 08:25:04 + UTC","id":31,"match":"domain=example.com","value":["baz.ntp.org"],"omit":false}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '153' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -208,13 +207,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-58.yml b/tests/test_playbooks/fixtures/smart_class_parameter-58.yml index 690f6da54..53bfa055b 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-58.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-58.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=servers\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"\",\"override\":true,\"parameter_type\":\"array\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:47:26 UTC\",\"parameter\":\"servers\",\"id\":41,\"puppetclass_id\":2,\"override_values_count\":1,\"default_value\":[\"foo.ntp.org\",\"bar.ntp.org\"],\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"\",\"override\":true,\"parameter_type\":\"array\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":true,\"merge_default\":true,\"avoid_duplicates\":true,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:25:02 UTC\",\"parameter\":\"servers\",\"id\":41,\"puppetclass_id\":2,\"override_values_count\":1,\"default_value\":[\"foo.ntp.org\",\"bar.ntp.org\"],\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '700' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,14 +126,16 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/41 response: body: - string: '{"description":"","override":true,"parameter_type":"array","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:47:26 UTC","parameter":"servers","id":41,"puppetclass_id":2,"override_values_count":1,"default_value":["foo.ntp.org","bar.ntp.org"],"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[{"created_at":"2022-11-25 - 11:47:23 UTC","updated_at":"2022-11-25 11:47:23 UTC","id":8,"match":"hostgroup=test_hostgroup","value":null,"omit":true}]}' + string: '{"description":"","override":true,"parameter_type":"array","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":true,"merge_default":true,"avoid_duplicates":true,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:25:02 UTC","parameter":"servers","id":41,"puppetclass_id":2,"override_values_count":1,"default_value":["foo.ntp.org","bar.ntp.org"],"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[{"created_at":"2023-07-26 + 08:25:04 UTC","updated_at":"2023-07-26 08:25:04 UTC","id":32,"match":"hostgroup=test_hostgroup","value":null,"omit":true}]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '770' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -147,13 +149,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-59.yml b/tests/test_playbooks/fixtures/smart_class_parameter-59.yml new file mode 100644 index 000000000..53bfa055b --- /dev/null +++ b/tests/test_playbooks/fixtures/smart_class_parameter-59.yml @@ -0,0 +1,170 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/status + response: + body: + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '62' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=100 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters?search=puppetclass_name%3Dntp+and+parameter%3Dservers&per_page=4294967296 + response: + body: + string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=servers\",\n + \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": + [{\"description\":\"\",\"override\":true,\"parameter_type\":\"array\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":true,\"merge_default\":true,\"avoid_duplicates\":true,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:25:02 UTC\",\"parameter\":\"servers\",\"id\":41,\"puppetclass_id\":2,\"override_values_count\":1,\"default_value\":[\"foo.ntp.org\",\"bar.ntp.org\"],\"puppetclass_name\":\"ntp\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '700' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=99 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/41 + response: + body: + string: '{"description":"","override":true,"parameter_type":"array","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":true,"merge_default":true,"avoid_duplicates":true,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:25:02 UTC","parameter":"servers","id":41,"puppetclass_id":2,"override_values_count":1,"default_value":["foo.ntp.org","bar.ntp.org"],"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[{"created_at":"2023-07-26 + 08:25:04 UTC","updated_at":"2023-07-26 08:25:04 UTC","id":32,"match":"hostgroup=test_hostgroup","value":null,"omit":true}]}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '770' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=98 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +version: 1 diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-6.yml b/tests/test_playbooks/fixtures/smart_class_parameter-6.yml index 8a8f39e48..48c4eaf43 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-6.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-6.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=logfile\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"ntp log file\",\"override\":true,\"parameter_type\":\"\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:46:56 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"\",\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"ntp log file\",\"override\":false,\"parameter_type\":\"string\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:24:14 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"\",\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '690' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,13 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/16 response: body: - string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:46:56 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"ntp log file","override":false,"parameter_type":"string","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:14 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '613' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -146,13 +148,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-60.yml b/tests/test_playbooks/fixtures/smart_class_parameter-60.yml new file mode 100644 index 000000000..80f06b01e --- /dev/null +++ b/tests/test_playbooks/fixtures/smart_class_parameter-60.yml @@ -0,0 +1,231 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/status + response: + body: + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '62' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=100 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters?search=puppetclass_name%3Dntp+and+parameter%3Dservers&per_page=4294967296 + response: + body: + string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=servers\",\n + \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": + [{\"description\":\"\",\"override\":true,\"parameter_type\":\"array\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":true,\"merge_default\":true,\"avoid_duplicates\":true,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:25:02 UTC\",\"parameter\":\"servers\",\"id\":41,\"puppetclass_id\":2,\"override_values_count\":1,\"default_value\":[\"foo.ntp.org\",\"bar.ntp.org\"],\"puppetclass_name\":\"ntp\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '700' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=99 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/41 + response: + body: + string: '{"description":"","override":true,"parameter_type":"array","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":true,"merge_default":true,"avoid_duplicates":true,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:25:02 UTC","parameter":"servers","id":41,"puppetclass_id":2,"override_values_count":1,"default_value":["foo.ntp.org","bar.ntp.org"],"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[{"created_at":"2023-07-26 + 08:25:04 UTC","updated_at":"2023-07-26 08:25:04 UTC","id":32,"match":"hostgroup=test_hostgroup","value":null,"omit":true}]}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '770' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=98 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: '{"smart_class_parameter": {"merge_overrides": false, "merge_default": false, + "avoid_duplicates": false}}' + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '104' + Content-Type: + - application/json + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: PUT + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/41 + response: + body: + string: '{"description":"","override":true,"parameter_type":"array","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:25:09 UTC","parameter":"servers","id":41,"puppetclass_id":2,"override_values_count":1,"default_value":["foo.ntp.org","bar.ntp.org"],"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[{"created_at":"2023-07-26 + 08:25:04 UTC","updated_at":"2023-07-26 08:25:04 UTC","id":32,"match":"hostgroup=test_hostgroup","value":null,"omit":true}]}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '773' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=97 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +version: 1 diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-61.yml b/tests/test_playbooks/fixtures/smart_class_parameter-61.yml new file mode 100644 index 000000000..6c606632a --- /dev/null +++ b/tests/test_playbooks/fixtures/smart_class_parameter-61.yml @@ -0,0 +1,170 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/status + response: + body: + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '62' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=100 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters?search=puppetclass_name%3Dntp+and+parameter%3Dservers&per_page=4294967296 + response: + body: + string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=servers\",\n + \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": + [{\"description\":\"\",\"override\":true,\"parameter_type\":\"array\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:25:09 UTC\",\"parameter\":\"servers\",\"id\":41,\"puppetclass_id\":2,\"override_values_count\":1,\"default_value\":[\"foo.ntp.org\",\"bar.ntp.org\"],\"puppetclass_name\":\"ntp\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '703' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=99 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/41 + response: + body: + string: '{"description":"","override":true,"parameter_type":"array","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:25:09 UTC","parameter":"servers","id":41,"puppetclass_id":2,"override_values_count":1,"default_value":["foo.ntp.org","bar.ntp.org"],"puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[{"created_at":"2023-07-26 + 08:25:04 UTC","updated_at":"2023-07-26 08:25:04 UTC","id":32,"match":"hostgroup=test_hostgroup","value":null,"omit":true}]}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '773' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=98 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +version: 1 diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-7.yml b/tests/test_playbooks/fixtures/smart_class_parameter-7.yml index 8a8f39e48..4ac49e895 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-7.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-7.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=logfile\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"ntp log file\",\"override\":true,\"parameter_type\":\"\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:46:56 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"\",\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"ntp log file\",\"override\":false,\"parameter_type\":\"string\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:24:14 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"\",\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '690' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,13 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/16 response: body: - string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:46:56 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"ntp log file","override":false,"parameter_type":"string","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:14 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '613' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -146,13 +148,70 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: '{"smart_class_parameter": {"override": true}}' + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '45' + Content-Type: + - application/json + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: PUT + uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/16 + response: + body: + string: '{"description":"ntp log file","override":true,"parameter_type":"string","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:16 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '612' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=97 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-8.yml b/tests/test_playbooks/fixtures/smart_class_parameter-8.yml index 33a07cea0..a4589aec7 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-8.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-8.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=logfile\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"ntp log file\",\"override\":true,\"parameter_type\":\"\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:46:56 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"\",\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"ntp log file\",\"override\":true,\"parameter_type\":\"string\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:24:16 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"\",\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '689' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,13 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/16 response: body: - string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:46:56 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"ntp log file","override":true,"parameter_type":"string","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:16 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '612' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -146,13 +148,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -167,7 +167,7 @@ interactions: code: 200 message: OK - request: - body: '{"smart_class_parameter": {"hidden_value": true}}' + body: '{"smart_class_parameter": {"parameter_type": ""}}' headers: Accept: - application/json;version=2 @@ -185,13 +185,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/16 response: body: - string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":true,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:46:58 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"*****","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:17 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '606' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -205,13 +207,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/smart_class_parameter-9.yml b/tests/test_playbooks/fixtures/smart_class_parameter-9.yml index d3738b9d0..1114bf04c 100644 --- a/tests/test_playbooks/fixtures/smart_class_parameter-9.yml +++ b/tests/test_playbooks/fixtures/smart_class_parameter-9.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.5.0-rc1","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -71,13 +71,15 @@ interactions: string: "{\n \"total\": 71,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": 4294967296,\n \"search\": \"puppetclass_name=ntp and parameter=logfile\",\n \ \"sort\": {\n \"by\": null,\n \"order\": null\n },\n \"results\": - [{\"description\":\"ntp log file\",\"override\":true,\"parameter_type\":\"\",\"hidden_value?\":true,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2022-11-25 - 11:45:14 UTC\",\"updated_at\":\"2022-11-25 11:46:58 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"*****\",\"puppetclass_name\":\"ntp\"}]\n}\n" + [{\"description\":\"ntp log file\",\"override\":true,\"parameter_type\":\"\",\"hidden_value?\":false,\"omit\":false,\"required\":false,\"validator_type\":null,\"validator_rule\":null,\"merge_overrides\":false,\"merge_default\":false,\"avoid_duplicates\":false,\"override_value_order\":\"fqdn\\nhostgroup\\nos\\ndomain\",\"created_at\":\"2023-07-26 + 07:53:31 UTC\",\"updated_at\":\"2023-07-26 08:24:17 UTC\",\"parameter\":\"logfile\",\"id\":16,\"puppetclass_id\":2,\"override_values_count\":0,\"default_value\":\"\",\"puppetclass_name\":\"ntp\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '683' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -91,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -126,13 +126,15 @@ interactions: uri: https://foreman.example.org/foreman_puppet/api/smart_class_parameters/16 response: body: - string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":true,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2022-11-25 - 11:45:14 UTC","updated_at":"2022-11-25 11:46:58 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"*****","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' + string: '{"description":"ntp log file","override":true,"parameter_type":"","hidden_value?":false,"omit":false,"required":false,"validator_type":null,"validator_rule":null,"merge_overrides":false,"merge_default":false,"avoid_duplicates":false,"override_value_order":"fqdn\nhostgroup\nos\ndomain","created_at":"2023-07-26 + 07:53:31 UTC","updated_at":"2023-07-26 08:24:17 UTC","parameter":"logfile","id":16,"puppetclass_id":2,"override_values_count":0,"default_value":"","puppetclass_name":"ntp","environments":[{"name":"production","id":1}],"puppetclass":{"id":2,"name":"ntp","module_name":"ntp"},"override_values":[]}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '606' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -146,13 +148,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.5.0-rc1 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/smart_class_parameter.yml b/tests/test_playbooks/smart_class_parameter.yml index 47e5f0c8e..45a0fa2f0 100644 --- a/tests/test_playbooks/smart_class_parameter.yml +++ b/tests/test_playbooks/smart_class_parameter.yml @@ -94,6 +94,24 @@ vars: smart_class_parameter_state: present expected_change: false + + - include_tasks: tasks/smart_class_parameter.yml + vars: + smart_class_parameter_parameter_type: string + smart_class_parameter_override: false + smart_class_parameter_state: present + expected_change: true + - include_tasks: tasks/smart_class_parameter.yml + vars: + smart_class_parameter_parameter_type: string + smart_class_parameter_override: false + smart_class_parameter_state: present + expected_change: false + - include_tasks: tasks/smart_class_parameter.yml + vars: + smart_class_parameter_state: present + expected_change: true + - include_tasks: tasks/smart_class_parameter.yml vars: smart_class_parameter_parameter_type: none From d1824e2776568a9a0aaeb60052febb3ac69f6f09 Mon Sep 17 00:00:00 2001 From: Sven Meeus Date: Sat, 29 Jul 2023 15:54:23 +0200 Subject: [PATCH 06/19] Add missing organizations and locations attributes --- roles/auth_sources_ldap/tasks/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roles/auth_sources_ldap/tasks/main.yml b/roles/auth_sources_ldap/tasks/main.yml index 2eed217af..187507011 100644 --- a/roles/auth_sources_ldap/tasks/main.yml +++ b/roles/auth_sources_ldap/tasks/main.yml @@ -5,6 +5,8 @@ password: "{{ foreman_password | default(omit) }}" server_url: "{{ foreman_server_url | default(omit) }}" validate_certs: "{{ foreman_validate_certs | default(omit) }}" + organizations: "{{ item.organizations | default(omit) }}" + locations: "{{ item.locations | default(omit) }}" name: "{{ item.name }}" account: "{{ item.account | default(omit) }}" account_password: "{{ item.account_password | default(omit) }}" From a6be40dd2aef97b70fa433eb6671dc62625416cf Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Thu, 27 Jul 2023 10:40:07 +0200 Subject: [PATCH 07/19] Revert "pin flake8 to < 4" This reverts commit 7ac54ff3e9db8ecd7997d7c1a5bd886a9ade0067. --- requirements-lint.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-lint.txt b/requirements-lint.txt index 198c3e4ed..5ad240bc4 100644 --- a/requirements-lint.txt +++ b/requirements-lint.txt @@ -1,5 +1,5 @@ py -flake8<4 +flake8 yamllint ansible-lint>=6.9.0 galaxy-importer From 77abbe15bf3965018d6b37015dbbba2b404182d5 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Thu, 27 Jul 2023 11:15:09 +0200 Subject: [PATCH 08/19] split galaxy-importer test into own job g-i pins old ansible-lint and that breaks stuff --- .github/workflows/main.yml | 15 +++++++++++++++ Makefile | 4 +++- requirements-lint.txt | 1 - 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c1345c275..6c1f3f67b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -119,6 +119,21 @@ jobs: name: docs-html path: docs/_build/html/ + galaxy-importer: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.11" + cache: 'pip' + cache-dependency-path: '**/requirements*.txt' + - name: Install dependencies + run: pip install --upgrade py galaxy-importer + - name: Run galaxy-importer + run: make galaxy-importer + lint: runs-on: ubuntu-latest steps: diff --git a/Makefile b/Makefile index 685424f48..93df768a9 100644 --- a/Makefile +++ b/Makefile @@ -49,10 +49,12 @@ lint: $(MANIFEST) $(RUNTIME_YML) | tests/test_playbooks/vars/server.yml ansible-lint -v --offline roles/* ansible-playbook --syntax-check tests/test_playbooks/*.yml | grep -v '^$$' flake8 --ignore=E402,W503 --max-line-length=160 plugins/ tests/ - GALAXY_IMPORTER_CONFIG=tests/galaxy-importer.cfg python -m galaxy_importer.main $(NAMESPACE)-$(NAME)-$(VERSION).tar.gz @echo "Check that there are no changes to $(RUNTIME_YML)" git diff --exit-code $(RUNTIME_YML) +galaxy-importer: $(MANIFEST) + GALAXY_IMPORTER_CONFIG=tests/galaxy-importer.cfg python -m galaxy_importer.main $(NAMESPACE)-$(NAME)-$(VERSION).tar.gz + sanity: $(MANIFEST) # Fake a fresh git repo for ansible-test cd $( .gitignore ; ansible-test sanity $(SANITY_OPTS) --python $(PYTHON_VERSION) diff --git a/requirements-lint.txt b/requirements-lint.txt index 5ad240bc4..b5263d7ca 100644 --- a/requirements-lint.txt +++ b/requirements-lint.txt @@ -2,4 +2,3 @@ py flake8 yamllint ansible-lint>=6.9.0 -galaxy-importer From 845116fdefcc4e9dac8fc34ed35782eee8598ef7 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Thu, 27 Jul 2023 11:26:24 +0200 Subject: [PATCH 09/19] make new flake8 happy --- plugins/module_utils/_apypie.py | 2 +- vendor.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/module_utils/_apypie.py b/plugins/module_utils/_apypie.py index 83aa5c3eb..09ea11b27 100644 --- a/plugins/module_utils/_apypie.py +++ b/plugins/module_utils/_apypie.py @@ -2,7 +2,7 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type try: - from typing import Any, Iterable, List, Optional, Tuple # pylint: disable=unused-import + from typing import Any, Iterable, List, Optional, Tuple # pylint: disable=unused-import # noqa: F401 except ImportError: pass diff --git a/vendor.py b/vendor.py index 1739e9cdd..219012d3b 100644 --- a/vendor.py +++ b/vendor.py @@ -67,5 +67,5 @@ output_lines.extend(buffer_lines) buffer_lines.clear() -typing_lines = ['try:', ' from typing import {} # pylint: disable=unused-import'.format(', '.join(sorted(typing_imports))), 'except ImportError:', ' pass'] +typing_lines = ['try:', ' from typing import {} # pylint: disable=unused-import # noqa: F401'.format(', '.join(sorted(typing_imports))), 'except ImportError:', ' pass'] print("\n".join(header_lines + typing_lines + output_lines)) From 6829de709b396a3dce027e217ebc8df0504ffd8e Mon Sep 17 00:00:00 2001 From: Julien Godin Date: Wed, 19 Jul 2023 12:56:28 +0200 Subject: [PATCH 10/19] feat(wait_task): Add a wait_task module. And a new module that simply expose the wait_for_task function Signed-off-by: Julien Godin --- galaxy.yml | 1 + meta/runtime.yml | 1 + plugins/modules/wait_for_task.py | 94 ++++++++++++++++++++ tests/fixtures/apidoc/wait_for_task.json | 1 + tests/test_playbooks/tasks/wait_for_task.yml | 59 ++++++++++++ tests/test_playbooks/wait_for_task.yml | 9 ++ 6 files changed, 165 insertions(+) create mode 100644 plugins/modules/wait_for_task.py create mode 120000 tests/fixtures/apidoc/wait_for_task.json create mode 100644 tests/test_playbooks/tasks/wait_for_task.yml create mode 100644 tests/test_playbooks/wait_for_task.yml diff --git a/galaxy.yml b/galaxy.yml index 996d68e65..5a7a1c4d1 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -93,6 +93,7 @@ authors: - "metalcated " - "russianguppie <46544650+russianguppie@users.noreply.github.com>" - "willtome " + - "Julien Godin " version: "3.13.0-dev" license: - "GPL-3.0-or-later" diff --git a/meta/runtime.yml b/meta/runtime.yml index 91fc657f8..de3ff9c89 100644 --- a/meta/runtime.yml +++ b/meta/runtime.yml @@ -79,6 +79,7 @@ action_groups: - templates_import - user - usergroup + - wait_for_task plugin_routing: modules: foreman_architecture: diff --git a/plugins/modules/wait_for_task.py b/plugins/modules/wait_for_task.py new file mode 100644 index 000000000..48cd49476 --- /dev/null +++ b/plugins/modules/wait_for_task.py @@ -0,0 +1,94 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +# (c) 2023, Julien Godin +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +from __future__ import absolute_import, division, print_function +__metaclass__ = type + +DOCUMENTATION = ''' +--- +module: wait_for_task +version_added: 3.13.0 +short_description: Wait for a task +description: + - Wait for a task to finish +author: + - "Julien Godin (@JGodin-C2C)" +options: + task: + description: + - Task id to wait for. + required: true + type: str + timeout: + description: + - How much time the task should take to be finished + required: false + type: int + default: 60 +extends_documentation_fragment: + - theforeman.foreman.foreman +''' + + +EXAMPLES = ''' +- name: wait for a task to finish in at least 10 seconds + theforeman.foreman.wait_for_task: + server_url: "https://foreman.example.com" + password: changeme + username: admin + task: "{{ item }}" + timeout: 60 + loop: "{{ tasks.resources }}" + +''' + +RETURN = ''' +entity: + description: Designated task is finished + returned: success + type: dict + contains: + task: + description: The finished task + type: dict +''' + + +from ansible_collections.theforeman.foreman.plugins.module_utils.foreman_helper import ForemanAnsibleModule + + +class ForemanWaitForTask(ForemanAnsibleModule): + pass + + +def main(): + module = ForemanWaitForTask( + argument_spec=dict( + task=dict(type="str", required=True), + timeout=dict(type="int", required=False, default=60), + ) + ) + module.task_timeout = module.foreman_params["timeout"] + with module.api_connection(): + + task = module.wait_for_task(module.show_resource( + 'foreman_tasks', module.foreman_params["task"])) + module.exit_json(task=task, task_id=task['id']) + + +if __name__ == "__main__": + main() diff --git a/tests/fixtures/apidoc/wait_for_task.json b/tests/fixtures/apidoc/wait_for_task.json new file mode 120000 index 000000000..f9e401512 --- /dev/null +++ b/tests/fixtures/apidoc/wait_for_task.json @@ -0,0 +1 @@ +foreman.json \ No newline at end of file diff --git a/tests/test_playbooks/tasks/wait_for_task.yml b/tests/test_playbooks/tasks/wait_for_task.yml new file mode 100644 index 000000000..203d68edf --- /dev/null +++ b/tests/test_playbooks/tasks/wait_for_task.yml @@ -0,0 +1,59 @@ +--- +- name: "Create katello content view version" + vars: + - content_view_name: "Test Content View" + - organization_name: "Test Organization" + - lifecycle_environments: Library + content_view_version: + username: "{{ foreman_username }}" + password: "{{ foreman_password }}" + server_url: "{{ foreman_server_url }}" + validate_certs: "{{ foreman_validate_certs }}" + content_view: "{{ content_view_name }}" + organization: "{{ organization_name }}" + description: "{{ description | default(omit)}}" + version: "{{ version | default(omit)}}" + lifecycle_environments: "{{ lifecycle_environments }}" + force_promote: "{{ force_promote | default(omit) }}" + force_yum_metadata_regeneration: "{{ force_yum_metadata_regeneration | default(omit) }}" + current_lifecycle_environment: "{{ current_lifecycle_environment | default(omit) }}" + state: "{{ state | default(omit) }}" + async: 9999 + +- name: Wait for API to react + ansible.builtin.pause: + seconds: 10 + +- name: "Search for previously created task" + resource_info: + username: "{{ foreman_username }}" + password: "{{ foreman_password }}" + server_url: "{{ foreman_server_url }}" + validate_certs: "{{ foreman_validate_certs }}" + resource: foreman_tasks + search: "(label = Actions::Katello::ContentView::Publish and state = running)" + +- name: wait for the task to finish + wait_for_task: + username: "{{ foreman_username }}" + password: "{{ foreman_password }}" + server_url: "{{ foreman_server_url }}" + validate_certs: "{{ foreman_validate_certs }}" + task: "{{ item }}" + timeout: 900 + loop: "{{ tasks.resources }}" + + +- name: "Search for previously created task" + resource_info: + username: "{{ foreman_username }}" + password: "{{ foreman_password }}" + server_url: "{{ foreman_server_url }}" + validate_certs: "{{ foreman_validate_certs }}" + resource: foreman_tasks + search: "(label = Actions::Katello::ContentView::Publish and state = running)" + register: tasks +- assert: + fail_msg: "Verification that '{{ resource }}' resource is not runing anymore" + that: result.resource | lenght == 0 +... diff --git a/tests/test_playbooks/wait_for_task.yml b/tests/test_playbooks/wait_for_task.yml new file mode 100644 index 000000000..cfd2598c4 --- /dev/null +++ b/tests/test_playbooks/wait_for_task.yml @@ -0,0 +1,9 @@ +--- +- hosts: localhost + collections: + - theforeman.foreman + gather_facts: false + vars_files: + - vars/server.yml + tasks: + - include_tasks: tasks/wait_task.yml From 0909df0f7dc89cf115852b786b6f7ffe1ee48f16 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Fri, 11 Aug 2023 09:23:30 +0200 Subject: [PATCH 11/19] adjust tests --- tests/fixtures/apidoc/wait_for_task.json | 2 +- tests/test_playbooks/tasks/wait_for_task.yml | 40 +++---------- tests/test_playbooks/wait_for_task.yml | 59 +++++++++++++++++++- 3 files changed, 68 insertions(+), 33 deletions(-) diff --git a/tests/fixtures/apidoc/wait_for_task.json b/tests/fixtures/apidoc/wait_for_task.json index f9e401512..8e89899a0 120000 --- a/tests/fixtures/apidoc/wait_for_task.json +++ b/tests/fixtures/apidoc/wait_for_task.json @@ -1 +1 @@ -foreman.json \ No newline at end of file +katello.json \ No newline at end of file diff --git a/tests/test_playbooks/tasks/wait_for_task.yml b/tests/test_playbooks/tasks/wait_for_task.yml index 203d68edf..933497ddd 100644 --- a/tests/test_playbooks/tasks/wait_for_task.yml +++ b/tests/test_playbooks/tasks/wait_for_task.yml @@ -1,29 +1,4 @@ --- -- name: "Create katello content view version" - vars: - - content_view_name: "Test Content View" - - organization_name: "Test Organization" - - lifecycle_environments: Library - content_view_version: - username: "{{ foreman_username }}" - password: "{{ foreman_password }}" - server_url: "{{ foreman_server_url }}" - validate_certs: "{{ foreman_validate_certs }}" - content_view: "{{ content_view_name }}" - organization: "{{ organization_name }}" - description: "{{ description | default(omit)}}" - version: "{{ version | default(omit)}}" - lifecycle_environments: "{{ lifecycle_environments }}" - force_promote: "{{ force_promote | default(omit) }}" - force_yum_metadata_regeneration: "{{ force_yum_metadata_regeneration | default(omit) }}" - current_lifecycle_environment: "{{ current_lifecycle_environment | default(omit) }}" - state: "{{ state | default(omit) }}" - async: 9999 - -- name: Wait for API to react - ansible.builtin.pause: - seconds: 10 - - name: "Search for previously created task" resource_info: username: "{{ foreman_username }}" @@ -31,7 +6,11 @@ server_url: "{{ foreman_server_url }}" validate_certs: "{{ foreman_validate_certs }}" resource: foreman_tasks - search: "(label = Actions::Katello::ContentView::Publish and state = running)" + search: "(label = Actions::Katello::Product::Destroy and action ~ 'Test Product' and state = running)" + register: tasks +- assert: + fail_msg: "Verification that tasks are runing" + that: tasks.resources | length > 0 - name: wait for the task to finish wait_for_task: @@ -41,8 +20,7 @@ validate_certs: "{{ foreman_validate_certs }}" task: "{{ item }}" timeout: 900 - loop: "{{ tasks.resources }}" - + loop: "{{ tasks.resources | map(attribute='id') | list }}" - name: "Search for previously created task" resource_info: @@ -51,9 +29,9 @@ server_url: "{{ foreman_server_url }}" validate_certs: "{{ foreman_validate_certs }}" resource: foreman_tasks - search: "(label = Actions::Katello::ContentView::Publish and state = running)" + search: "(label = Actions::Katello::Product::Destroy and action ~ 'Test Product' and state = running)" register: tasks - assert: - fail_msg: "Verification that '{{ resource }}' resource is not runing anymore" - that: result.resource | lenght == 0 + fail_msg: "Verification that no task is runing anymore" + that: tasks.resources | length == 0 ... diff --git a/tests/test_playbooks/wait_for_task.yml b/tests/test_playbooks/wait_for_task.yml index cfd2598c4..48ee03091 100644 --- a/tests/test_playbooks/wait_for_task.yml +++ b/tests/test_playbooks/wait_for_task.yml @@ -6,4 +6,61 @@ vars_files: - vars/server.yml tasks: - - include_tasks: tasks/wait_task.yml + - include_tasks: tasks/organization.yml + vars: + organization_state: present + - include_tasks: tasks/product.yml + vars: + product_state: present + - include_tasks: tasks/repository.yml + vars: + repository_state: present + repository_name: "{{ item }}" + loop: + - "Test Repository 1" + - "Test Repository 2" + - "Test Repository 3" + - "Test Repository 4" + - "Test Repository 5" + + - name: "Delete a Product" + vars: + - product_name: "Test Product" + - organization_name: "Test Organization" + product: + username: "{{ foreman_username }}" + password: "{{ foreman_password }}" + server_url: "{{ foreman_server_url }}" + validate_certs: "{{ foreman_validate_certs }}" + name: "{{ product_name }}" + organization: "{{ organization_name }}" + state: "absent" + async: 9999 + poll: 0 + + - name: Wait for API to react + ansible.builtin.pause: + seconds: 2 + +- hosts: tests + collections: + - theforeman.foreman + gather_facts: false + vars_files: + - vars/server.yml + tasks: + - include_tasks: tasks/wait_for_task.yml + +- hosts: localhost + collections: + - theforeman.foreman + gather_facts: false + vars_files: + - vars/server.yml + tasks: + - include_tasks: tasks/product.yml + vars: + product_state: absent + - include_tasks: tasks/organization.yml + vars: + organization_state: absent From 28a35245e3e8953a159a4459ab9595ffabfb9f36 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Fri, 11 Aug 2023 09:33:05 +0200 Subject: [PATCH 12/19] record --- .../fixtures/wait_for_task-0.yml | 120 ++++++++++++ .../fixtures/wait_for_task-1.yml | 178 ++++++++++++++++++ .../fixtures/wait_for_task-2.yml | 113 +++++++++++ 3 files changed, 411 insertions(+) create mode 100644 tests/test_playbooks/fixtures/wait_for_task-0.yml create mode 100644 tests/test_playbooks/fixtures/wait_for_task-1.yml create mode 100644 tests/test_playbooks/fixtures/wait_for_task-2.yml diff --git a/tests/test_playbooks/fixtures/wait_for_task-0.yml b/tests/test_playbooks/fixtures/wait_for_task-0.yml new file mode 100644 index 000000000..2e6908e39 --- /dev/null +++ b/tests/test_playbooks/fixtures/wait_for_task-0.yml @@ -0,0 +1,120 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/status + response: + body: + string: '{"result":"ok","status":200,"version":"3.8.0-develop","api_version":2}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '70' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.8.0-develop + Keep-Alive: + - timeout=15, max=100 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/foreman_tasks/api/tasks?search=%28label+%3D+Actions%3A%3AKatello%3A%3AProduct%3A%3ADestroy+and+action+~+%27Test+Product%27+and+state+%3D+running%29&per_page=4294967296 + response: + body: + string: "{\n \"total\": 318,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"(label = Actions::Katello::Product::Destroy and + action ~ 'Test Product' and state = running)\",\n \"sort\": {\n \"by\": + \"started_at\",\n \"order\": \"DESC\"\n },\n \"results\": [{\"id\":\"4fea1b48-e931-4435-92e0-daa78a126c58\",\"label\":\"Actions::Katello::Product::Destroy\",\"pending\":true,\"action\":\"Delete + Product product 'Test Product'; organization 'Test Organization'\",\"username\":\"admin\",\"started_at\":\"2023-08-11 + 12:29:21 UTC\",\"ended_at\":null,\"duration\":\"2.724672\",\"state\":\"running\",\"result\":\"pending\",\"progress\":0.52,\"input\":{\"product\":{\"id\":15,\"name\":\"Test + Product\",\"label\":\"Test_Product\",\"cp_id\":\"985116879247\"},\"provider\":{\"id\":13,\"name\":\"Anonymous\"},\"organization\":{\"id\":8,\"name\":\"Test + Organization\",\"label\":\"Test_Organization\"},\"services_checked\":[\"candlepin\",\"candlepin_auth\",\"pulp3\"],\"product_id\":15,\"current_request_id\":\"dc2fc145-90b9-4130-b3b9-d561531723e7\",\"current_timezone\":\"UTC\",\"current_organization_id\":null,\"current_location_id\":null,\"current_user_id\":4},\"output\":{},\"humanized\":{\"action\":\"Delete + Product\",\"input\":[[\"product\",{\"text\":\"product 'Test Product'\",\"link\":\"/products/15/\"}],[\"organization\",{\"text\":\"organization + 'Test Organization'\",\"link\":\"/organizations/8/edit\"}]],\"output\":\"\",\"errors\":[]},\"cli_example\":null,\"start_at\":\"2023-08-11 + 12:29:21 UTC\",\"available_actions\":{\"cancellable\":true,\"resumable\":false}}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '1414' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.8.0-develop + Keep-Alive: + - timeout=15, max=99 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +version: 1 diff --git a/tests/test_playbooks/fixtures/wait_for_task-1.yml b/tests/test_playbooks/fixtures/wait_for_task-1.yml new file mode 100644 index 000000000..d1b9d3fc1 --- /dev/null +++ b/tests/test_playbooks/fixtures/wait_for_task-1.yml @@ -0,0 +1,178 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/status + response: + body: + string: '{"result":"ok","status":200,"version":"3.8.0-develop","api_version":2}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '70' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.8.0-develop + Keep-Alive: + - timeout=15, max=100 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/foreman_tasks/api/tasks/4fea1b48-e931-4435-92e0-daa78a126c58 + response: + body: + string: '{"id":"4fea1b48-e931-4435-92e0-daa78a126c58","label":"Actions::Katello::Product::Destroy","pending":true,"action":"Delete + Product product ''Test Product''; organization ''Test Organization''","username":"admin","started_at":"2023-08-11 + 12:29:21 UTC","ended_at":null,"duration":"4.75847","state":"running","result":"pending","progress":0.64,"input":{"product":{"id":15,"name":"Test + Product","label":"Test_Product","cp_id":"985116879247"},"provider":{"id":13,"name":"Anonymous"},"organization":{"id":8,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["candlepin","candlepin_auth","pulp3"],"product_id":15,"current_request_id":"dc2fc145-90b9-4130-b3b9-d561531723e7","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Delete + Product","input":[["product",{"text":"product ''Test Product''","link":"/products/15/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/8/edit"}]],"output":"","errors":[]},"cli_example":null,"start_at":"2023-08-11 + 12:29:21 UTC","available_actions":{"cancellable":true,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '1152' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.8.0-develop + Keep-Alive: + - timeout=15, max=99 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/foreman_tasks/api/tasks/4fea1b48-e931-4435-92e0-daa78a126c58 + response: + body: + string: '{"id":"4fea1b48-e931-4435-92e0-daa78a126c58","label":"Actions::Katello::Product::Destroy","pending":false,"action":"Delete + Product product ''Test Product''; organization ''Test Organization''","username":"admin","started_at":"2023-08-11 + 12:29:21 UTC","ended_at":"2023-08-11 12:29:28 UTC","duration":"6.547588","state":"stopped","result":"success","progress":1.0,"input":{"product":{"id":15,"name":"Test + Product","label":"Test_Product","cp_id":"985116879247"},"provider":{"id":13,"name":"Anonymous"},"organization":{"id":8,"name":"Test + Organization","label":"Test_Organization"},"services_checked":["candlepin","candlepin_auth","pulp3"],"product_id":15,"current_request_id":"dc2fc145-90b9-4130-b3b9-d561531723e7","current_timezone":"UTC","current_organization_id":null,"current_location_id":null,"current_user_id":4},"output":{},"humanized":{"action":"Delete + Product","input":[["product",{"text":"product ''Test Product''","link":"/products/15/"}],["organization",{"text":"organization + ''Test Organization''","link":"/organizations/8/edit"}]],"output":"","errors":[]},"cli_example":null,"start_at":"2023-08-11 + 12:29:21 UTC","available_actions":{"cancellable":false,"resumable":false}}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '1175' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.8.0-develop + Keep-Alive: + - timeout=15, max=98 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +version: 1 diff --git a/tests/test_playbooks/fixtures/wait_for_task-2.yml b/tests/test_playbooks/fixtures/wait_for_task-2.yml new file mode 100644 index 000000000..d8f78727a --- /dev/null +++ b/tests/test_playbooks/fixtures/wait_for_task-2.yml @@ -0,0 +1,113 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/status + response: + body: + string: '{"result":"ok","status":200,"version":"3.8.0-develop","api_version":2}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '70' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.8.0-develop + Keep-Alive: + - timeout=15, max=100 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/foreman_tasks/api/tasks?search=%28label+%3D+Actions%3A%3AKatello%3A%3AProduct%3A%3ADestroy+and+action+~+%27Test+Product%27+and+state+%3D+running%29&per_page=4294967296 + response: + body: + string: "{\n \"total\": 318,\n \"subtotal\": 0,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"(label = Actions::Katello::Product::Destroy and + action ~ 'Test Product' and state = running)\",\n \"sort\": {\n \"by\": + \"started_at\",\n \"order\": \"DESC\"\n },\n \"results\": []\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '261' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.8.0-develop + Keep-Alive: + - timeout=15, max=99 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +version: 1 From 803e6d6e80af8a601bad16659e4a56c55c09f435 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Fri, 11 Aug 2023 10:01:45 +0200 Subject: [PATCH 13/19] adjust examples --- plugins/modules/wait_for_task.py | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/plugins/modules/wait_for_task.py b/plugins/modules/wait_for_task.py index 48cd49476..ecca4a821 100644 --- a/plugins/modules/wait_for_task.py +++ b/plugins/modules/wait_for_task.py @@ -45,26 +45,38 @@ EXAMPLES = ''' -- name: wait for a task to finish in at least 10 seconds +- name: Wait for a task to finish theforeman.foreman.wait_for_task: server_url: "https://foreman.example.com" password: changeme username: admin - task: "{{ item }}" + task: a03ba49f-4dc2-4ad6-a48b-b271b46f3347 timeout: 60 - loop: "{{ tasks.resources }}" +- name: Sarch for previously created tasks + resource_info: + server_url: "https://foreman.example.com" + password: changeme + username: admin + resource: foreman_tasks + search: "(label = Actions::Katello::Product::Destroy and action ~ 'Test Product' and state = running)" + register: tasks + +- name: Wait for all found tasks to finish + wait_for_task: + server_url: "https://foreman.example.com" + password: changeme + username: admin + task: "{{ item }}" + timeout: 900 + loop: "{{ tasks.resources | map(attribute='id') | list }}" ''' RETURN = ''' -entity: - description: Designated task is finished +task: + description: The finished task returned: success type: dict - contains: - task: - description: The finished task - type: dict ''' From 87e1b51886ae75b60e35c3d7f40eaca287b8febf Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Wed, 9 Aug 2023 08:50:46 +0200 Subject: [PATCH 14/19] allow disabling/removing of repositories by setting the state parameter --- changelogs/fragments/repositories_role-state_override.yml | 2 ++ roles/repositories/tasks/main.yml | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 changelogs/fragments/repositories_role-state_override.yml diff --git a/changelogs/fragments/repositories_role-state_override.yml b/changelogs/fragments/repositories_role-state_override.yml new file mode 100644 index 000000000..8fb830936 --- /dev/null +++ b/changelogs/fragments/repositories_role-state_override.yml @@ -0,0 +1,2 @@ +minor_changes: + - repositories role - allow disabling/removing of repositories by setting the ``state`` parameter diff --git a/roles/repositories/tasks/main.yml b/roles/repositories/tasks/main.yml index 1ca40fbef..02e5f1af6 100644 --- a/roles/repositories/tasks/main.yml +++ b/roles/repositories/tasks/main.yml @@ -9,7 +9,7 @@ product: "{{ item.0.name }}" name: "{{ item.1.name }}" all_repositories: false - state: enabled + state: "{{ item.1.state | default(omit) }}" repositories: - releasever: "{{ item.1.releasever | default(omit) }}" basearch: "{{ item.1.basearch | default(omit) }}" @@ -26,7 +26,7 @@ organization: "{{ foreman_organization }}" label: "{{ item.1 }}" all_repositories: true - state: enabled + state: "{{ item.1.state | default(omit) }}" with_subelements: - "{{ foreman_products | selectattr('all_repositories', 'defined') | selectattr('all_repositories', 'equalto', True) | list }}" - labels @@ -41,7 +41,7 @@ name: "{{ item.name }}" label: "{{ item.label | default(omit) }}" gpg_key: "{{ item.gpg_key | default(omit) }}" - state: present + state: "{{ item.state | default(omit) }}" with_items: - "{{ foreman_products | selectattr('repositories', 'defined') | map('combine', {'repositories': '[FILTERED]'}) | list }}" @@ -81,7 +81,7 @@ ssl_ca_cert: "{{ item.1.ssl_ca_cert | default(omit) }}" ssl_client_cert: "{{ item.1.ssl_client_cert | default(omit) }}" ssl_client_key: "{{ item.1.ssl_client_key | default(omit) }}" - state: present + state: "{{ item.1.state | default(omit) }}" unprotected: "{{ item.1.unprotected | default(omit) }}" upstream_password: "{{ item.1.upstream_password | default(omit) }}" upstream_username: "{{ item.1.upstream_username | default(omit) }}" From 29af81c1f51169534badab4adf24ae910567d318 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 25 Jul 2023 09:13:37 +0200 Subject: [PATCH 15/19] don't fail when removing a content credential from a repository --- .../fragments/bz2224122-repo-org-scope.yml | 2 + plugins/module_utils/foreman_helper.py | 2 + .../test_playbooks/fixtures/repository-0.yml | 78 ++-- .../test_playbooks/fixtures/repository-1.yml | 85 ++-- .../test_playbooks/fixtures/repository-10.yml | 89 +++-- .../test_playbooks/fixtures/repository-11.yml | 115 +++--- .../test_playbooks/fixtures/repository-12.yml | 89 +++-- .../test_playbooks/fixtures/repository-13.yml | 152 ++++++-- .../test_playbooks/fixtures/repository-14.yml | 120 ++++-- .../test_playbooks/fixtures/repository-15.yml | 94 ++--- .../test_playbooks/fixtures/repository-16.yml | 121 ++---- .../test_playbooks/fixtures/repository-17.yml | 157 +++----- .../test_playbooks/fixtures/repository-18.yml | 83 ++-- .../test_playbooks/fixtures/repository-19.yml | 363 ++++++++++++++++++ .../test_playbooks/fixtures/repository-2.yml | 107 +++--- .../test_playbooks/fixtures/repository-20.yml | 299 +++++++++++++++ .../test_playbooks/fixtures/repository-3.yml | 85 ++-- .../test_playbooks/fixtures/repository-4.yml | 107 +++--- .../test_playbooks/fixtures/repository-5.yml | 107 +++--- .../test_playbooks/fixtures/repository-6.yml | 107 +++--- .../test_playbooks/fixtures/repository-7.yml | 79 ++-- .../test_playbooks/fixtures/repository-8.yml | 54 +-- .../test_playbooks/fixtures/repository-9.yml | 158 ++++---- tests/test_playbooks/repository.yml | 22 ++ 24 files changed, 1680 insertions(+), 995 deletions(-) create mode 100644 changelogs/fragments/bz2224122-repo-org-scope.yml create mode 100644 tests/test_playbooks/fixtures/repository-19.yml create mode 100644 tests/test_playbooks/fixtures/repository-20.yml diff --git a/changelogs/fragments/bz2224122-repo-org-scope.yml b/changelogs/fragments/bz2224122-repo-org-scope.yml new file mode 100644 index 000000000..81b3cba30 --- /dev/null +++ b/changelogs/fragments/bz2224122-repo-org-scope.yml @@ -0,0 +1,2 @@ +bugfixes: + - repository - don't fail when removing a content credential from a repository (https://bugzilla.redhat.com/show_bug.cgi?id=2224122) diff --git a/plugins/module_utils/foreman_helper.py b/plugins/module_utils/foreman_helper.py index 454ce8982..83a952f1b 100644 --- a/plugins/module_utils/foreman_helper.py +++ b/plugins/module_utils/foreman_helper.py @@ -842,6 +842,8 @@ def lookup_entity(self, key, params=None): return result def _lookup_entity(self, identifier, entity_spec, params=None): + if identifier is NoEntity: + return NoEntity resource_type = entity_spec['resource_type'] failsafe = entity_spec.get('failsafe', False) thin = entity_spec.get('thin', True) diff --git a/tests/test_playbooks/fixtures/repository-0.yml b/tests/test_playbooks/fixtures/repository-0.yml index 27ad6dd24..949f5466c 100644 --- a/tests/test_playbooks/fixtures/repository-0.yml +++ b/tests/test_playbooks/fixtures/repository-0.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -68,17 +68,18 @@ interactions: uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ - : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ - : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\"\ - :\"Test_Organization\",\"created_at\":\"2022-09-14 11:27:41 UTC\",\"updated_at\"\ - :\"2022-09-14 11:27:43 UTC\",\"id\":6,\"name\":\"Test Organization\",\"title\"\ - :\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2023-06-23 + 11:37:20 UTC\",\"updated_at\":\"2023-06-23 11:37:22 UTC\",\"id\":3,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '388' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -92,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -124,13 +123,14 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/organizations/6/products?search=name%3D%22Test+Product%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/organizations/3/products?search=name%3D%22Test+Product%22&per_page=4294967296 response: body: string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test - Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":21,"cp_id":"160566138145","name":"Test - Product","label":"Test_Product","description":"A happy little test product","provider_id":9,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":null,"last_sync_words":null,"organization_id":6,"organization":{"name":"Test - Organization","label":"Test_Organization","id":6},"sync_plan":null,"repository_count":0}]} + Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":1,"cp_id":"830157316014","name":"Test + Product","label":"Test_Product","description":"A happy little test product","provider_id":3,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":"2023-06-23 + 11:37:27 UTC","last_sync_words":"about 1 month","organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"sync_plan":null,"repository_count":1}]} ' headers: @@ -138,6 +138,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '659' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -149,15 +151,13 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 6; Test Organization + - 3; Test Organization Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -183,11 +183,11 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/products/21/repositories?search=name%3D%22Test+Repository%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/products/1/repositories?search=name%3D%22Test+Repository%22&per_page=4294967296 response: body: - string: '{"total":0,"subtotal":0,"selectable":0,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test - Repository\"","sort":{"by":"name","order":"asc"},"results":[]} + string: '{"total":1,"subtotal":0,"selectable":0,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test + Repository\"","sort":{"by":"name","order":"asc"},"results":[],"org_repository_count":1} ' headers: @@ -195,6 +195,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '195' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -208,13 +210,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -230,7 +230,7 @@ interactions: message: OK - request: body: '{"name": "Test Repository", "label": "just_a_test_repo", "product_id": - 21, "content_type": "yum", "url": "https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/", + 1, "content_type": "yum", "url": "https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/", "mirroring_policy": "additive"}' headers: Accept: @@ -240,7 +240,7 @@ interactions: Connection: - keep-alive Content-Length: - - '196' + - '195' Content-Type: - application/json User-Agent: @@ -249,13 +249,13 @@ interactions: uri: https://foreman.example.org/katello/api/repositories response: body: - string: ' {"relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo","promoted":false,"content_view_version_id":21,"library_instance_id":null,"last_contents_changed":"2022-09-14 - 11:27:48 UTC","organization_id":6,"organization":{"name":"Test Organization","label":"Test_Organization","id":6},"created_at":"2022-09-14 - 11:27:47 UTC","updated_at":"2022-09-14 11:27:48 UTC","backend_identifier":"9fc32a80-a890-4913-b134-068ffaaef538","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-5.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo/","version_href":"/pulp/api/v3/repositories/rpm/rpm/e00a11c1-2b5c-4141-99e5-5bab7e580892/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/62d4611d-4ae6-4c27-b6a2-60b92fed52f8/","publication_href":null,"content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"additive","id":24,"name":"Test - Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":10,"name":"Default - Organization View"},"content_view_version":{"id":21,"name":"Default Organization - View 1.0","content_view_id":10},"kt_environment":{"id":5,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1663154868357","generic_remote_options":null,"major":null,"minor":null,"product":{"id":21,"cp_id":"160566138145","name":"Test - Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null,"environment":{"id":5,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"include_tags":null,"exclude_tags":null,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":null,"name":null},"ssl_client_cert":{"id":null,"name":null},"ssl_client_key":{"id":null,"name":null},"gpg_key":{"id":null,"name":null},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false,"content_view_environments":[]} + string: ' {"relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo","promoted":false,"content_view_version_id":2,"library_instance_id":null,"last_contents_changed":"2023-07-26 + 13:04:09 UTC","organization_id":3,"organization":{"name":"Test Organization","label":"Test_Organization","id":3},"created_at":"2023-07-26 + 13:04:08 UTC","updated_at":"2023-07-26 13:04:10 UTC","backend_identifier":"d834ed96-f974-43a7-891c-9efcb358fe0b","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-9.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo/","version_href":"/pulp/api/v3/repositories/rpm/rpm/45e870d8-eaaa-4b5b-a486-a0579ea295a9/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/ebfd859f-5ad8-423b-9875-daccce87ee33/","publication_href":null,"content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"additive","id":7,"name":"Test + Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1690376649234","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null,"environment":{"id":2,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"include_tags":null,"exclude_tags":null,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"metadata_expire":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":null,"name":null},"ssl_client_cert":{"id":null,"name":null},"ssl_client_key":{"id":null,"name":null},"gpg_key":{"id":null,"name":null},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false,"content_view_environments":[]} ' headers: @@ -263,6 +263,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '2770' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -276,13 +278,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/repository-1.yml b/tests/test_playbooks/fixtures/repository-1.yml index 064e08819..68abd57e8 100644 --- a/tests/test_playbooks/fixtures/repository-1.yml +++ b/tests/test_playbooks/fixtures/repository-1.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -68,17 +68,18 @@ interactions: uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ - : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ - : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\"\ - :\"Test_Organization\",\"created_at\":\"2022-09-14 11:27:41 UTC\",\"updated_at\"\ - :\"2022-09-14 11:27:43 UTC\",\"id\":6,\"name\":\"Test Organization\",\"title\"\ - :\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2023-06-23 + 11:37:20 UTC\",\"updated_at\":\"2023-06-23 11:37:22 UTC\",\"id\":3,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '388' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -92,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -124,14 +123,14 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/organizations/6/products?search=name%3D%22Test+Product%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/organizations/3/products?search=name%3D%22Test+Product%22&per_page=4294967296 response: body: string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test - Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":21,"cp_id":"160566138145","name":"Test - Product","label":"Test_Product","description":"A happy little test product","provider_id":9,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":"2022-09-14 - 11:27:49 UTC","last_sync_words":"less than a minute","organization_id":6,"organization":{"name":"Test - Organization","label":"Test_Organization","id":6},"sync_plan":null,"repository_count":1}]} + Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":1,"cp_id":"830157316014","name":"Test + Product","label":"Test_Product","description":"A happy little test product","provider_id":3,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":"2023-07-26 + 13:04:10 UTC","last_sync_words":"less than a minute","organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"sync_plan":null,"repository_count":2}]} ' headers: @@ -139,6 +138,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '664' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -150,15 +151,13 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 6; Test Organization + - 3; Test Organization Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -184,15 +183,15 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/products/21/repositories?search=name%3D%22Test+Repository%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/products/1/repositories?search=name%3D%22Test+Repository%22&per_page=4294967296 response: body: - string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test - Repository\"","sort":{"by":"name","order":"asc"},"results":[{"backend_identifier":"9fc32a80-a890-4913-b134-068ffaaef538","relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-5.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo/","library_instance_id":null,"version_href":"/pulp/api/v3/repositories/rpm/rpm/e00a11c1-2b5c-4141-99e5-5bab7e580892/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/62d4611d-4ae6-4c27-b6a2-60b92fed52f8/","publication_href":"/pulp/api/v3/publications/rpm/rpm/2c819ace-c082-462c-ac1e-83288ac7e673/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"additive","id":24,"name":"Test - Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":10,"name":"Default - Organization View"},"content_view_version":{"id":21,"name":"Default Organization - View 1.0","content_view_id":10},"kt_environment":{"id":5,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1663154868357","generic_remote_options":null,"major":null,"minor":null,"product":{"id":21,"cp_id":"160566138145","name":"Test - Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null}]} + string: '{"total":2,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test + Repository\"","sort":{"by":"name","order":"asc"},"results":[{"backend_identifier":"d834ed96-f974-43a7-891c-9efcb358fe0b","relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-9.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo/","library_instance_id":null,"version_href":"/pulp/api/v3/repositories/rpm/rpm/45e870d8-eaaa-4b5b-a486-a0579ea295a9/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/ebfd859f-5ad8-423b-9875-daccce87ee33/","publication_href":"/pulp/api/v3/publications/rpm/rpm/191fc9bd-7708-4985-989f-049bc75a27b4/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"additive","id":7,"name":"Test + Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1690376649234","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null}],"org_repository_count":2} ' headers: @@ -200,6 +199,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '1652' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -213,13 +214,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -245,16 +244,16 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/repositories/24 + uri: https://foreman.example.org/katello/api/repositories/7 response: body: - string: ' {"relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo","promoted":false,"content_view_version_id":21,"library_instance_id":null,"last_contents_changed":"2022-09-14 - 11:27:48 UTC","organization_id":6,"organization":{"name":"Test Organization","label":"Test_Organization","id":6},"created_at":"2022-09-14 - 11:27:47 UTC","updated_at":"2022-09-14 11:27:48 UTC","backend_identifier":"9fc32a80-a890-4913-b134-068ffaaef538","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-5.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo/","version_href":"/pulp/api/v3/repositories/rpm/rpm/e00a11c1-2b5c-4141-99e5-5bab7e580892/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/62d4611d-4ae6-4c27-b6a2-60b92fed52f8/","publication_href":"/pulp/api/v3/publications/rpm/rpm/2c819ace-c082-462c-ac1e-83288ac7e673/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"additive","id":24,"name":"Test - Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":10,"name":"Default - Organization View"},"content_view_version":{"id":21,"name":"Default Organization - View 1.0","content_view_id":10},"kt_environment":{"id":5,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1663154868357","generic_remote_options":null,"major":null,"minor":null,"product":{"id":21,"cp_id":"160566138145","name":"Test - Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null,"environment":{"id":5,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"include_tags":null,"exclude_tags":null,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":null,"name":null},"ssl_client_cert":{"id":null,"name":null},"ssl_client_key":{"id":null,"name":null},"gpg_key":{"id":null,"name":null},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false} + string: ' {"relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo","promoted":false,"content_view_version_id":2,"library_instance_id":null,"last_contents_changed":"2023-07-26 + 13:04:09 UTC","organization_id":3,"organization":{"name":"Test Organization","label":"Test_Organization","id":3},"created_at":"2023-07-26 + 13:04:08 UTC","updated_at":"2023-07-26 13:04:10 UTC","backend_identifier":"d834ed96-f974-43a7-891c-9efcb358fe0b","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-9.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo/","version_href":"/pulp/api/v3/repositories/rpm/rpm/45e870d8-eaaa-4b5b-a486-a0579ea295a9/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/ebfd859f-5ad8-423b-9875-daccce87ee33/","publication_href":"/pulp/api/v3/publications/rpm/rpm/191fc9bd-7708-4985-989f-049bc75a27b4/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"additive","id":7,"name":"Test + Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1690376649234","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null,"environment":{"id":2,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"include_tags":null,"exclude_tags":null,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"metadata_expire":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":null,"name":null},"ssl_client_cert":{"id":null,"name":null},"ssl_client_key":{"id":null,"name":null},"gpg_key":{"id":null,"name":null},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false} ' headers: @@ -262,6 +261,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '2808' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -275,13 +276,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/repository-10.yml b/tests/test_playbooks/fixtures/repository-10.yml index 387c9ad2b..e5dfc6b74 100644 --- a/tests/test_playbooks/fixtures/repository-10.yml +++ b/tests/test_playbooks/fixtures/repository-10.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -68,17 +68,18 @@ interactions: uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ - : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ - : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\"\ - :\"Test_Organization\",\"created_at\":\"2022-09-14 11:27:41 UTC\",\"updated_at\"\ - :\"2022-09-14 11:27:43 UTC\",\"id\":6,\"name\":\"Test Organization\",\"title\"\ - :\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2023-06-23 + 11:37:20 UTC\",\"updated_at\":\"2023-06-23 11:37:22 UTC\",\"id\":3,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '388' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -92,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -124,14 +123,14 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/organizations/6/products?search=name%3D%22Test+Product%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/organizations/3/products?search=name%3D%22Test+Product%22&per_page=4294967296 response: body: string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test - Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":21,"cp_id":"160566138145","name":"Test - Product","label":"Test_Product","description":"A happy little test product","provider_id":9,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":"2022-09-14 - 11:28:03 UTC","last_sync_words":"less than a minute","organization_id":6,"organization":{"name":"Test - Organization","label":"Test_Organization","id":6},"sync_plan":null,"repository_count":1}]} + Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":1,"cp_id":"830157316014","name":"Test + Product","label":"Test_Product","description":"A happy little test product","provider_id":3,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":"2023-07-26 + 13:04:50 UTC","last_sync_words":"less than a minute","organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"sync_plan":null,"repository_count":2}]} ' headers: @@ -139,6 +138,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '664' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -150,15 +151,13 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 6; Test Organization + - 3; Test Organization Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -184,15 +183,15 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/products/21/repositories?search=name%3D%22Test+Repository+2%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/products/1/repositories?search=name%3D%22Test+Repository+2%22&per_page=4294967296 response: body: - string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test - Repository 2\"","sort":{"by":"name","order":"asc"},"results":[{"backend_identifier":"3e823f85-a892-4b1d-ba9f-595e56c9b167","relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo2","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-5.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo2/","library_instance_id":null,"version_href":"/pulp/api/v3/repositories/rpm/rpm/52d07ef3-f77c-4fb7-89cf-dbca9bf2d2eb/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/126c63ab-bac7-4d57-9bd3-2f53e7339727/","publication_href":"/pulp/api/v3/publications/rpm/rpm/d7892dc1-6ed2-46de-a905-1e639735b0f5/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"additive","id":25,"name":"Test - Repository 2","label":"just_a_test_repo2","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":10,"name":"Default - Organization View"},"content_view_version":{"id":21,"name":"Default Organization - View 1.0","content_view_id":10},"kt_environment":{"id":5,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1663154882204","generic_remote_options":null,"major":null,"minor":null,"product":{"id":21,"cp_id":"160566138145","name":"Test - Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo2","last_sync_words":null}]} + string: '{"total":2,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test + Repository 2\"","sort":{"by":"name","order":"asc"},"results":[{"backend_identifier":"8d0a3018-7146-4e37-805a-a92b08fe3c1f","relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo2","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-9.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo2/","library_instance_id":null,"version_href":"/pulp/api/v3/repositories/rpm/rpm/eca30b5c-cc28-4297-ba07-13aee12b9432/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/196ab34a-3a0e-41e2-aba3-ff880ecb00a0/","publication_href":"/pulp/api/v3/publications/rpm/rpm/61077244-12eb-44e4-a011-b2b0b0a15ec5/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"additive","id":8,"name":"Test + Repository 2","label":"just_a_test_repo2","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1690376688252","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo2","last_sync_words":null}],"org_repository_count":2} ' headers: @@ -200,6 +199,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '1660' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -213,13 +214,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -245,18 +244,18 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/repositories/25 + uri: https://foreman.example.org/katello/api/repositories/8 response: body: - string: ' {"relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo2","promoted":false,"content_view_version_id":21,"library_instance_id":null,"last_contents_changed":"2022-09-14 - 11:28:02 UTC","organization_id":6,"organization":{"name":"Test Organization","label":"Test_Organization","id":6},"created_at":"2022-09-14 - 11:28:01 UTC","updated_at":"2022-09-14 11:28:02 UTC","backend_identifier":"3e823f85-a892-4b1d-ba9f-595e56c9b167","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-5.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo2/","version_href":"/pulp/api/v3/repositories/rpm/rpm/52d07ef3-f77c-4fb7-89cf-dbca9bf2d2eb/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/126c63ab-bac7-4d57-9bd3-2f53e7339727/","publication_href":"/pulp/api/v3/publications/rpm/rpm/d7892dc1-6ed2-46de-a905-1e639735b0f5/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"additive","id":25,"name":"Test - Repository 2","label":"just_a_test_repo2","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":10,"name":"Default - Organization View"},"content_view_version":{"id":21,"name":"Default Organization - View 1.0","content_view_id":10},"kt_environment":{"id":5,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1663154882204","generic_remote_options":null,"major":null,"minor":null,"product":{"id":21,"cp_id":"160566138145","name":"Test - Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo2","last_sync_words":null,"environment":{"id":5,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"include_tags":null,"exclude_tags":null,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":3,"ssl_ca_cert_id":4,"ssl_client_cert_id":4,"ssl_client_key_id":4,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":4,"name":"Test - SSL Cert"},"ssl_client_cert":{"id":4,"name":"Test SSL Cert"},"ssl_client_key":{"id":4,"name":"Test - SSL Cert"},"gpg_key":{"id":3,"name":"Test GPG key"},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false} + string: ' {"relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo2","promoted":false,"content_view_version_id":2,"library_instance_id":null,"last_contents_changed":"2023-07-26 + 13:04:48 UTC","organization_id":3,"organization":{"name":"Test Organization","label":"Test_Organization","id":3},"created_at":"2023-07-26 + 13:04:47 UTC","updated_at":"2023-07-26 13:04:49 UTC","backend_identifier":"8d0a3018-7146-4e37-805a-a92b08fe3c1f","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-9.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo2/","version_href":"/pulp/api/v3/repositories/rpm/rpm/eca30b5c-cc28-4297-ba07-13aee12b9432/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/196ab34a-3a0e-41e2-aba3-ff880ecb00a0/","publication_href":"/pulp/api/v3/publications/rpm/rpm/61077244-12eb-44e4-a011-b2b0b0a15ec5/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"additive","id":8,"name":"Test + Repository 2","label":"just_a_test_repo2","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1690376688252","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo2","last_sync_words":null,"environment":{"id":2,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"include_tags":null,"exclude_tags":null,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":4,"ssl_ca_cert_id":5,"ssl_client_cert_id":5,"ssl_client_key_id":5,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"metadata_expire":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":5,"name":"Test + SSL Cert"},"ssl_client_cert":{"id":5,"name":"Test SSL Cert"},"ssl_client_key":{"id":5,"name":"Test + SSL Cert"},"gpg_key":{"id":4,"name":"Test GPG key"},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false} ' headers: @@ -264,6 +263,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '2833' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -277,13 +278,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/repository-11.yml b/tests/test_playbooks/fixtures/repository-11.yml index 98d98cf55..7e4a4d687 100644 --- a/tests/test_playbooks/fixtures/repository-11.yml +++ b/tests/test_playbooks/fixtures/repository-11.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -68,17 +68,18 @@ interactions: uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ - : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ - : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\"\ - :\"Test_Organization\",\"created_at\":\"2022-09-14 11:27:41 UTC\",\"updated_at\"\ - :\"2022-09-14 11:27:43 UTC\",\"id\":6,\"name\":\"Test Organization\",\"title\"\ - :\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2023-06-23 + 11:37:20 UTC\",\"updated_at\":\"2023-06-23 11:37:22 UTC\",\"id\":3,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '388' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -92,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -124,14 +123,14 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/organizations/6/products?search=name%3D%22Test+Product%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/organizations/3/products?search=name%3D%22Test+Product%22&per_page=4294967296 response: body: string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test - Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":21,"cp_id":"160566138145","name":"Test - Product","label":"Test_Product","description":"A happy little test product","provider_id":9,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":"2022-09-14 - 11:28:03 UTC","last_sync_words":"less than a minute","organization_id":6,"organization":{"name":"Test - Organization","label":"Test_Organization","id":6},"sync_plan":null,"repository_count":1}]} + Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":1,"cp_id":"830157316014","name":"Test + Product","label":"Test_Product","description":"A happy little test product","provider_id":3,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":"2023-07-26 + 13:04:50 UTC","last_sync_words":"less than a minute","organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"sync_plan":null,"repository_count":2}]} ' headers: @@ -139,6 +138,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '664' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -150,15 +151,13 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 6; Test Organization + - 3; Test Organization Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -184,15 +183,15 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/products/21/repositories?search=name%3D%22Test+Repository+2%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/products/1/repositories?search=name%3D%22Test+Repository+2%22&per_page=4294967296 response: body: - string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test - Repository 2\"","sort":{"by":"name","order":"asc"},"results":[{"backend_identifier":"3e823f85-a892-4b1d-ba9f-595e56c9b167","relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo2","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-5.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo2/","library_instance_id":null,"version_href":"/pulp/api/v3/repositories/rpm/rpm/52d07ef3-f77c-4fb7-89cf-dbca9bf2d2eb/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/126c63ab-bac7-4d57-9bd3-2f53e7339727/","publication_href":"/pulp/api/v3/publications/rpm/rpm/d7892dc1-6ed2-46de-a905-1e639735b0f5/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"additive","id":25,"name":"Test - Repository 2","label":"just_a_test_repo2","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":10,"name":"Default - Organization View"},"content_view_version":{"id":21,"name":"Default Organization - View 1.0","content_view_id":10},"kt_environment":{"id":5,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1663154882204","generic_remote_options":null,"major":null,"minor":null,"product":{"id":21,"cp_id":"160566138145","name":"Test - Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo2","last_sync_words":null}]} + string: '{"total":2,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test + Repository 2\"","sort":{"by":"name","order":"asc"},"results":[{"backend_identifier":"8d0a3018-7146-4e37-805a-a92b08fe3c1f","relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo2","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-9.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo2/","library_instance_id":null,"version_href":"/pulp/api/v3/repositories/rpm/rpm/eca30b5c-cc28-4297-ba07-13aee12b9432/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/196ab34a-3a0e-41e2-aba3-ff880ecb00a0/","publication_href":"/pulp/api/v3/publications/rpm/rpm/61077244-12eb-44e4-a011-b2b0b0a15ec5/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"additive","id":8,"name":"Test + Repository 2","label":"just_a_test_repo2","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1690376688252","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo2","last_sync_words":null}],"org_repository_count":2} ' headers: @@ -200,6 +199,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '1660' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -213,13 +214,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -245,18 +244,18 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/repositories/25 + uri: https://foreman.example.org/katello/api/repositories/8 response: body: - string: ' {"relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo2","promoted":false,"content_view_version_id":21,"library_instance_id":null,"last_contents_changed":"2022-09-14 - 11:28:02 UTC","organization_id":6,"organization":{"name":"Test Organization","label":"Test_Organization","id":6},"created_at":"2022-09-14 - 11:28:01 UTC","updated_at":"2022-09-14 11:28:02 UTC","backend_identifier":"3e823f85-a892-4b1d-ba9f-595e56c9b167","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-5.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo2/","version_href":"/pulp/api/v3/repositories/rpm/rpm/52d07ef3-f77c-4fb7-89cf-dbca9bf2d2eb/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/126c63ab-bac7-4d57-9bd3-2f53e7339727/","publication_href":"/pulp/api/v3/publications/rpm/rpm/d7892dc1-6ed2-46de-a905-1e639735b0f5/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"additive","id":25,"name":"Test - Repository 2","label":"just_a_test_repo2","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":10,"name":"Default - Organization View"},"content_view_version":{"id":21,"name":"Default Organization - View 1.0","content_view_id":10},"kt_environment":{"id":5,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1663154882204","generic_remote_options":null,"major":null,"minor":null,"product":{"id":21,"cp_id":"160566138145","name":"Test - Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo2","last_sync_words":null,"environment":{"id":5,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"include_tags":null,"exclude_tags":null,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":3,"ssl_ca_cert_id":4,"ssl_client_cert_id":4,"ssl_client_key_id":4,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":4,"name":"Test - SSL Cert"},"ssl_client_cert":{"id":4,"name":"Test SSL Cert"},"ssl_client_key":{"id":4,"name":"Test - SSL Cert"},"gpg_key":{"id":3,"name":"Test GPG key"},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false} + string: ' {"relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo2","promoted":false,"content_view_version_id":2,"library_instance_id":null,"last_contents_changed":"2023-07-26 + 13:04:48 UTC","organization_id":3,"organization":{"name":"Test Organization","label":"Test_Organization","id":3},"created_at":"2023-07-26 + 13:04:47 UTC","updated_at":"2023-07-26 13:04:49 UTC","backend_identifier":"8d0a3018-7146-4e37-805a-a92b08fe3c1f","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-9.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo2/","version_href":"/pulp/api/v3/repositories/rpm/rpm/eca30b5c-cc28-4297-ba07-13aee12b9432/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/196ab34a-3a0e-41e2-aba3-ff880ecb00a0/","publication_href":"/pulp/api/v3/publications/rpm/rpm/61077244-12eb-44e4-a011-b2b0b0a15ec5/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"additive","id":8,"name":"Test + Repository 2","label":"just_a_test_repo2","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1690376688252","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo2","last_sync_words":null,"environment":{"id":2,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"include_tags":null,"exclude_tags":null,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":4,"ssl_ca_cert_id":5,"ssl_client_cert_id":5,"ssl_client_key_id":5,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"metadata_expire":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":5,"name":"Test + SSL Cert"},"ssl_client_cert":{"id":5,"name":"Test SSL Cert"},"ssl_client_key":{"id":5,"name":"Test + SSL Cert"},"gpg_key":{"id":4,"name":"Test GPG key"},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false} ' headers: @@ -264,6 +263,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '2833' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -277,13 +278,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -313,18 +312,18 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: PUT - uri: https://foreman.example.org/katello/api/repositories/25 + uri: https://foreman.example.org/katello/api/repositories/8 response: body: - string: ' {"relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo2","promoted":false,"content_view_version_id":21,"library_instance_id":null,"last_contents_changed":"2022-09-14 - 11:28:02 UTC","organization_id":6,"organization":{"name":"Test Organization","label":"Test_Organization","id":6},"created_at":"2022-09-14 - 11:28:01 UTC","updated_at":"2022-09-14 11:28:04 UTC","backend_identifier":"3e823f85-a892-4b1d-ba9f-595e56c9b167","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-5.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo2/","version_href":"/pulp/api/v3/repositories/rpm/rpm/52d07ef3-f77c-4fb7-89cf-dbca9bf2d2eb/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/126c63ab-bac7-4d57-9bd3-2f53e7339727/","publication_href":"/pulp/api/v3/publications/rpm/rpm/d7892dc1-6ed2-46de-a905-1e639735b0f5/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":25,"name":"Test - Repository 2","label":"just_a_test_repo2","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":10,"name":"Default - Organization View"},"content_view_version":{"id":21,"name":"Default Organization - View 1.0","content_view_id":10},"kt_environment":{"id":5,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1663154882204","generic_remote_options":null,"major":null,"minor":null,"product":{"id":21,"cp_id":"160566138145","name":"Test - Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo2","last_sync_words":null,"environment":{"id":5,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"include_tags":null,"exclude_tags":null,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":3,"ssl_ca_cert_id":4,"ssl_client_cert_id":4,"ssl_client_key_id":4,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":4,"name":"Test - SSL Cert"},"ssl_client_cert":{"id":4,"name":"Test SSL Cert"},"ssl_client_key":{"id":4,"name":"Test - SSL Cert"},"gpg_key":{"id":3,"name":"Test GPG key"},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false} + string: ' {"relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo2","promoted":false,"content_view_version_id":2,"library_instance_id":null,"last_contents_changed":"2023-07-26 + 13:04:48 UTC","organization_id":3,"organization":{"name":"Test Organization","label":"Test_Organization","id":3},"created_at":"2023-07-26 + 13:04:47 UTC","updated_at":"2023-07-26 13:04:54 UTC","backend_identifier":"8d0a3018-7146-4e37-805a-a92b08fe3c1f","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-9.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo2/","version_href":"/pulp/api/v3/repositories/rpm/rpm/eca30b5c-cc28-4297-ba07-13aee12b9432/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/196ab34a-3a0e-41e2-aba3-ff880ecb00a0/","publication_href":"/pulp/api/v3/publications/rpm/rpm/61077244-12eb-44e4-a011-b2b0b0a15ec5/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":8,"name":"Test + Repository 2","label":"just_a_test_repo2","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1690376688252","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo2","last_sync_words":null,"environment":{"id":2,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"include_tags":null,"exclude_tags":null,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":4,"ssl_ca_cert_id":5,"ssl_client_cert_id":5,"ssl_client_key_id":5,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"metadata_expire":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":5,"name":"Test + SSL Cert"},"ssl_client_cert":{"id":5,"name":"Test SSL Cert"},"ssl_client_key":{"id":5,"name":"Test + SSL Cert"},"gpg_key":{"id":4,"name":"Test GPG key"},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false} ' headers: @@ -332,6 +331,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '2844' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -345,13 +346,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/repository-12.yml b/tests/test_playbooks/fixtures/repository-12.yml index 9c7cfb58d..019c9921f 100644 --- a/tests/test_playbooks/fixtures/repository-12.yml +++ b/tests/test_playbooks/fixtures/repository-12.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -68,17 +68,18 @@ interactions: uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ - : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ - : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\"\ - :\"Test_Organization\",\"created_at\":\"2022-09-14 11:27:41 UTC\",\"updated_at\"\ - :\"2022-09-14 11:27:43 UTC\",\"id\":6,\"name\":\"Test Organization\",\"title\"\ - :\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2023-06-23 + 11:37:20 UTC\",\"updated_at\":\"2023-06-23 11:37:22 UTC\",\"id\":3,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '388' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -92,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -124,14 +123,14 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/organizations/6/products?search=name%3D%22Test+Product%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/organizations/3/products?search=name%3D%22Test+Product%22&per_page=4294967296 response: body: string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test - Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":21,"cp_id":"160566138145","name":"Test - Product","label":"Test_Product","description":"A happy little test product","provider_id":9,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":"2022-09-14 - 11:28:06 UTC","last_sync_words":"less than a minute","organization_id":6,"organization":{"name":"Test - Organization","label":"Test_Organization","id":6},"sync_plan":null,"repository_count":1}]} + Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":1,"cp_id":"830157316014","name":"Test + Product","label":"Test_Product","description":"A happy little test product","provider_id":3,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":"2023-07-26 + 13:04:59 UTC","last_sync_words":"less than a minute","organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"sync_plan":null,"repository_count":2}]} ' headers: @@ -139,6 +138,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '664' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -150,15 +151,13 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 6; Test Organization + - 3; Test Organization Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -184,15 +183,15 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/products/21/repositories?search=name%3D%22Test+Repository+2%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/products/1/repositories?search=name%3D%22Test+Repository+2%22&per_page=4294967296 response: body: - string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test - Repository 2\"","sort":{"by":"name","order":"asc"},"results":[{"backend_identifier":"3e823f85-a892-4b1d-ba9f-595e56c9b167","relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo2","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-5.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo2/","library_instance_id":null,"version_href":"/pulp/api/v3/repositories/rpm/rpm/52d07ef3-f77c-4fb7-89cf-dbca9bf2d2eb/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/126c63ab-bac7-4d57-9bd3-2f53e7339727/","publication_href":"/pulp/api/v3/publications/rpm/rpm/dfcbc90c-6dc0-4160-a88d-8f44897ac141/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":25,"name":"Test - Repository 2","label":"just_a_test_repo2","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":10,"name":"Default - Organization View"},"content_view_version":{"id":21,"name":"Default Organization - View 1.0","content_view_id":10},"kt_environment":{"id":5,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1663154882204","generic_remote_options":null,"major":null,"minor":null,"product":{"id":21,"cp_id":"160566138145","name":"Test - Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo2","last_sync_words":null}]} + string: '{"total":2,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test + Repository 2\"","sort":{"by":"name","order":"asc"},"results":[{"backend_identifier":"8d0a3018-7146-4e37-805a-a92b08fe3c1f","relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo2","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-9.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo2/","library_instance_id":null,"version_href":"/pulp/api/v3/repositories/rpm/rpm/eca30b5c-cc28-4297-ba07-13aee12b9432/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/196ab34a-3a0e-41e2-aba3-ff880ecb00a0/","publication_href":"/pulp/api/v3/publications/rpm/rpm/1dce976a-2641-4376-887e-7ed44f6fd216/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":8,"name":"Test + Repository 2","label":"just_a_test_repo2","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1690376688252","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo2","last_sync_words":null}],"org_repository_count":2} ' headers: @@ -200,6 +199,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '1671' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -213,13 +214,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -245,18 +244,18 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/repositories/25 + uri: https://foreman.example.org/katello/api/repositories/8 response: body: - string: ' {"relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo2","promoted":false,"content_view_version_id":21,"library_instance_id":null,"last_contents_changed":"2022-09-14 - 11:28:02 UTC","organization_id":6,"organization":{"name":"Test Organization","label":"Test_Organization","id":6},"created_at":"2022-09-14 - 11:28:01 UTC","updated_at":"2022-09-14 11:28:04 UTC","backend_identifier":"3e823f85-a892-4b1d-ba9f-595e56c9b167","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-5.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo2/","version_href":"/pulp/api/v3/repositories/rpm/rpm/52d07ef3-f77c-4fb7-89cf-dbca9bf2d2eb/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/126c63ab-bac7-4d57-9bd3-2f53e7339727/","publication_href":"/pulp/api/v3/publications/rpm/rpm/dfcbc90c-6dc0-4160-a88d-8f44897ac141/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":25,"name":"Test - Repository 2","label":"just_a_test_repo2","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":10,"name":"Default - Organization View"},"content_view_version":{"id":21,"name":"Default Organization - View 1.0","content_view_id":10},"kt_environment":{"id":5,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1663154882204","generic_remote_options":null,"major":null,"minor":null,"product":{"id":21,"cp_id":"160566138145","name":"Test - Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo2","last_sync_words":null,"environment":{"id":5,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"include_tags":null,"exclude_tags":null,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":3,"ssl_ca_cert_id":4,"ssl_client_cert_id":4,"ssl_client_key_id":4,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":4,"name":"Test - SSL Cert"},"ssl_client_cert":{"id":4,"name":"Test SSL Cert"},"ssl_client_key":{"id":4,"name":"Test - SSL Cert"},"gpg_key":{"id":3,"name":"Test GPG key"},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false} + string: ' {"relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo2","promoted":false,"content_view_version_id":2,"library_instance_id":null,"last_contents_changed":"2023-07-26 + 13:04:48 UTC","organization_id":3,"organization":{"name":"Test Organization","label":"Test_Organization","id":3},"created_at":"2023-07-26 + 13:04:47 UTC","updated_at":"2023-07-26 13:04:54 UTC","backend_identifier":"8d0a3018-7146-4e37-805a-a92b08fe3c1f","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-9.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo2/","version_href":"/pulp/api/v3/repositories/rpm/rpm/eca30b5c-cc28-4297-ba07-13aee12b9432/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/196ab34a-3a0e-41e2-aba3-ff880ecb00a0/","publication_href":"/pulp/api/v3/publications/rpm/rpm/1dce976a-2641-4376-887e-7ed44f6fd216/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":8,"name":"Test + Repository 2","label":"just_a_test_repo2","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1690376688252","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo2","last_sync_words":null,"environment":{"id":2,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"include_tags":null,"exclude_tags":null,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":4,"ssl_ca_cert_id":5,"ssl_client_cert_id":5,"ssl_client_key_id":5,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"metadata_expire":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":5,"name":"Test + SSL Cert"},"ssl_client_cert":{"id":5,"name":"Test SSL Cert"},"ssl_client_key":{"id":5,"name":"Test + SSL Cert"},"gpg_key":{"id":4,"name":"Test GPG key"},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false} ' headers: @@ -264,6 +263,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '2844' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -277,13 +278,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/repository-13.yml b/tests/test_playbooks/fixtures/repository-13.yml index eea9a14e1..aa8eb151c 100644 --- a/tests/test_playbooks/fixtures/repository-13.yml +++ b/tests/test_playbooks/fixtures/repository-13.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -68,17 +68,18 @@ interactions: uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ - : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ - : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\"\ - :\"Test_Organization\",\"created_at\":\"2022-09-14 11:27:41 UTC\",\"updated_at\"\ - :\"2022-09-14 11:27:43 UTC\",\"id\":6,\"name\":\"Test Organization\",\"title\"\ - :\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2023-06-23 + 11:37:20 UTC\",\"updated_at\":\"2023-06-23 11:37:22 UTC\",\"id\":3,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '388' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -92,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -124,14 +123,14 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/organizations/6/products?search=name%3D%22Test+Product%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/organizations/3/products?search=name%3D%22Test+Product%22&per_page=4294967296 response: body: string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test - Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":21,"cp_id":"160566138145","name":"Test - Product","label":"Test_Product","description":"A happy little test product","provider_id":9,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":"2022-09-14 - 11:28:06 UTC","last_sync_words":"less than a minute","organization_id":6,"organization":{"name":"Test - Organization","label":"Test_Organization","id":6},"sync_plan":null,"repository_count":1}]} + Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":1,"cp_id":"830157316014","name":"Test + Product","label":"Test_Product","description":"A happy little test product","provider_id":3,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":"2023-07-26 + 13:04:59 UTC","last_sync_words":"less than a minute","organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"sync_plan":null,"repository_count":2}]} ' headers: @@ -139,6 +138,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '664' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -150,15 +151,13 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 6; Test Organization + - 3; Test Organization Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -184,15 +183,15 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/products/21/repositories?search=name%3D%22Test+Repository+2%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/products/1/repositories?search=name%3D%22Test+Repository+2%22&per_page=4294967296 response: body: - string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test - Repository 2\"","sort":{"by":"name","order":"asc"},"results":[{"backend_identifier":"3e823f85-a892-4b1d-ba9f-595e56c9b167","relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo2","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-5.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo2/","library_instance_id":null,"version_href":"/pulp/api/v3/repositories/rpm/rpm/52d07ef3-f77c-4fb7-89cf-dbca9bf2d2eb/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/126c63ab-bac7-4d57-9bd3-2f53e7339727/","publication_href":"/pulp/api/v3/publications/rpm/rpm/dfcbc90c-6dc0-4160-a88d-8f44897ac141/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":25,"name":"Test - Repository 2","label":"just_a_test_repo2","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":10,"name":"Default - Organization View"},"content_view_version":{"id":21,"name":"Default Organization - View 1.0","content_view_id":10},"kt_environment":{"id":5,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1663154882204","generic_remote_options":null,"major":null,"minor":null,"product":{"id":21,"cp_id":"160566138145","name":"Test - Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo2","last_sync_words":null}]} + string: '{"total":2,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test + Repository 2\"","sort":{"by":"name","order":"asc"},"results":[{"backend_identifier":"8d0a3018-7146-4e37-805a-a92b08fe3c1f","relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo2","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-9.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo2/","library_instance_id":null,"version_href":"/pulp/api/v3/repositories/rpm/rpm/eca30b5c-cc28-4297-ba07-13aee12b9432/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/196ab34a-3a0e-41e2-aba3-ff880ecb00a0/","publication_href":"/pulp/api/v3/publications/rpm/rpm/1dce976a-2641-4376-887e-7ed44f6fd216/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":8,"name":"Test + Repository 2","label":"just_a_test_repo2","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1690376688252","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo2","last_sync_words":null}],"org_repository_count":2} ' headers: @@ -200,6 +199,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '1671' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -213,13 +214,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -242,15 +241,21 @@ interactions: - gzip, deflate Connection: - keep-alive - Content-Length: - - '0' User-Agent: - apypie (https://github.com/Apipie/apypie) - method: DELETE - uri: https://foreman.example.org/katello/api/repositories/25 + method: GET + uri: https://foreman.example.org/katello/api/repositories/8 response: body: - string: ' {} + string: ' {"relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo2","promoted":false,"content_view_version_id":2,"library_instance_id":null,"last_contents_changed":"2023-07-26 + 13:04:48 UTC","organization_id":3,"organization":{"name":"Test Organization","label":"Test_Organization","id":3},"created_at":"2023-07-26 + 13:04:47 UTC","updated_at":"2023-07-26 13:04:54 UTC","backend_identifier":"8d0a3018-7146-4e37-805a-a92b08fe3c1f","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-9.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo2/","version_href":"/pulp/api/v3/repositories/rpm/rpm/eca30b5c-cc28-4297-ba07-13aee12b9432/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/196ab34a-3a0e-41e2-aba3-ff880ecb00a0/","publication_href":"/pulp/api/v3/publications/rpm/rpm/1dce976a-2641-4376-887e-7ed44f6fd216/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":8,"name":"Test + Repository 2","label":"just_a_test_repo2","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1690376688252","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo2","last_sync_words":null,"environment":{"id":2,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"include_tags":null,"exclude_tags":null,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":4,"ssl_ca_cert_id":5,"ssl_client_cert_id":5,"ssl_client_key_id":5,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"metadata_expire":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":5,"name":"Test + SSL Cert"},"ssl_client_cert":{"id":5,"name":"Test SSL Cert"},"ssl_client_key":{"id":5,"name":"Test + SSL Cert"},"gpg_key":{"id":4,"name":"Test GPG key"},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false} ' headers: @@ -258,6 +263,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '2844' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -271,13 +278,78 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: '{"gpg_key_id": null, "ssl_ca_cert_id": null, "ssl_client_cert_id": null, + "ssl_client_key_id": null}' + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '99' + Content-Type: + - application/json + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: PUT + uri: https://foreman.example.org/katello/api/repositories/8 + response: + body: + string: ' {"relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo2","promoted":false,"content_view_version_id":2,"library_instance_id":null,"last_contents_changed":"2023-07-26 + 13:04:48 UTC","organization_id":3,"organization":{"name":"Test Organization","label":"Test_Organization","id":3},"created_at":"2023-07-26 + 13:04:47 UTC","updated_at":"2023-07-26 13:05:03 UTC","backend_identifier":"8d0a3018-7146-4e37-805a-a92b08fe3c1f","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-9.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo2/","version_href":"/pulp/api/v3/repositories/rpm/rpm/eca30b5c-cc28-4297-ba07-13aee12b9432/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/196ab34a-3a0e-41e2-aba3-ff880ecb00a0/","publication_href":"/pulp/api/v3/publications/rpm/rpm/1dce976a-2641-4376-887e-7ed44f6fd216/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":8,"name":"Test + Repository 2","label":"just_a_test_repo2","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1690376688252","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo2","last_sync_words":null,"environment":{"id":2,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"include_tags":null,"exclude_tags":null,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"metadata_expire":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":null,"name":null},"ssl_client_cert":{"id":null,"name":null},"ssl_client_key":{"id":null,"name":null},"gpg_key":{"id":null,"name":null},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '2825' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=95 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/repository-14.yml b/tests/test_playbooks/fixtures/repository-14.yml index 17cdecdf3..580ef1e92 100644 --- a/tests/test_playbooks/fixtures/repository-14.yml +++ b/tests/test_playbooks/fixtures/repository-14.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -68,17 +68,18 @@ interactions: uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ - : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ - : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\"\ - :\"Test_Organization\",\"created_at\":\"2022-09-14 11:27:41 UTC\",\"updated_at\"\ - :\"2022-09-14 11:27:43 UTC\",\"id\":6,\"name\":\"Test Organization\",\"title\"\ - :\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2023-06-23 + 11:37:20 UTC\",\"updated_at\":\"2023-06-23 11:37:22 UTC\",\"id\":3,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '388' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -92,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -124,13 +123,14 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/organizations/6/products?search=name%3D%22Test+Product%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/organizations/3/products?search=name%3D%22Test+Product%22&per_page=4294967296 response: body: string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test - Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":21,"cp_id":"160566138145","name":"Test - Product","label":"Test_Product","description":"A happy little test product","provider_id":9,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":null,"last_sync_words":null,"organization_id":6,"organization":{"name":"Test - Organization","label":"Test_Organization","id":6},"sync_plan":null,"repository_count":0}]} + Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":1,"cp_id":"830157316014","name":"Test + Product","label":"Test_Product","description":"A happy little test product","provider_id":3,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":"2023-07-26 + 13:05:07 UTC","last_sync_words":"less than a minute","organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"sync_plan":null,"repository_count":2}]} ' headers: @@ -138,6 +138,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '664' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -149,15 +151,13 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 6; Test Organization + - 3; Test Organization Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -183,11 +183,15 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/products/21/repositories?search=name%3D%22Test+Repository+2%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/products/1/repositories?search=name%3D%22Test+Repository+2%22&per_page=4294967296 response: body: - string: '{"total":0,"subtotal":0,"selectable":0,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test - Repository 2\"","sort":{"by":"name","order":"asc"},"results":[]} + string: '{"total":2,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test + Repository 2\"","sort":{"by":"name","order":"asc"},"results":[{"backend_identifier":"8d0a3018-7146-4e37-805a-a92b08fe3c1f","relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo2","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-9.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo2/","library_instance_id":null,"version_href":"/pulp/api/v3/repositories/rpm/rpm/eca30b5c-cc28-4297-ba07-13aee12b9432/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/196ab34a-3a0e-41e2-aba3-ff880ecb00a0/","publication_href":"/pulp/api/v3/publications/rpm/rpm/99b58f4a-2ba3-4d64-97b7-e28a50d6066c/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":8,"name":"Test + Repository 2","label":"just_a_test_repo2","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1690376688252","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo2","last_sync_words":null}],"org_repository_count":2} ' headers: @@ -195,6 +199,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '1671' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -208,13 +214,73 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/katello/api/repositories/8 + response: + body: + string: ' {"relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo2","promoted":false,"content_view_version_id":2,"library_instance_id":null,"last_contents_changed":"2023-07-26 + 13:04:48 UTC","organization_id":3,"organization":{"name":"Test Organization","label":"Test_Organization","id":3},"created_at":"2023-07-26 + 13:04:47 UTC","updated_at":"2023-07-26 13:05:03 UTC","backend_identifier":"8d0a3018-7146-4e37-805a-a92b08fe3c1f","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-9.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo2/","version_href":"/pulp/api/v3/repositories/rpm/rpm/eca30b5c-cc28-4297-ba07-13aee12b9432/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/196ab34a-3a0e-41e2-aba3-ff880ecb00a0/","publication_href":"/pulp/api/v3/publications/rpm/rpm/99b58f4a-2ba3-4d64-97b7-e28a50d6066c/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":8,"name":"Test + Repository 2","label":"just_a_test_repo2","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1690376688252","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo2","last_sync_words":null,"environment":{"id":2,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"include_tags":null,"exclude_tags":null,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"metadata_expire":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":null,"name":null},"ssl_client_cert":{"id":null,"name":null},"ssl_client_key":{"id":null,"name":null},"gpg_key":{"id":null,"name":null},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '2825' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=96 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/repository-15.yml b/tests/test_playbooks/fixtures/repository-15.yml index e0c127b9c..32c4150ef 100644 --- a/tests/test_playbooks/fixtures/repository-15.yml +++ b/tests/test_playbooks/fixtures/repository-15.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -68,17 +68,18 @@ interactions: uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ - : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ - : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\"\ - :\"Test_Organization\",\"created_at\":\"2022-09-14 11:27:41 UTC\",\"updated_at\"\ - :\"2022-09-14 11:27:43 UTC\",\"id\":6,\"name\":\"Test Organization\",\"title\"\ - :\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2023-06-23 + 11:37:20 UTC\",\"updated_at\":\"2023-06-23 11:37:22 UTC\",\"id\":3,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '388' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -92,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -124,13 +123,14 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/organizations/6/products?search=name%3D%22Test+Product%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/organizations/3/products?search=name%3D%22Test+Product%22&per_page=4294967296 response: body: string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test - Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":21,"cp_id":"160566138145","name":"Test - Product","label":"Test_Product","description":"A happy little test product","provider_id":9,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":null,"last_sync_words":null,"organization_id":6,"organization":{"name":"Test - Organization","label":"Test_Organization","id":6},"sync_plan":null,"repository_count":0}]} + Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":1,"cp_id":"830157316014","name":"Test + Product","label":"Test_Product","description":"A happy little test product","provider_id":3,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":"2023-07-26 + 13:05:07 UTC","last_sync_words":"less than a minute","organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"sync_plan":null,"repository_count":2}]} ' headers: @@ -138,6 +138,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '664' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -149,15 +151,13 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 6; Test Organization + - 3; Test Organization Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -183,11 +183,15 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/products/21/repositories?search=name%3D%22Test+Docker+Repository%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/products/1/repositories?search=name%3D%22Test+Repository+2%22&per_page=4294967296 response: body: - string: '{"total":0,"subtotal":0,"selectable":0,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test - Docker Repository\"","sort":{"by":"name","order":"asc"},"results":[]} + string: '{"total":2,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test + Repository 2\"","sort":{"by":"name","order":"asc"},"results":[{"backend_identifier":"8d0a3018-7146-4e37-805a-a92b08fe3c1f","relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo2","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-9.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo2/","library_instance_id":null,"version_href":"/pulp/api/v3/repositories/rpm/rpm/eca30b5c-cc28-4297-ba07-13aee12b9432/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/196ab34a-3a0e-41e2-aba3-ff880ecb00a0/","publication_href":"/pulp/api/v3/publications/rpm/rpm/99b58f4a-2ba3-4d64-97b7-e28a50d6066c/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":8,"name":"Test + Repository 2","label":"just_a_test_repo2","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1690376688252","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo2","last_sync_words":null}],"org_repository_count":2} ' headers: @@ -195,6 +199,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '1671' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -208,13 +214,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -229,9 +233,7 @@ interactions: code: 200 message: OK - request: - body: '{"name": "Test Docker Repository", "label": "just_a_test_repo", "product_id": - 21, "content_type": "docker", "url": "https://docker.io", "docker_upstream_name": - "busybox", "include_tags": ["latest"]}' + body: null headers: Accept: - application/json;version=2 @@ -240,22 +242,20 @@ interactions: Connection: - keep-alive Content-Length: - - '198' - Content-Type: - - application/json + - '0' User-Agent: - apypie (https://github.com/Apipie/apypie) - method: POST - uri: https://foreman.example.org/katello/api/repositories + method: DELETE + uri: https://foreman.example.org/katello/api/repositories/8 response: body: - string: ' {"relative_path":"test_organization-test_product-just_a_test_repo","promoted":false,"content_view_version_id":21,"library_instance_id":null,"last_contents_changed":"2022-09-14 - 11:28:10 UTC","organization_id":6,"organization":{"name":"Test Organization","label":"Test_Organization","id":6},"created_at":"2022-09-14 - 11:28:10 UTC","updated_at":"2022-09-14 11:28:11 UTC","backend_identifier":"5b66b707-8e93-47c7-a9b4-628b447a4019","container_repository_name":"test_organization-test_product-just_a_test_repo","full_path":"centos8-stream-katello-4-5.tanso.example.com/test_organization-test_product-just_a_test_repo","version_href":"/pulp/api/v3/repositories/container/container/7e36ddc8-37ad-4c2c-bc23-068e85c9280a/versions/0/","remote_href":"/pulp/api/v3/remotes/container/container/d2a45bdf-015d-4335-85f5-69899fb6a7a0/","publication_href":null,"content_counts":{"docker_manifest":0,"docker_manifest_list":0,"docker_tag":0},"mirroring_policy":"mirror_content_only","id":26,"name":"Test - Docker Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":10,"name":"Default - Organization View"},"content_view_version":{"id":21,"name":"Default Organization - View 1.0","content_view_id":10},"kt_environment":{"id":5,"name":"Library"},"content_type":"docker","url":"https://docker.io","arch":"noarch","os_versions":null,"content_id":"1663154890793","generic_remote_options":null,"major":null,"minor":null,"product":{"id":21,"cp_id":"160566138145","name":"Test - Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null,"environment":{"id":5,"registry_unauthenticated_pull":false},"docker_upstream_name":"busybox","docker_tags_whitelist":["latest"],"include_tags":["latest"],"exclude_tags":["*-source"],"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":null,"name":null},"ssl_client_cert":{"id":null,"name":null},"ssl_client_key":{"id":null,"name":null},"gpg_key":{"id":null,"name":null},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false,"content_view_environments":[]} + string: ' {"relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo2","promoted":false,"content_view_version_id":2,"library_instance_id":null,"last_contents_changed":"2023-07-26 + 13:04:48 UTC","organization_id":3,"organization":{"name":"Test Organization","label":"Test_Organization","id":3},"created_at":"2023-07-26 + 13:04:47 UTC","updated_at":"2023-07-26 13:05:03 UTC","backend_identifier":"8d0a3018-7146-4e37-805a-a92b08fe3c1f","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-9.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo2/","version_href":"/pulp/api/v3/repositories/rpm/rpm/eca30b5c-cc28-4297-ba07-13aee12b9432/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/196ab34a-3a0e-41e2-aba3-ff880ecb00a0/","publication_href":"/pulp/api/v3/publications/rpm/rpm/99b58f4a-2ba3-4d64-97b7-e28a50d6066c/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":8,"name":"Test + Repository 2","label":"just_a_test_repo2","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1690376688252","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":null,"last_sync_words":null,"environment":{"id":2,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"include_tags":null,"exclude_tags":null,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"metadata_expire":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":null,"name":null},"ssl_client_cert":{"id":null,"name":null},"ssl_client_key":{"id":null,"name":null},"gpg_key":{"id":null,"name":null},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false,"content_view_environments":[]} ' headers: @@ -263,6 +263,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '2810' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -276,13 +278,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -294,6 +294,6 @@ interactions: X-XSS-Protection: - 1; mode=block status: - code: 201 - message: Created + code: 200 + message: OK version: 1 diff --git a/tests/test_playbooks/fixtures/repository-16.yml b/tests/test_playbooks/fixtures/repository-16.yml index 7548c3610..cbaac9fb8 100644 --- a/tests/test_playbooks/fixtures/repository-16.yml +++ b/tests/test_playbooks/fixtures/repository-16.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -68,17 +68,18 @@ interactions: uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ - : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ - : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\"\ - :\"Test_Organization\",\"created_at\":\"2022-09-14 11:27:41 UTC\",\"updated_at\"\ - :\"2022-09-14 11:27:43 UTC\",\"id\":6,\"name\":\"Test Organization\",\"title\"\ - :\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2023-06-23 + 11:37:20 UTC\",\"updated_at\":\"2023-06-23 11:37:22 UTC\",\"id\":3,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '388' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -92,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -124,14 +123,14 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/organizations/6/products?search=name%3D%22Test+Product%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/organizations/3/products?search=name%3D%22Test+Product%22&per_page=4294967296 response: body: string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test - Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":21,"cp_id":"160566138145","name":"Test - Product","label":"Test_Product","description":"A happy little test product","provider_id":9,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":"2022-09-14 - 11:28:10 UTC","last_sync_words":"less than a minute","organization_id":6,"organization":{"name":"Test - Organization","label":"Test_Organization","id":6},"sync_plan":null,"repository_count":1}]} + Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":1,"cp_id":"830157316014","name":"Test + Product","label":"Test_Product","description":"A happy little test product","provider_id":3,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":"2023-06-23 + 11:37:27 UTC","last_sync_words":"about 1 month","organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"sync_plan":null,"repository_count":1}]} ' headers: @@ -139,6 +138,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '659' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -150,15 +151,13 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 6; Test Organization + - 3; Test Organization Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -184,15 +183,11 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/products/21/repositories?search=name%3D%22Test+Docker+Repository%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/products/1/repositories?search=name%3D%22Test+Repository+2%22&per_page=4294967296 response: body: - string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test - Docker Repository\"","sort":{"by":"name","order":"asc"},"results":[{"backend_identifier":"5b66b707-8e93-47c7-a9b4-628b447a4019","relative_path":"test_organization-test_product-just_a_test_repo","container_repository_name":"test_organization-test_product-just_a_test_repo","full_path":"centos8-stream-katello-4-5.tanso.example.com/test_organization-test_product-just_a_test_repo","library_instance_id":null,"version_href":"/pulp/api/v3/repositories/container/container/7e36ddc8-37ad-4c2c-bc23-068e85c9280a/versions/0/","remote_href":"/pulp/api/v3/remotes/container/container/d2a45bdf-015d-4335-85f5-69899fb6a7a0/","publication_href":null,"content_counts":{"docker_manifest":0,"docker_manifest_list":0,"docker_tag":0},"mirroring_policy":"mirror_content_only","id":26,"name":"Test - Docker Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":10,"name":"Default - Organization View"},"content_view_version":{"id":21,"name":"Default Organization - View 1.0","content_view_id":10},"kt_environment":{"id":5,"name":"Library"},"content_type":"docker","url":"https://docker.io","arch":"noarch","os_versions":null,"content_id":"1663154890793","generic_remote_options":null,"major":null,"minor":null,"product":{"id":21,"cp_id":"160566138145","name":"Test - Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null}]} + string: '{"total":1,"subtotal":0,"selectable":0,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test + Repository 2\"","sort":{"by":"name","order":"asc"},"results":[],"org_repository_count":1} ' headers: @@ -200,6 +195,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '197' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -213,75 +210,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Frame-Options: - - sameorigin - X-Permitted-Cross-Domain-Policies: - - none - X-XSS-Protection: - - 1; mode=block - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json;version=2 - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - apypie (https://github.com/Apipie/apypie) - method: GET - uri: https://foreman.example.org/katello/api/repositories/26 - response: - body: - string: ' {"relative_path":"test_organization-test_product-just_a_test_repo","promoted":false,"content_view_version_id":21,"library_instance_id":null,"last_contents_changed":"2022-09-14 - 11:28:10 UTC","organization_id":6,"organization":{"name":"Test Organization","label":"Test_Organization","id":6},"created_at":"2022-09-14 - 11:28:10 UTC","updated_at":"2022-09-14 11:28:11 UTC","backend_identifier":"5b66b707-8e93-47c7-a9b4-628b447a4019","container_repository_name":"test_organization-test_product-just_a_test_repo","full_path":"centos8-stream-katello-4-5.tanso.example.com/test_organization-test_product-just_a_test_repo","version_href":"/pulp/api/v3/repositories/container/container/7e36ddc8-37ad-4c2c-bc23-068e85c9280a/versions/0/","remote_href":"/pulp/api/v3/remotes/container/container/d2a45bdf-015d-4335-85f5-69899fb6a7a0/","publication_href":null,"content_counts":{"docker_manifest":0,"docker_manifest_list":0,"docker_tag":0},"mirroring_policy":"mirror_content_only","id":26,"name":"Test - Docker Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":10,"name":"Default - Organization View"},"content_view_version":{"id":21,"name":"Default Organization - View 1.0","content_view_id":10},"kt_environment":{"id":5,"name":"Library"},"content_type":"docker","url":"https://docker.io","arch":"noarch","os_versions":null,"content_id":"1663154890793","generic_remote_options":null,"major":null,"minor":null,"product":{"id":21,"cp_id":"160566138145","name":"Test - Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null,"environment":{"id":5,"registry_unauthenticated_pull":false},"docker_upstream_name":"busybox","docker_tags_whitelist":["latest"],"include_tags":["latest"],"exclude_tags":["*-source"],"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":null,"name":null},"ssl_client_cert":{"id":null,"name":null},"ssl_client_key":{"id":null,"name":null},"gpg_key":{"id":null,"name":null},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false} - - ' - headers: - Cache-Control: - - max-age=0, private, must-revalidate - Connection: - - Keep-Alive - Content-Security-Policy: - - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; - img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; - style-src ''unsafe-inline'' ''self''' - Content-Type: - - application/json; charset=utf-8 - Foreman_api_version: - - '2' - Foreman_current_location: - - ; ANY - Foreman_current_organization: - - ; ANY - Foreman_version: - - 3.3.0 - Keep-Alive: - - timeout=15, max=96 - Strict-Transport-Security: - - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/repository-17.yml b/tests/test_playbooks/fixtures/repository-17.yml index 0fe3023d3..e87d067e7 100644 --- a/tests/test_playbooks/fixtures/repository-17.yml +++ b/tests/test_playbooks/fixtures/repository-17.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -68,17 +68,18 @@ interactions: uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ - : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ - : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\"\ - :\"Test_Organization\",\"created_at\":\"2022-09-14 11:27:41 UTC\",\"updated_at\"\ - :\"2022-09-14 11:27:43 UTC\",\"id\":6,\"name\":\"Test Organization\",\"title\"\ - :\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2023-06-23 + 11:37:20 UTC\",\"updated_at\":\"2023-06-23 11:37:22 UTC\",\"id\":3,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '388' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -92,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -124,14 +123,14 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/organizations/6/products?search=name%3D%22Test+Product%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/organizations/3/products?search=name%3D%22Test+Product%22&per_page=4294967296 response: body: string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test - Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":21,"cp_id":"160566138145","name":"Test - Product","label":"Test_Product","description":"A happy little test product","provider_id":9,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":"2022-09-14 - 11:28:10 UTC","last_sync_words":"less than a minute","organization_id":6,"organization":{"name":"Test - Organization","label":"Test_Organization","id":6},"sync_plan":null,"repository_count":1}]} + Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":1,"cp_id":"830157316014","name":"Test + Product","label":"Test_Product","description":"A happy little test product","provider_id":3,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":"2023-06-23 + 11:37:27 UTC","last_sync_words":"about 1 month","organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"sync_plan":null,"repository_count":1}]} ' headers: @@ -139,6 +138,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '659' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -150,15 +151,13 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 6; Test Organization + - 3; Test Organization Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -184,15 +183,11 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/products/21/repositories?search=name%3D%22Test+Docker+Repository%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/products/1/repositories?search=name%3D%22Test+Docker+Repository%22&per_page=4294967296 response: body: - string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test - Docker Repository\"","sort":{"by":"name","order":"asc"},"results":[{"backend_identifier":"5b66b707-8e93-47c7-a9b4-628b447a4019","relative_path":"test_organization-test_product-just_a_test_repo","container_repository_name":"test_organization-test_product-just_a_test_repo","full_path":"centos8-stream-katello-4-5.tanso.example.com/test_organization-test_product-just_a_test_repo","library_instance_id":null,"version_href":"/pulp/api/v3/repositories/container/container/7e36ddc8-37ad-4c2c-bc23-068e85c9280a/versions/0/","remote_href":"/pulp/api/v3/remotes/container/container/d2a45bdf-015d-4335-85f5-69899fb6a7a0/","publication_href":null,"content_counts":{"docker_manifest":0,"docker_manifest_list":0,"docker_tag":0},"mirroring_policy":"mirror_content_only","id":26,"name":"Test - Docker Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":10,"name":"Default - Organization View"},"content_view_version":{"id":21,"name":"Default Organization - View 1.0","content_view_id":10},"kt_environment":{"id":5,"name":"Library"},"content_type":"docker","url":"https://docker.io","arch":"noarch","os_versions":null,"content_id":"1663154890793","generic_remote_options":null,"major":null,"minor":null,"product":{"id":21,"cp_id":"160566138145","name":"Test - Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null}]} + string: '{"total":1,"subtotal":0,"selectable":0,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test + Docker Repository\"","sort":{"by":"name","order":"asc"},"results":[],"org_repository_count":1} ' headers: @@ -200,6 +195,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '202' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -213,75 +210,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked - X-Content-Type-Options: - - nosniff - X-Download-Options: - - noopen - X-Frame-Options: - - sameorigin - X-Permitted-Cross-Domain-Policies: - - none - X-XSS-Protection: - - 1; mode=block - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json;version=2 - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - apypie (https://github.com/Apipie/apypie) - method: GET - uri: https://foreman.example.org/katello/api/repositories/26 - response: - body: - string: ' {"relative_path":"test_organization-test_product-just_a_test_repo","promoted":false,"content_view_version_id":21,"library_instance_id":null,"last_contents_changed":"2022-09-14 - 11:28:10 UTC","organization_id":6,"organization":{"name":"Test Organization","label":"Test_Organization","id":6},"created_at":"2022-09-14 - 11:28:10 UTC","updated_at":"2022-09-14 11:28:11 UTC","backend_identifier":"5b66b707-8e93-47c7-a9b4-628b447a4019","container_repository_name":"test_organization-test_product-just_a_test_repo","full_path":"centos8-stream-katello-4-5.tanso.example.com/test_organization-test_product-just_a_test_repo","version_href":"/pulp/api/v3/repositories/container/container/7e36ddc8-37ad-4c2c-bc23-068e85c9280a/versions/0/","remote_href":"/pulp/api/v3/remotes/container/container/d2a45bdf-015d-4335-85f5-69899fb6a7a0/","publication_href":null,"content_counts":{"docker_manifest":0,"docker_manifest_list":0,"docker_tag":0},"mirroring_policy":"mirror_content_only","id":26,"name":"Test - Docker Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":10,"name":"Default - Organization View"},"content_view_version":{"id":21,"name":"Default Organization - View 1.0","content_view_id":10},"kt_environment":{"id":5,"name":"Library"},"content_type":"docker","url":"https://docker.io","arch":"noarch","os_versions":null,"content_id":"1663154890793","generic_remote_options":null,"major":null,"minor":null,"product":{"id":21,"cp_id":"160566138145","name":"Test - Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null,"environment":{"id":5,"registry_unauthenticated_pull":false},"docker_upstream_name":"busybox","docker_tags_whitelist":["latest"],"include_tags":["latest"],"exclude_tags":["*-source"],"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":null,"name":null},"ssl_client_cert":{"id":null,"name":null},"ssl_client_key":{"id":null,"name":null},"gpg_key":{"id":null,"name":null},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false} - - ' - headers: - Cache-Control: - - max-age=0, private, must-revalidate - Connection: - - Keep-Alive - Content-Security-Policy: - - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; - img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; - style-src ''unsafe-inline'' ''self''' - Content-Type: - - application/json; charset=utf-8 - Foreman_api_version: - - '2' - Foreman_current_location: - - ; ANY - Foreman_current_organization: - - ; ANY - Foreman_version: - - 3.3.0 - Keep-Alive: - - timeout=15, max=96 - Strict-Transport-Security: - - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -296,7 +229,9 @@ interactions: code: 200 message: OK - request: - body: '{"upstream_username": "dockeruser", "upstream_password": "dockerpass"}' + body: '{"name": "Test Docker Repository", "label": "just_a_test_repo", "product_id": + 1, "content_type": "docker", "url": "https://docker.io", "docker_upstream_name": + "busybox", "include_tags": ["latest"]}' headers: Accept: - application/json;version=2 @@ -305,22 +240,22 @@ interactions: Connection: - keep-alive Content-Length: - - '70' + - '197' Content-Type: - application/json User-Agent: - apypie (https://github.com/Apipie/apypie) - method: PUT - uri: https://foreman.example.org/katello/api/repositories/26 + method: POST + uri: https://foreman.example.org/katello/api/repositories response: body: - string: ' {"relative_path":"test_organization-test_product-just_a_test_repo","promoted":false,"content_view_version_id":21,"library_instance_id":null,"last_contents_changed":"2022-09-14 - 11:28:10 UTC","organization_id":6,"organization":{"name":"Test Organization","label":"Test_Organization","id":6},"created_at":"2022-09-14 - 11:28:10 UTC","updated_at":"2022-09-14 11:28:13 UTC","backend_identifier":"5b66b707-8e93-47c7-a9b4-628b447a4019","container_repository_name":"test_organization-test_product-just_a_test_repo","full_path":"centos8-stream-katello-4-5.tanso.example.com/test_organization-test_product-just_a_test_repo","version_href":"/pulp/api/v3/repositories/container/container/7e36ddc8-37ad-4c2c-bc23-068e85c9280a/versions/0/","remote_href":"/pulp/api/v3/remotes/container/container/d2a45bdf-015d-4335-85f5-69899fb6a7a0/","publication_href":null,"content_counts":{"docker_manifest":0,"docker_manifest_list":0,"docker_tag":0},"mirroring_policy":"mirror_content_only","id":26,"name":"Test - Docker Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":10,"name":"Default - Organization View"},"content_view_version":{"id":21,"name":"Default Organization - View 1.0","content_view_id":10},"kt_environment":{"id":5,"name":"Library"},"content_type":"docker","url":"https://docker.io","arch":"noarch","os_versions":null,"content_id":"1663154890793","generic_remote_options":null,"major":null,"minor":null,"product":{"id":21,"cp_id":"160566138145","name":"Test - Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null,"environment":{"id":5,"registry_unauthenticated_pull":false},"docker_upstream_name":"busybox","docker_tags_whitelist":["latest"],"include_tags":["latest"],"exclude_tags":["*-source"],"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":"dockeruser","deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":null,"name":null},"ssl_client_cert":{"id":null,"name":null},"ssl_client_key":{"id":null,"name":null},"gpg_key":{"id":null,"name":null},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":true,"upstream_auth_exists":true} + string: ' {"relative_path":"test_organization-test_product-just_a_test_repo","promoted":false,"content_view_version_id":2,"library_instance_id":null,"last_contents_changed":"2023-07-26 + 13:05:21 UTC","organization_id":3,"organization":{"name":"Test Organization","label":"Test_Organization","id":3},"created_at":"2023-07-26 + 13:05:20 UTC","updated_at":"2023-07-26 13:05:22 UTC","backend_identifier":"35290fc5-7e87-48d4-94b7-27d92f4d44ec","container_repository_name":"test_organization-test_product-just_a_test_repo","full_path":"centos8-stream-katello-4-9.tanso.example.com/test_organization-test_product-just_a_test_repo","version_href":"/pulp/api/v3/repositories/container/container/444a3a71-c664-444e-8de8-50fb7d0dcf88/versions/0/","remote_href":"/pulp/api/v3/remotes/container/container/234e6c24-e568-4ae5-b53c-05b3ae06d5b5/","publication_href":null,"content_counts":{"docker_manifest":0,"docker_manifest_list":0,"docker_tag":0},"mirroring_policy":"mirror_content_only","id":9,"name":"Test + Docker Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"docker","url":"https://docker.io","arch":"noarch","os_versions":null,"content_id":"1690376721395","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null,"environment":{"id":2,"registry_unauthenticated_pull":false},"docker_upstream_name":"busybox","docker_tags_whitelist":["latest"],"include_tags":["latest"],"exclude_tags":["*-source"],"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"metadata_expire":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":null,"name":null},"ssl_client_cert":{"id":null,"name":null},"ssl_client_key":{"id":null,"name":null},"gpg_key":{"id":null,"name":null},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false,"content_view_environments":[]} ' headers: @@ -328,6 +263,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '2791' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -341,13 +278,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - - timeout=15, max=95 + - timeout=15, max=96 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -359,6 +294,6 @@ interactions: X-XSS-Protection: - 1; mode=block status: - code: 200 - message: OK + code: 201 + message: Created version: 1 diff --git a/tests/test_playbooks/fixtures/repository-18.yml b/tests/test_playbooks/fixtures/repository-18.yml index 02dabc674..41ea6a36d 100644 --- a/tests/test_playbooks/fixtures/repository-18.yml +++ b/tests/test_playbooks/fixtures/repository-18.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -68,17 +68,18 @@ interactions: uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ - : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ - : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\"\ - :\"Test_Organization\",\"created_at\":\"2022-09-14 11:27:41 UTC\",\"updated_at\"\ - :\"2022-09-14 11:27:43 UTC\",\"id\":6,\"name\":\"Test Organization\",\"title\"\ - :\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2023-06-23 + 11:37:20 UTC\",\"updated_at\":\"2023-06-23 11:37:22 UTC\",\"id\":3,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '388' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -92,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -124,14 +123,14 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/organizations/6/products?search=name%3D%22Test+Product%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/organizations/3/products?search=name%3D%22Test+Product%22&per_page=4294967296 response: body: string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test - Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":21,"cp_id":"160566138145","name":"Test - Product","label":"Test_Product","description":"A happy little test product","provider_id":9,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":"2022-09-14 - 11:28:10 UTC","last_sync_words":"less than a minute","organization_id":6,"organization":{"name":"Test - Organization","label":"Test_Organization","id":6},"sync_plan":null,"repository_count":1}]} + Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":1,"cp_id":"830157316014","name":"Test + Product","label":"Test_Product","description":"A happy little test product","provider_id":3,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":"2023-07-26 + 13:05:21 UTC","last_sync_words":"less than a minute","organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"sync_plan":null,"repository_count":2}]} ' headers: @@ -139,6 +138,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '664' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -150,15 +151,13 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 6; Test Organization + - 3; Test Organization Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -184,15 +183,15 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/products/21/repositories?search=name%3D%22Test+Docker+Repository%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/products/1/repositories?search=name%3D%22Test+Docker+Repository%22&per_page=4294967296 response: body: - string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test - Docker Repository\"","sort":{"by":"name","order":"asc"},"results":[{"backend_identifier":"5b66b707-8e93-47c7-a9b4-628b447a4019","relative_path":"test_organization-test_product-just_a_test_repo","container_repository_name":"test_organization-test_product-just_a_test_repo","full_path":"centos8-stream-katello-4-5.tanso.example.com/test_organization-test_product-just_a_test_repo","library_instance_id":null,"version_href":"/pulp/api/v3/repositories/container/container/7e36ddc8-37ad-4c2c-bc23-068e85c9280a/versions/0/","remote_href":"/pulp/api/v3/remotes/container/container/d2a45bdf-015d-4335-85f5-69899fb6a7a0/","publication_href":null,"content_counts":{"docker_manifest":0,"docker_manifest_list":0,"docker_tag":0},"mirroring_policy":"mirror_content_only","id":26,"name":"Test - Docker Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":10,"name":"Default - Organization View"},"content_view_version":{"id":21,"name":"Default Organization - View 1.0","content_view_id":10},"kt_environment":{"id":5,"name":"Library"},"content_type":"docker","url":"https://docker.io","arch":"noarch","os_versions":null,"content_id":"1663154890793","generic_remote_options":null,"major":null,"minor":null,"product":{"id":21,"cp_id":"160566138145","name":"Test - Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null}]} + string: '{"total":2,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test + Docker Repository\"","sort":{"by":"name","order":"asc"},"results":[{"backend_identifier":"35290fc5-7e87-48d4-94b7-27d92f4d44ec","relative_path":"test_organization-test_product-just_a_test_repo","container_repository_name":"test_organization-test_product-just_a_test_repo","full_path":"centos8-stream-katello-4-9.tanso.example.com/test_organization-test_product-just_a_test_repo","library_instance_id":null,"version_href":"/pulp/api/v3/repositories/container/container/444a3a71-c664-444e-8de8-50fb7d0dcf88/versions/0/","remote_href":"/pulp/api/v3/remotes/container/container/234e6c24-e568-4ae5-b53c-05b3ae06d5b5/","publication_href":null,"content_counts":{"docker_manifest":0,"docker_manifest_list":0,"docker_tag":0},"mirroring_policy":"mirror_content_only","id":9,"name":"Test + Docker Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"docker","url":"https://docker.io","arch":"noarch","os_versions":null,"content_id":"1690376721395","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null}],"org_repository_count":2} ' headers: @@ -200,6 +199,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '1586' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -213,13 +214,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -242,15 +241,19 @@ interactions: - gzip, deflate Connection: - keep-alive - Content-Length: - - '0' User-Agent: - apypie (https://github.com/Apipie/apypie) - method: DELETE - uri: https://foreman.example.org/katello/api/repositories/26 + method: GET + uri: https://foreman.example.org/katello/api/repositories/9 response: body: - string: ' {} + string: ' {"relative_path":"test_organization-test_product-just_a_test_repo","promoted":false,"content_view_version_id":2,"library_instance_id":null,"last_contents_changed":"2023-07-26 + 13:05:21 UTC","organization_id":3,"organization":{"name":"Test Organization","label":"Test_Organization","id":3},"created_at":"2023-07-26 + 13:05:20 UTC","updated_at":"2023-07-26 13:05:22 UTC","backend_identifier":"35290fc5-7e87-48d4-94b7-27d92f4d44ec","container_repository_name":"test_organization-test_product-just_a_test_repo","full_path":"centos8-stream-katello-4-9.tanso.example.com/test_organization-test_product-just_a_test_repo","version_href":"/pulp/api/v3/repositories/container/container/444a3a71-c664-444e-8de8-50fb7d0dcf88/versions/0/","remote_href":"/pulp/api/v3/remotes/container/container/234e6c24-e568-4ae5-b53c-05b3ae06d5b5/","publication_href":null,"content_counts":{"docker_manifest":0,"docker_manifest_list":0,"docker_tag":0},"mirroring_policy":"mirror_content_only","id":9,"name":"Test + Docker Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"docker","url":"https://docker.io","arch":"noarch","os_versions":null,"content_id":"1690376721395","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null,"environment":{"id":2,"registry_unauthenticated_pull":false},"docker_upstream_name":"busybox","docker_tags_whitelist":["latest"],"include_tags":["latest"],"exclude_tags":["*-source"],"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"metadata_expire":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":null,"name":null},"ssl_client_cert":{"id":null,"name":null},"ssl_client_key":{"id":null,"name":null},"gpg_key":{"id":null,"name":null},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false} ' headers: @@ -258,6 +261,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '2760' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -271,13 +276,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/repository-19.yml b/tests/test_playbooks/fixtures/repository-19.yml new file mode 100644 index 000000000..56830e3e4 --- /dev/null +++ b/tests/test_playbooks/fixtures/repository-19.yml @@ -0,0 +1,363 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/status + response: + body: + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '62' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=100 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2023-06-23 + 11:37:20 UTC\",\"updated_at\":\"2023-06-23 11:37:22 UTC\",\"id\":3,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '388' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=99 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/katello/api/organizations/3/products?search=name%3D%22Test+Product%22&per_page=4294967296 + response: + body: + string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test + Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":1,"cp_id":"830157316014","name":"Test + Product","label":"Test_Product","description":"A happy little test product","provider_id":3,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":"2023-07-26 + 13:05:21 UTC","last_sync_words":"less than a minute","organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"sync_plan":null,"repository_count":2}]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '664' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 3; Test Organization + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=98 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/katello/api/products/1/repositories?search=name%3D%22Test+Docker+Repository%22&per_page=4294967296 + response: + body: + string: '{"total":2,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test + Docker Repository\"","sort":{"by":"name","order":"asc"},"results":[{"backend_identifier":"35290fc5-7e87-48d4-94b7-27d92f4d44ec","relative_path":"test_organization-test_product-just_a_test_repo","container_repository_name":"test_organization-test_product-just_a_test_repo","full_path":"centos8-stream-katello-4-9.tanso.example.com/test_organization-test_product-just_a_test_repo","library_instance_id":null,"version_href":"/pulp/api/v3/repositories/container/container/444a3a71-c664-444e-8de8-50fb7d0dcf88/versions/0/","remote_href":"/pulp/api/v3/remotes/container/container/234e6c24-e568-4ae5-b53c-05b3ae06d5b5/","publication_href":null,"content_counts":{"docker_manifest":0,"docker_manifest_list":0,"docker_tag":0},"mirroring_policy":"mirror_content_only","id":9,"name":"Test + Docker Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"docker","url":"https://docker.io","arch":"noarch","os_versions":null,"content_id":"1690376721395","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null}],"org_repository_count":2} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '1586' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=97 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/katello/api/repositories/9 + response: + body: + string: ' {"relative_path":"test_organization-test_product-just_a_test_repo","promoted":false,"content_view_version_id":2,"library_instance_id":null,"last_contents_changed":"2023-07-26 + 13:05:21 UTC","organization_id":3,"organization":{"name":"Test Organization","label":"Test_Organization","id":3},"created_at":"2023-07-26 + 13:05:20 UTC","updated_at":"2023-07-26 13:05:22 UTC","backend_identifier":"35290fc5-7e87-48d4-94b7-27d92f4d44ec","container_repository_name":"test_organization-test_product-just_a_test_repo","full_path":"centos8-stream-katello-4-9.tanso.example.com/test_organization-test_product-just_a_test_repo","version_href":"/pulp/api/v3/repositories/container/container/444a3a71-c664-444e-8de8-50fb7d0dcf88/versions/0/","remote_href":"/pulp/api/v3/remotes/container/container/234e6c24-e568-4ae5-b53c-05b3ae06d5b5/","publication_href":null,"content_counts":{"docker_manifest":0,"docker_manifest_list":0,"docker_tag":0},"mirroring_policy":"mirror_content_only","id":9,"name":"Test + Docker Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"docker","url":"https://docker.io","arch":"noarch","os_versions":null,"content_id":"1690376721395","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null,"environment":{"id":2,"registry_unauthenticated_pull":false},"docker_upstream_name":"busybox","docker_tags_whitelist":["latest"],"include_tags":["latest"],"exclude_tags":["*-source"],"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"metadata_expire":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":null,"name":null},"ssl_client_cert":{"id":null,"name":null},"ssl_client_key":{"id":null,"name":null},"gpg_key":{"id":null,"name":null},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '2760' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=96 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: '{"upstream_username": "dockeruser", "upstream_password": "dockerpass"}' + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '70' + Content-Type: + - application/json + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: PUT + uri: https://foreman.example.org/katello/api/repositories/9 + response: + body: + string: ' {"relative_path":"test_organization-test_product-just_a_test_repo","promoted":false,"content_view_version_id":2,"library_instance_id":null,"last_contents_changed":"2023-07-26 + 13:05:21 UTC","organization_id":3,"organization":{"name":"Test Organization","label":"Test_Organization","id":3},"created_at":"2023-07-26 + 13:05:20 UTC","updated_at":"2023-07-26 13:05:28 UTC","backend_identifier":"35290fc5-7e87-48d4-94b7-27d92f4d44ec","container_repository_name":"test_organization-test_product-just_a_test_repo","full_path":"centos8-stream-katello-4-9.tanso.example.com/test_organization-test_product-just_a_test_repo","version_href":"/pulp/api/v3/repositories/container/container/444a3a71-c664-444e-8de8-50fb7d0dcf88/versions/0/","remote_href":"/pulp/api/v3/remotes/container/container/234e6c24-e568-4ae5-b53c-05b3ae06d5b5/","publication_href":null,"content_counts":{"docker_manifest":0,"docker_manifest_list":0,"docker_tag":0},"mirroring_policy":"mirror_content_only","id":9,"name":"Test + Docker Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"docker","url":"https://docker.io","arch":"noarch","os_versions":null,"content_id":"1690376721395","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null,"environment":{"id":2,"registry_unauthenticated_pull":false},"docker_upstream_name":"busybox","docker_tags_whitelist":["latest"],"include_tags":["latest"],"exclude_tags":["*-source"],"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":"dockeruser","deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"metadata_expire":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":null,"name":null},"ssl_client_cert":{"id":null,"name":null},"ssl_client_key":{"id":null,"name":null},"gpg_key":{"id":null,"name":null},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":true,"upstream_auth_exists":true} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '2766' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=95 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +version: 1 diff --git a/tests/test_playbooks/fixtures/repository-2.yml b/tests/test_playbooks/fixtures/repository-2.yml index ef567ee5a..86ade69ed 100644 --- a/tests/test_playbooks/fixtures/repository-2.yml +++ b/tests/test_playbooks/fixtures/repository-2.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -68,17 +68,18 @@ interactions: uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ - : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ - : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\"\ - :\"Test_Organization\",\"created_at\":\"2022-09-14 11:27:41 UTC\",\"updated_at\"\ - :\"2022-09-14 11:27:43 UTC\",\"id\":6,\"name\":\"Test Organization\",\"title\"\ - :\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2023-06-23 + 11:37:20 UTC\",\"updated_at\":\"2023-06-23 11:37:22 UTC\",\"id\":3,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '388' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -92,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -124,14 +123,14 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/organizations/6/products?search=name%3D%22Test+Product%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/organizations/3/products?search=name%3D%22Test+Product%22&per_page=4294967296 response: body: string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test - Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":21,"cp_id":"160566138145","name":"Test - Product","label":"Test_Product","description":"A happy little test product","provider_id":9,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":"2022-09-14 - 11:27:49 UTC","last_sync_words":"less than a minute","organization_id":6,"organization":{"name":"Test - Organization","label":"Test_Organization","id":6},"sync_plan":null,"repository_count":1}]} + Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":1,"cp_id":"830157316014","name":"Test + Product","label":"Test_Product","description":"A happy little test product","provider_id":3,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":"2023-07-26 + 13:04:10 UTC","last_sync_words":"less than a minute","organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"sync_plan":null,"repository_count":2}]} ' headers: @@ -139,6 +138,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '664' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -150,15 +151,13 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 6; Test Organization + - 3; Test Organization Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -184,15 +183,15 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/products/21/repositories?search=name%3D%22Test+Repository%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/products/1/repositories?search=name%3D%22Test+Repository%22&per_page=4294967296 response: body: - string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test - Repository\"","sort":{"by":"name","order":"asc"},"results":[{"backend_identifier":"9fc32a80-a890-4913-b134-068ffaaef538","relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-5.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo/","library_instance_id":null,"version_href":"/pulp/api/v3/repositories/rpm/rpm/e00a11c1-2b5c-4141-99e5-5bab7e580892/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/62d4611d-4ae6-4c27-b6a2-60b92fed52f8/","publication_href":"/pulp/api/v3/publications/rpm/rpm/2c819ace-c082-462c-ac1e-83288ac7e673/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"additive","id":24,"name":"Test - Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":10,"name":"Default - Organization View"},"content_view_version":{"id":21,"name":"Default Organization - View 1.0","content_view_id":10},"kt_environment":{"id":5,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1663154868357","generic_remote_options":null,"major":null,"minor":null,"product":{"id":21,"cp_id":"160566138145","name":"Test - Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null}]} + string: '{"total":2,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test + Repository\"","sort":{"by":"name","order":"asc"},"results":[{"backend_identifier":"d834ed96-f974-43a7-891c-9efcb358fe0b","relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-9.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo/","library_instance_id":null,"version_href":"/pulp/api/v3/repositories/rpm/rpm/45e870d8-eaaa-4b5b-a486-a0579ea295a9/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/ebfd859f-5ad8-423b-9875-daccce87ee33/","publication_href":"/pulp/api/v3/publications/rpm/rpm/191fc9bd-7708-4985-989f-049bc75a27b4/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"additive","id":7,"name":"Test + Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1690376649234","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null}],"org_repository_count":2} ' headers: @@ -200,6 +199,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '1652' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -213,13 +214,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -245,16 +244,16 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/repositories/24 + uri: https://foreman.example.org/katello/api/repositories/7 response: body: - string: ' {"relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo","promoted":false,"content_view_version_id":21,"library_instance_id":null,"last_contents_changed":"2022-09-14 - 11:27:48 UTC","organization_id":6,"organization":{"name":"Test Organization","label":"Test_Organization","id":6},"created_at":"2022-09-14 - 11:27:47 UTC","updated_at":"2022-09-14 11:27:48 UTC","backend_identifier":"9fc32a80-a890-4913-b134-068ffaaef538","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-5.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo/","version_href":"/pulp/api/v3/repositories/rpm/rpm/e00a11c1-2b5c-4141-99e5-5bab7e580892/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/62d4611d-4ae6-4c27-b6a2-60b92fed52f8/","publication_href":"/pulp/api/v3/publications/rpm/rpm/2c819ace-c082-462c-ac1e-83288ac7e673/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"additive","id":24,"name":"Test - Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":10,"name":"Default - Organization View"},"content_view_version":{"id":21,"name":"Default Organization - View 1.0","content_view_id":10},"kt_environment":{"id":5,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1663154868357","generic_remote_options":null,"major":null,"minor":null,"product":{"id":21,"cp_id":"160566138145","name":"Test - Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null,"environment":{"id":5,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"include_tags":null,"exclude_tags":null,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":null,"name":null},"ssl_client_cert":{"id":null,"name":null},"ssl_client_key":{"id":null,"name":null},"gpg_key":{"id":null,"name":null},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false} + string: ' {"relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo","promoted":false,"content_view_version_id":2,"library_instance_id":null,"last_contents_changed":"2023-07-26 + 13:04:09 UTC","organization_id":3,"organization":{"name":"Test Organization","label":"Test_Organization","id":3},"created_at":"2023-07-26 + 13:04:08 UTC","updated_at":"2023-07-26 13:04:10 UTC","backend_identifier":"d834ed96-f974-43a7-891c-9efcb358fe0b","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-9.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo/","version_href":"/pulp/api/v3/repositories/rpm/rpm/45e870d8-eaaa-4b5b-a486-a0579ea295a9/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/ebfd859f-5ad8-423b-9875-daccce87ee33/","publication_href":"/pulp/api/v3/publications/rpm/rpm/191fc9bd-7708-4985-989f-049bc75a27b4/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"additive","id":7,"name":"Test + Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1690376649234","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null,"environment":{"id":2,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"include_tags":null,"exclude_tags":null,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"metadata_expire":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":null,"name":null},"ssl_client_cert":{"id":null,"name":null},"ssl_client_key":{"id":null,"name":null},"gpg_key":{"id":null,"name":null},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false} ' headers: @@ -262,6 +261,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '2808' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -275,13 +276,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -311,16 +310,16 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: PUT - uri: https://foreman.example.org/katello/api/repositories/24 + uri: https://foreman.example.org/katello/api/repositories/7 response: body: - string: ' {"relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo","promoted":false,"content_view_version_id":21,"library_instance_id":null,"last_contents_changed":"2022-09-14 - 11:27:48 UTC","organization_id":6,"organization":{"name":"Test Organization","label":"Test_Organization","id":6},"created_at":"2022-09-14 - 11:27:47 UTC","updated_at":"2022-09-14 11:27:50 UTC","backend_identifier":"9fc32a80-a890-4913-b134-068ffaaef538","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-5.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo/","version_href":"/pulp/api/v3/repositories/rpm/rpm/e00a11c1-2b5c-4141-99e5-5bab7e580892/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/62d4611d-4ae6-4c27-b6a2-60b92fed52f8/","publication_href":"/pulp/api/v3/publications/rpm/rpm/2c819ace-c082-462c-ac1e-83288ac7e673/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":24,"name":"Test - Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":10,"name":"Default - Organization View"},"content_view_version":{"id":21,"name":"Default Organization - View 1.0","content_view_id":10},"kt_environment":{"id":5,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1663154868357","generic_remote_options":null,"major":null,"minor":null,"product":{"id":21,"cp_id":"160566138145","name":"Test - Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null,"environment":{"id":5,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"include_tags":null,"exclude_tags":null,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":null,"name":null},"ssl_client_cert":{"id":null,"name":null},"ssl_client_key":{"id":null,"name":null},"gpg_key":{"id":null,"name":null},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false} + string: ' {"relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo","promoted":false,"content_view_version_id":2,"library_instance_id":null,"last_contents_changed":"2023-07-26 + 13:04:09 UTC","organization_id":3,"organization":{"name":"Test Organization","label":"Test_Organization","id":3},"created_at":"2023-07-26 + 13:04:08 UTC","updated_at":"2023-07-26 13:04:15 UTC","backend_identifier":"d834ed96-f974-43a7-891c-9efcb358fe0b","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-9.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo/","version_href":"/pulp/api/v3/repositories/rpm/rpm/45e870d8-eaaa-4b5b-a486-a0579ea295a9/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/ebfd859f-5ad8-423b-9875-daccce87ee33/","publication_href":"/pulp/api/v3/publications/rpm/rpm/191fc9bd-7708-4985-989f-049bc75a27b4/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":7,"name":"Test + Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1690376649234","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null,"environment":{"id":2,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"include_tags":null,"exclude_tags":null,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"metadata_expire":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":null,"name":null},"ssl_client_cert":{"id":null,"name":null},"ssl_client_key":{"id":null,"name":null},"gpg_key":{"id":null,"name":null},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false} ' headers: @@ -328,6 +327,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '2819' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -341,13 +342,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/repository-20.yml b/tests/test_playbooks/fixtures/repository-20.yml new file mode 100644 index 000000000..293f5ba7e --- /dev/null +++ b/tests/test_playbooks/fixtures/repository-20.yml @@ -0,0 +1,299 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/api/status + response: + body: + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '62' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=100 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 + response: + body: + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2023-06-23 + 11:37:20 UTC\",\"updated_at\":\"2023-06-23 11:37:22 UTC\",\"id\":3,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '388' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=99 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/katello/api/organizations/3/products?search=name%3D%22Test+Product%22&per_page=4294967296 + response: + body: + string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test + Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":1,"cp_id":"830157316014","name":"Test + Product","label":"Test_Product","description":"A happy little test product","provider_id":3,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":"2023-07-26 + 13:05:21 UTC","last_sync_words":"less than a minute","organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"sync_plan":null,"repository_count":2}]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '664' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - 3; Test Organization + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=98 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: GET + uri: https://foreman.example.org/katello/api/products/1/repositories?search=name%3D%22Test+Docker+Repository%22&per_page=4294967296 + response: + body: + string: '{"total":2,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test + Docker Repository\"","sort":{"by":"name","order":"asc"},"results":[{"backend_identifier":"35290fc5-7e87-48d4-94b7-27d92f4d44ec","relative_path":"test_organization-test_product-just_a_test_repo","container_repository_name":"test_organization-test_product-just_a_test_repo","full_path":"centos8-stream-katello-4-9.tanso.example.com/test_organization-test_product-just_a_test_repo","library_instance_id":null,"version_href":"/pulp/api/v3/repositories/container/container/444a3a71-c664-444e-8de8-50fb7d0dcf88/versions/0/","remote_href":"/pulp/api/v3/remotes/container/container/234e6c24-e568-4ae5-b53c-05b3ae06d5b5/","publication_href":null,"content_counts":{"docker_manifest":0,"docker_manifest_list":0,"docker_tag":0},"mirroring_policy":"mirror_content_only","id":9,"name":"Test + Docker Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"docker","url":"https://docker.io","arch":"noarch","os_versions":null,"content_id":"1690376721395","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null}],"org_repository_count":2} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '1586' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=97 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json;version=2 + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - apypie (https://github.com/Apipie/apypie) + method: DELETE + uri: https://foreman.example.org/katello/api/repositories/9 + response: + body: + string: ' {"relative_path":"test_organization-test_product-just_a_test_repo","promoted":false,"content_view_version_id":2,"library_instance_id":null,"last_contents_changed":"2023-07-26 + 13:05:21 UTC","organization_id":3,"organization":{"name":"Test Organization","label":"Test_Organization","id":3},"created_at":"2023-07-26 + 13:05:20 UTC","updated_at":"2023-07-26 13:05:28 UTC","backend_identifier":"35290fc5-7e87-48d4-94b7-27d92f4d44ec","container_repository_name":"test_organization-test_product-just_a_test_repo","full_path":"centos8-stream-katello-4-9.tanso.example.com/test_organization-test_product-just_a_test_repo","version_href":"/pulp/api/v3/repositories/container/container/444a3a71-c664-444e-8de8-50fb7d0dcf88/versions/0/","remote_href":"/pulp/api/v3/remotes/container/container/234e6c24-e568-4ae5-b53c-05b3ae06d5b5/","publication_href":null,"content_counts":{"docker_manifest":0,"docker_manifest_list":0,"docker_tag":0},"mirroring_policy":"mirror_content_only","id":9,"name":"Test + Docker Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"docker","url":"https://docker.io","arch":"noarch","os_versions":null,"content_id":"1690376721395","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":null,"last_sync_words":null,"environment":{"id":2,"registry_unauthenticated_pull":false},"docker_upstream_name":"busybox","docker_tags_whitelist":["latest"],"include_tags":["latest"],"exclude_tags":["*-source"],"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":"dockeruser","deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"metadata_expire":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":null,"name":null},"ssl_client_cert":{"id":null,"name":null},"ssl_client_key":{"id":null,"name":null},"gpg_key":{"id":null,"name":null},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":true,"upstream_auth_exists":true,"content_view_environments":[]} + + ' + headers: + Cache-Control: + - max-age=0, private, must-revalidate + Connection: + - Keep-Alive + Content-Length: + - '2752' + Content-Security-Policy: + - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; + img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; + style-src ''unsafe-inline'' ''self''' + Content-Type: + - application/json; charset=utf-8 + Foreman_api_version: + - '2' + Foreman_current_location: + - ; ANY + Foreman_current_organization: + - ; ANY + Foreman_version: + - 3.7.0 + Keep-Alive: + - timeout=15, max=96 + Strict-Transport-Security: + - max-age=631139040; includeSubdomains + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Frame-Options: + - sameorigin + X-Permitted-Cross-Domain-Policies: + - none + X-XSS-Protection: + - 1; mode=block + status: + code: 200 + message: OK +version: 1 diff --git a/tests/test_playbooks/fixtures/repository-3.yml b/tests/test_playbooks/fixtures/repository-3.yml index ec241d683..daa03197b 100644 --- a/tests/test_playbooks/fixtures/repository-3.yml +++ b/tests/test_playbooks/fixtures/repository-3.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -68,17 +68,18 @@ interactions: uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ - : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ - : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\"\ - :\"Test_Organization\",\"created_at\":\"2022-09-14 11:27:41 UTC\",\"updated_at\"\ - :\"2022-09-14 11:27:43 UTC\",\"id\":6,\"name\":\"Test Organization\",\"title\"\ - :\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2023-06-23 + 11:37:20 UTC\",\"updated_at\":\"2023-06-23 11:37:22 UTC\",\"id\":3,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '388' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -92,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -124,14 +123,14 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/organizations/6/products?search=name%3D%22Test+Product%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/organizations/3/products?search=name%3D%22Test+Product%22&per_page=4294967296 response: body: string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test - Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":21,"cp_id":"160566138145","name":"Test - Product","label":"Test_Product","description":"A happy little test product","provider_id":9,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":"2022-09-14 - 11:27:52 UTC","last_sync_words":"less than a minute","organization_id":6,"organization":{"name":"Test - Organization","label":"Test_Organization","id":6},"sync_plan":null,"repository_count":1}]} + Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":1,"cp_id":"830157316014","name":"Test + Product","label":"Test_Product","description":"A happy little test product","provider_id":3,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":"2023-07-26 + 13:04:19 UTC","last_sync_words":"less than a minute","organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"sync_plan":null,"repository_count":2}]} ' headers: @@ -139,6 +138,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '664' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -150,15 +151,13 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 6; Test Organization + - 3; Test Organization Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -184,15 +183,15 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/products/21/repositories?search=name%3D%22Test+Repository%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/products/1/repositories?search=name%3D%22Test+Repository%22&per_page=4294967296 response: body: - string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test - Repository\"","sort":{"by":"name","order":"asc"},"results":[{"backend_identifier":"9fc32a80-a890-4913-b134-068ffaaef538","relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-5.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo/","library_instance_id":null,"version_href":"/pulp/api/v3/repositories/rpm/rpm/e00a11c1-2b5c-4141-99e5-5bab7e580892/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/62d4611d-4ae6-4c27-b6a2-60b92fed52f8/","publication_href":"/pulp/api/v3/publications/rpm/rpm/af843a23-5b25-4a55-a1f7-a997996386bb/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":24,"name":"Test - Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":10,"name":"Default - Organization View"},"content_view_version":{"id":21,"name":"Default Organization - View 1.0","content_view_id":10},"kt_environment":{"id":5,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1663154868357","generic_remote_options":null,"major":null,"minor":null,"product":{"id":21,"cp_id":"160566138145","name":"Test - Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null}]} + string: '{"total":2,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test + Repository\"","sort":{"by":"name","order":"asc"},"results":[{"backend_identifier":"d834ed96-f974-43a7-891c-9efcb358fe0b","relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-9.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo/","library_instance_id":null,"version_href":"/pulp/api/v3/repositories/rpm/rpm/45e870d8-eaaa-4b5b-a486-a0579ea295a9/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/ebfd859f-5ad8-423b-9875-daccce87ee33/","publication_href":"/pulp/api/v3/publications/rpm/rpm/6739fd9d-33bf-472f-b33f-5f775b731005/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":7,"name":"Test + Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1690376649234","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null}],"org_repository_count":2} ' headers: @@ -200,6 +199,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '1663' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -213,13 +214,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -245,16 +244,16 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/repositories/24 + uri: https://foreman.example.org/katello/api/repositories/7 response: body: - string: ' {"relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo","promoted":false,"content_view_version_id":21,"library_instance_id":null,"last_contents_changed":"2022-09-14 - 11:27:48 UTC","organization_id":6,"organization":{"name":"Test Organization","label":"Test_Organization","id":6},"created_at":"2022-09-14 - 11:27:47 UTC","updated_at":"2022-09-14 11:27:50 UTC","backend_identifier":"9fc32a80-a890-4913-b134-068ffaaef538","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-5.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo/","version_href":"/pulp/api/v3/repositories/rpm/rpm/e00a11c1-2b5c-4141-99e5-5bab7e580892/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/62d4611d-4ae6-4c27-b6a2-60b92fed52f8/","publication_href":"/pulp/api/v3/publications/rpm/rpm/af843a23-5b25-4a55-a1f7-a997996386bb/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":24,"name":"Test - Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":10,"name":"Default - Organization View"},"content_view_version":{"id":21,"name":"Default Organization - View 1.0","content_view_id":10},"kt_environment":{"id":5,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1663154868357","generic_remote_options":null,"major":null,"minor":null,"product":{"id":21,"cp_id":"160566138145","name":"Test - Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null,"environment":{"id":5,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"include_tags":null,"exclude_tags":null,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":null,"name":null},"ssl_client_cert":{"id":null,"name":null},"ssl_client_key":{"id":null,"name":null},"gpg_key":{"id":null,"name":null},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false} + string: ' {"relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo","promoted":false,"content_view_version_id":2,"library_instance_id":null,"last_contents_changed":"2023-07-26 + 13:04:09 UTC","organization_id":3,"organization":{"name":"Test Organization","label":"Test_Organization","id":3},"created_at":"2023-07-26 + 13:04:08 UTC","updated_at":"2023-07-26 13:04:15 UTC","backend_identifier":"d834ed96-f974-43a7-891c-9efcb358fe0b","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-9.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo/","version_href":"/pulp/api/v3/repositories/rpm/rpm/45e870d8-eaaa-4b5b-a486-a0579ea295a9/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/ebfd859f-5ad8-423b-9875-daccce87ee33/","publication_href":"/pulp/api/v3/publications/rpm/rpm/6739fd9d-33bf-472f-b33f-5f775b731005/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":7,"name":"Test + Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1690376649234","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null,"environment":{"id":2,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"include_tags":null,"exclude_tags":null,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"metadata_expire":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":null,"name":null},"ssl_client_cert":{"id":null,"name":null},"ssl_client_key":{"id":null,"name":null},"gpg_key":{"id":null,"name":null},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false} ' headers: @@ -262,6 +261,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '2819' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -275,13 +276,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/repository-4.yml b/tests/test_playbooks/fixtures/repository-4.yml index e045451c6..acf02fc24 100644 --- a/tests/test_playbooks/fixtures/repository-4.yml +++ b/tests/test_playbooks/fixtures/repository-4.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -68,17 +68,18 @@ interactions: uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ - : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ - : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\"\ - :\"Test_Organization\",\"created_at\":\"2022-09-14 11:27:41 UTC\",\"updated_at\"\ - :\"2022-09-14 11:27:43 UTC\",\"id\":6,\"name\":\"Test Organization\",\"title\"\ - :\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2023-06-23 + 11:37:20 UTC\",\"updated_at\":\"2023-06-23 11:37:22 UTC\",\"id\":3,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '388' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -92,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -124,14 +123,14 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/organizations/6/products?search=name%3D%22Test+Product%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/organizations/3/products?search=name%3D%22Test+Product%22&per_page=4294967296 response: body: string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test - Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":21,"cp_id":"160566138145","name":"Test - Product","label":"Test_Product","description":"A happy little test product","provider_id":9,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":"2022-09-14 - 11:27:52 UTC","last_sync_words":"less than a minute","organization_id":6,"organization":{"name":"Test - Organization","label":"Test_Organization","id":6},"sync_plan":null,"repository_count":1}]} + Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":1,"cp_id":"830157316014","name":"Test + Product","label":"Test_Product","description":"A happy little test product","provider_id":3,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":"2023-07-26 + 13:04:19 UTC","last_sync_words":"less than a minute","organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"sync_plan":null,"repository_count":2}]} ' headers: @@ -139,6 +138,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '664' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -150,15 +151,13 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 6; Test Organization + - 3; Test Organization Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -184,15 +183,15 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/products/21/repositories?search=name%3D%22Test+Repository%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/products/1/repositories?search=name%3D%22Test+Repository%22&per_page=4294967296 response: body: - string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test - Repository\"","sort":{"by":"name","order":"asc"},"results":[{"backend_identifier":"9fc32a80-a890-4913-b134-068ffaaef538","relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-5.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo/","library_instance_id":null,"version_href":"/pulp/api/v3/repositories/rpm/rpm/e00a11c1-2b5c-4141-99e5-5bab7e580892/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/62d4611d-4ae6-4c27-b6a2-60b92fed52f8/","publication_href":"/pulp/api/v3/publications/rpm/rpm/af843a23-5b25-4a55-a1f7-a997996386bb/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":24,"name":"Test - Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":10,"name":"Default - Organization View"},"content_view_version":{"id":21,"name":"Default Organization - View 1.0","content_view_id":10},"kt_environment":{"id":5,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1663154868357","generic_remote_options":null,"major":null,"minor":null,"product":{"id":21,"cp_id":"160566138145","name":"Test - Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null}]} + string: '{"total":2,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test + Repository\"","sort":{"by":"name","order":"asc"},"results":[{"backend_identifier":"d834ed96-f974-43a7-891c-9efcb358fe0b","relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-9.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo/","library_instance_id":null,"version_href":"/pulp/api/v3/repositories/rpm/rpm/45e870d8-eaaa-4b5b-a486-a0579ea295a9/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/ebfd859f-5ad8-423b-9875-daccce87ee33/","publication_href":"/pulp/api/v3/publications/rpm/rpm/6739fd9d-33bf-472f-b33f-5f775b731005/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":7,"name":"Test + Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1690376649234","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null}],"org_repository_count":2} ' headers: @@ -200,6 +199,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '1663' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -213,13 +214,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -245,16 +244,16 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/repositories/24 + uri: https://foreman.example.org/katello/api/repositories/7 response: body: - string: ' {"relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo","promoted":false,"content_view_version_id":21,"library_instance_id":null,"last_contents_changed":"2022-09-14 - 11:27:48 UTC","organization_id":6,"organization":{"name":"Test Organization","label":"Test_Organization","id":6},"created_at":"2022-09-14 - 11:27:47 UTC","updated_at":"2022-09-14 11:27:50 UTC","backend_identifier":"9fc32a80-a890-4913-b134-068ffaaef538","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-5.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo/","version_href":"/pulp/api/v3/repositories/rpm/rpm/e00a11c1-2b5c-4141-99e5-5bab7e580892/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/62d4611d-4ae6-4c27-b6a2-60b92fed52f8/","publication_href":"/pulp/api/v3/publications/rpm/rpm/af843a23-5b25-4a55-a1f7-a997996386bb/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":24,"name":"Test - Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":10,"name":"Default - Organization View"},"content_view_version":{"id":21,"name":"Default Organization - View 1.0","content_view_id":10},"kt_environment":{"id":5,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1663154868357","generic_remote_options":null,"major":null,"minor":null,"product":{"id":21,"cp_id":"160566138145","name":"Test - Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null,"environment":{"id":5,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"include_tags":null,"exclude_tags":null,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":null,"name":null},"ssl_client_cert":{"id":null,"name":null},"ssl_client_key":{"id":null,"name":null},"gpg_key":{"id":null,"name":null},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false} + string: ' {"relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo","promoted":false,"content_view_version_id":2,"library_instance_id":null,"last_contents_changed":"2023-07-26 + 13:04:09 UTC","organization_id":3,"organization":{"name":"Test Organization","label":"Test_Organization","id":3},"created_at":"2023-07-26 + 13:04:08 UTC","updated_at":"2023-07-26 13:04:15 UTC","backend_identifier":"d834ed96-f974-43a7-891c-9efcb358fe0b","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-9.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo/","version_href":"/pulp/api/v3/repositories/rpm/rpm/45e870d8-eaaa-4b5b-a486-a0579ea295a9/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/ebfd859f-5ad8-423b-9875-daccce87ee33/","publication_href":"/pulp/api/v3/publications/rpm/rpm/6739fd9d-33bf-472f-b33f-5f775b731005/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":7,"name":"Test + Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1690376649234","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null,"environment":{"id":2,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"include_tags":null,"exclude_tags":null,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"metadata_expire":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":null,"name":null},"ssl_client_cert":{"id":null,"name":null},"ssl_client_key":{"id":null,"name":null},"gpg_key":{"id":null,"name":null},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false} ' headers: @@ -262,6 +261,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '2819' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -275,13 +276,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -311,16 +310,16 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: PUT - uri: https://foreman.example.org/katello/api/repositories/24 + uri: https://foreman.example.org/katello/api/repositories/7 response: body: - string: ' {"relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo","promoted":false,"content_view_version_id":21,"library_instance_id":null,"last_contents_changed":"2022-09-14 - 11:27:48 UTC","organization_id":6,"organization":{"name":"Test Organization","label":"Test_Organization","id":6},"created_at":"2022-09-14 - 11:27:47 UTC","updated_at":"2022-09-14 11:27:53 UTC","backend_identifier":"9fc32a80-a890-4913-b134-068ffaaef538","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-5.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo/","version_href":"/pulp/api/v3/repositories/rpm/rpm/e00a11c1-2b5c-4141-99e5-5bab7e580892/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/62d4611d-4ae6-4c27-b6a2-60b92fed52f8/","publication_href":"/pulp/api/v3/publications/rpm/rpm/af843a23-5b25-4a55-a1f7-a997996386bb/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":24,"name":"Test - Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":10,"name":"Default - Organization View"},"content_view_version":{"id":21,"name":"Default Organization - View 1.0","content_view_id":10},"kt_environment":{"id":5,"name":"Library"},"content_type":"yum","url":"https://localhost/pulp/repos/demo_repos/zoo","arch":"noarch","os_versions":[],"content_id":"1663154868357","generic_remote_options":null,"major":null,"minor":null,"product":{"id":21,"cp_id":"160566138145","name":"Test - Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null,"environment":{"id":5,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"include_tags":null,"exclude_tags":null,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":null,"name":null},"ssl_client_cert":{"id":null,"name":null},"ssl_client_key":{"id":null,"name":null},"gpg_key":{"id":null,"name":null},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false} + string: ' {"relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo","promoted":false,"content_view_version_id":2,"library_instance_id":null,"last_contents_changed":"2023-07-26 + 13:04:09 UTC","organization_id":3,"organization":{"name":"Test Organization","label":"Test_Organization","id":3},"created_at":"2023-07-26 + 13:04:08 UTC","updated_at":"2023-07-26 13:04:24 UTC","backend_identifier":"d834ed96-f974-43a7-891c-9efcb358fe0b","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-9.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo/","version_href":"/pulp/api/v3/repositories/rpm/rpm/45e870d8-eaaa-4b5b-a486-a0579ea295a9/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/ebfd859f-5ad8-423b-9875-daccce87ee33/","publication_href":"/pulp/api/v3/publications/rpm/rpm/6739fd9d-33bf-472f-b33f-5f775b731005/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":7,"name":"Test + Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://localhost/pulp/repos/demo_repos/zoo","arch":"noarch","os_versions":[],"content_id":"1690376649234","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null,"environment":{"id":2,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"include_tags":null,"exclude_tags":null,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"metadata_expire":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":null,"name":null},"ssl_client_cert":{"id":null,"name":null},"ssl_client_key":{"id":null,"name":null},"gpg_key":{"id":null,"name":null},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false} ' headers: @@ -328,6 +327,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '2806' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -341,13 +342,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/repository-5.yml b/tests/test_playbooks/fixtures/repository-5.yml index 684a37a6e..61e601b89 100644 --- a/tests/test_playbooks/fixtures/repository-5.yml +++ b/tests/test_playbooks/fixtures/repository-5.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -68,17 +68,18 @@ interactions: uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ - : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ - : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\"\ - :\"Test_Organization\",\"created_at\":\"2022-09-14 11:27:41 UTC\",\"updated_at\"\ - :\"2022-09-14 11:27:43 UTC\",\"id\":6,\"name\":\"Test Organization\",\"title\"\ - :\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2023-06-23 + 11:37:20 UTC\",\"updated_at\":\"2023-06-23 11:37:22 UTC\",\"id\":3,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '388' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -92,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -124,14 +123,14 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/organizations/6/products?search=name%3D%22Test+Product%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/organizations/3/products?search=name%3D%22Test+Product%22&per_page=4294967296 response: body: string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test - Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":21,"cp_id":"160566138145","name":"Test - Product","label":"Test_Product","description":"A happy little test product","provider_id":9,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":"2022-09-14 - 11:27:52 UTC","last_sync_words":"less than a minute","organization_id":6,"organization":{"name":"Test - Organization","label":"Test_Organization","id":6},"sync_plan":null,"repository_count":1}]} + Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":1,"cp_id":"830157316014","name":"Test + Product","label":"Test_Product","description":"A happy little test product","provider_id":3,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":"2023-07-26 + 13:04:28 UTC","last_sync_words":"less than a minute","organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"sync_plan":null,"repository_count":2}]} ' headers: @@ -139,6 +138,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '664' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -150,15 +151,13 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 6; Test Organization + - 3; Test Organization Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -184,15 +183,15 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/products/21/repositories?search=name%3D%22Test+Repository%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/products/1/repositories?search=name%3D%22Test+Repository%22&per_page=4294967296 response: body: - string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test - Repository\"","sort":{"by":"name","order":"asc"},"results":[{"backend_identifier":"9fc32a80-a890-4913-b134-068ffaaef538","relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-5.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo/","library_instance_id":null,"version_href":"/pulp/api/v3/repositories/rpm/rpm/e00a11c1-2b5c-4141-99e5-5bab7e580892/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/62d4611d-4ae6-4c27-b6a2-60b92fed52f8/","publication_href":"/pulp/api/v3/publications/rpm/rpm/4768a29a-a923-4614-a454-e95184509389/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":24,"name":"Test - Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":10,"name":"Default - Organization View"},"content_view_version":{"id":21,"name":"Default Organization - View 1.0","content_view_id":10},"kt_environment":{"id":5,"name":"Library"},"content_type":"yum","url":"https://localhost/pulp/repos/demo_repos/zoo","arch":"noarch","os_versions":[],"content_id":"1663154868357","generic_remote_options":null,"major":null,"minor":null,"product":{"id":21,"cp_id":"160566138145","name":"Test - Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null}]} + string: '{"total":2,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test + Repository\"","sort":{"by":"name","order":"asc"},"results":[{"backend_identifier":"d834ed96-f974-43a7-891c-9efcb358fe0b","relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-9.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo/","library_instance_id":null,"version_href":"/pulp/api/v3/repositories/rpm/rpm/45e870d8-eaaa-4b5b-a486-a0579ea295a9/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/ebfd859f-5ad8-423b-9875-daccce87ee33/","publication_href":"/pulp/api/v3/publications/rpm/rpm/12fb23cb-a758-4187-ae95-de6b3e4bab2b/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":7,"name":"Test + Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://localhost/pulp/repos/demo_repos/zoo","arch":"noarch","os_versions":[],"content_id":"1690376649234","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null}],"org_repository_count":2} ' headers: @@ -200,6 +199,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '1650' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -213,13 +214,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -245,16 +244,16 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/repositories/24 + uri: https://foreman.example.org/katello/api/repositories/7 response: body: - string: ' {"relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo","promoted":false,"content_view_version_id":21,"library_instance_id":null,"last_contents_changed":"2022-09-14 - 11:27:48 UTC","organization_id":6,"organization":{"name":"Test Organization","label":"Test_Organization","id":6},"created_at":"2022-09-14 - 11:27:47 UTC","updated_at":"2022-09-14 11:27:53 UTC","backend_identifier":"9fc32a80-a890-4913-b134-068ffaaef538","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-5.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo/","version_href":"/pulp/api/v3/repositories/rpm/rpm/e00a11c1-2b5c-4141-99e5-5bab7e580892/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/62d4611d-4ae6-4c27-b6a2-60b92fed52f8/","publication_href":"/pulp/api/v3/publications/rpm/rpm/4768a29a-a923-4614-a454-e95184509389/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":24,"name":"Test - Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":10,"name":"Default - Organization View"},"content_view_version":{"id":21,"name":"Default Organization - View 1.0","content_view_id":10},"kt_environment":{"id":5,"name":"Library"},"content_type":"yum","url":"https://localhost/pulp/repos/demo_repos/zoo","arch":"noarch","os_versions":[],"content_id":"1663154868357","generic_remote_options":null,"major":null,"minor":null,"product":{"id":21,"cp_id":"160566138145","name":"Test - Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null,"environment":{"id":5,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"include_tags":null,"exclude_tags":null,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":null,"name":null},"ssl_client_cert":{"id":null,"name":null},"ssl_client_key":{"id":null,"name":null},"gpg_key":{"id":null,"name":null},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false} + string: ' {"relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo","promoted":false,"content_view_version_id":2,"library_instance_id":null,"last_contents_changed":"2023-07-26 + 13:04:09 UTC","organization_id":3,"organization":{"name":"Test Organization","label":"Test_Organization","id":3},"created_at":"2023-07-26 + 13:04:08 UTC","updated_at":"2023-07-26 13:04:24 UTC","backend_identifier":"d834ed96-f974-43a7-891c-9efcb358fe0b","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-9.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo/","version_href":"/pulp/api/v3/repositories/rpm/rpm/45e870d8-eaaa-4b5b-a486-a0579ea295a9/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/ebfd859f-5ad8-423b-9875-daccce87ee33/","publication_href":"/pulp/api/v3/publications/rpm/rpm/12fb23cb-a758-4187-ae95-de6b3e4bab2b/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":7,"name":"Test + Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://localhost/pulp/repos/demo_repos/zoo","arch":"noarch","os_versions":[],"content_id":"1690376649234","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null,"environment":{"id":2,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"include_tags":null,"exclude_tags":null,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"metadata_expire":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":null,"name":null},"ssl_client_cert":{"id":null,"name":null},"ssl_client_key":{"id":null,"name":null},"gpg_key":{"id":null,"name":null},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false} ' headers: @@ -262,6 +261,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '2806' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -275,13 +276,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -311,16 +310,16 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: PUT - uri: https://foreman.example.org/katello/api/repositories/24 + uri: https://foreman.example.org/katello/api/repositories/7 response: body: - string: ' {"relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo","promoted":false,"content_view_version_id":21,"library_instance_id":null,"last_contents_changed":"2022-09-14 - 11:27:48 UTC","organization_id":6,"organization":{"name":"Test Organization","label":"Test_Organization","id":6},"created_at":"2022-09-14 - 11:27:47 UTC","updated_at":"2022-09-14 11:27:55 UTC","backend_identifier":"9fc32a80-a890-4913-b134-068ffaaef538","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-5.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo/","version_href":"/pulp/api/v3/repositories/rpm/rpm/e00a11c1-2b5c-4141-99e5-5bab7e580892/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/62d4611d-4ae6-4c27-b6a2-60b92fed52f8/","publication_href":"/pulp/api/v3/publications/rpm/rpm/4768a29a-a923-4614-a454-e95184509389/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":24,"name":"Test - Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":10,"name":"Default - Organization View"},"content_view_version":{"id":21,"name":"Default Organization - View 1.0","content_view_id":10},"kt_environment":{"id":5,"name":"Library"},"content_type":"yum","url":"https://localhost/pulp/repos/demo_repos/zoo","arch":"noarch","os_versions":[],"content_id":"1663154868357","generic_remote_options":null,"major":null,"minor":null,"product":{"id":21,"cp_id":"160566138145","name":"Test - Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null,"environment":{"id":5,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"include_tags":null,"exclude_tags":null,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":null,"name":null},"ssl_client_cert":{"id":null,"name":null},"ssl_client_key":{"id":null,"name":null},"gpg_key":{"id":null,"name":null},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false} + string: ' {"relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo","promoted":false,"content_view_version_id":2,"library_instance_id":null,"last_contents_changed":"2023-07-26 + 13:04:09 UTC","organization_id":3,"organization":{"name":"Test Organization","label":"Test_Organization","id":3},"created_at":"2023-07-26 + 13:04:08 UTC","updated_at":"2023-07-26 13:04:31 UTC","backend_identifier":"d834ed96-f974-43a7-891c-9efcb358fe0b","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-9.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo/","version_href":"/pulp/api/v3/repositories/rpm/rpm/45e870d8-eaaa-4b5b-a486-a0579ea295a9/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/ebfd859f-5ad8-423b-9875-daccce87ee33/","publication_href":"/pulp/api/v3/publications/rpm/rpm/12fb23cb-a758-4187-ae95-de6b3e4bab2b/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":7,"name":"Test + Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://localhost/pulp/repos/demo_repos/zoo","arch":"noarch","os_versions":[],"content_id":"1690376649234","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null,"environment":{"id":2,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"include_tags":null,"exclude_tags":null,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"metadata_expire":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":null,"name":null},"ssl_client_cert":{"id":null,"name":null},"ssl_client_key":{"id":null,"name":null},"gpg_key":{"id":null,"name":null},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false} ' headers: @@ -328,6 +327,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '2806' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -341,13 +342,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/repository-6.yml b/tests/test_playbooks/fixtures/repository-6.yml index 1bf32081c..2dfdd0ae0 100644 --- a/tests/test_playbooks/fixtures/repository-6.yml +++ b/tests/test_playbooks/fixtures/repository-6.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -68,17 +68,18 @@ interactions: uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ - : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ - : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\"\ - :\"Test_Organization\",\"created_at\":\"2022-09-14 11:27:41 UTC\",\"updated_at\"\ - :\"2022-09-14 11:27:43 UTC\",\"id\":6,\"name\":\"Test Organization\",\"title\"\ - :\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2023-06-23 + 11:37:20 UTC\",\"updated_at\":\"2023-06-23 11:37:22 UTC\",\"id\":3,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '388' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -92,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -124,14 +123,14 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/organizations/6/products?search=name%3D%22Test+Product%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/organizations/3/products?search=name%3D%22Test+Product%22&per_page=4294967296 response: body: string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test - Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":21,"cp_id":"160566138145","name":"Test - Product","label":"Test_Product","description":"A happy little test product","provider_id":9,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":"2022-09-14 - 11:27:55 UTC","last_sync_words":"less than a minute","organization_id":6,"organization":{"name":"Test - Organization","label":"Test_Organization","id":6},"sync_plan":null,"repository_count":1}]} + Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":1,"cp_id":"830157316014","name":"Test + Product","label":"Test_Product","description":"A happy little test product","provider_id":3,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":"2023-07-26 + 13:04:36 UTC","last_sync_words":"less than a minute","organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"sync_plan":null,"repository_count":2}]} ' headers: @@ -139,6 +138,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '664' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -150,15 +151,13 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 6; Test Organization + - 3; Test Organization Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -184,15 +183,15 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/products/21/repositories?search=name%3D%22Test+Repository%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/products/1/repositories?search=name%3D%22Test+Repository%22&per_page=4294967296 response: body: - string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test - Repository\"","sort":{"by":"name","order":"asc"},"results":[{"backend_identifier":"9fc32a80-a890-4913-b134-068ffaaef538","relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-5.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo/","library_instance_id":null,"version_href":"/pulp/api/v3/repositories/rpm/rpm/e00a11c1-2b5c-4141-99e5-5bab7e580892/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/62d4611d-4ae6-4c27-b6a2-60b92fed52f8/","publication_href":"/pulp/api/v3/publications/rpm/rpm/3852dedd-0ce1-4d2d-b74f-6e2ad7b60ffe/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":24,"name":"Test - Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":10,"name":"Default - Organization View"},"content_view_version":{"id":21,"name":"Default Organization - View 1.0","content_view_id":10},"kt_environment":{"id":5,"name":"Library"},"content_type":"yum","url":"https://localhost/pulp/repos/demo_repos/zoo","arch":"noarch","os_versions":[],"content_id":"1663154868357","generic_remote_options":null,"major":null,"minor":null,"product":{"id":21,"cp_id":"160566138145","name":"Test - Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null}]} + string: '{"total":2,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test + Repository\"","sort":{"by":"name","order":"asc"},"results":[{"backend_identifier":"d834ed96-f974-43a7-891c-9efcb358fe0b","relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-9.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo/","library_instance_id":null,"version_href":"/pulp/api/v3/repositories/rpm/rpm/45e870d8-eaaa-4b5b-a486-a0579ea295a9/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/ebfd859f-5ad8-423b-9875-daccce87ee33/","publication_href":"/pulp/api/v3/publications/rpm/rpm/2ff1d94b-4ec5-4a1b-ad0d-317d3e63354a/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":7,"name":"Test + Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://localhost/pulp/repos/demo_repos/zoo","arch":"noarch","os_versions":[],"content_id":"1690376649234","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null}],"org_repository_count":2} ' headers: @@ -200,6 +199,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '1650' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -213,13 +214,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -245,16 +244,16 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/repositories/24 + uri: https://foreman.example.org/katello/api/repositories/7 response: body: - string: ' {"relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo","promoted":false,"content_view_version_id":21,"library_instance_id":null,"last_contents_changed":"2022-09-14 - 11:27:48 UTC","organization_id":6,"organization":{"name":"Test Organization","label":"Test_Organization","id":6},"created_at":"2022-09-14 - 11:27:47 UTC","updated_at":"2022-09-14 11:27:55 UTC","backend_identifier":"9fc32a80-a890-4913-b134-068ffaaef538","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-5.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo/","version_href":"/pulp/api/v3/repositories/rpm/rpm/e00a11c1-2b5c-4141-99e5-5bab7e580892/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/62d4611d-4ae6-4c27-b6a2-60b92fed52f8/","publication_href":"/pulp/api/v3/publications/rpm/rpm/3852dedd-0ce1-4d2d-b74f-6e2ad7b60ffe/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":24,"name":"Test - Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":10,"name":"Default - Organization View"},"content_view_version":{"id":21,"name":"Default Organization - View 1.0","content_view_id":10},"kt_environment":{"id":5,"name":"Library"},"content_type":"yum","url":"https://localhost/pulp/repos/demo_repos/zoo","arch":"noarch","os_versions":[],"content_id":"1663154868357","generic_remote_options":null,"major":null,"minor":null,"product":{"id":21,"cp_id":"160566138145","name":"Test - Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null,"environment":{"id":5,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"include_tags":null,"exclude_tags":null,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":null,"name":null},"ssl_client_cert":{"id":null,"name":null},"ssl_client_key":{"id":null,"name":null},"gpg_key":{"id":null,"name":null},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false} + string: ' {"relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo","promoted":false,"content_view_version_id":2,"library_instance_id":null,"last_contents_changed":"2023-07-26 + 13:04:09 UTC","organization_id":3,"organization":{"name":"Test Organization","label":"Test_Organization","id":3},"created_at":"2023-07-26 + 13:04:08 UTC","updated_at":"2023-07-26 13:04:31 UTC","backend_identifier":"d834ed96-f974-43a7-891c-9efcb358fe0b","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-9.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo/","version_href":"/pulp/api/v3/repositories/rpm/rpm/45e870d8-eaaa-4b5b-a486-a0579ea295a9/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/ebfd859f-5ad8-423b-9875-daccce87ee33/","publication_href":"/pulp/api/v3/publications/rpm/rpm/2ff1d94b-4ec5-4a1b-ad0d-317d3e63354a/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":7,"name":"Test + Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://localhost/pulp/repos/demo_repos/zoo","arch":"noarch","os_versions":[],"content_id":"1690376649234","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null,"environment":{"id":2,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"include_tags":null,"exclude_tags":null,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"metadata_expire":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":null,"name":null},"ssl_client_cert":{"id":null,"name":null},"ssl_client_key":{"id":null,"name":null},"gpg_key":{"id":null,"name":null},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false} ' headers: @@ -262,6 +261,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '2806' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -275,13 +276,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -311,16 +310,16 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: PUT - uri: https://foreman.example.org/katello/api/repositories/24 + uri: https://foreman.example.org/katello/api/repositories/7 response: body: - string: ' {"relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo","promoted":false,"content_view_version_id":21,"library_instance_id":null,"last_contents_changed":"2022-09-14 - 11:27:48 UTC","organization_id":6,"organization":{"name":"Test Organization","label":"Test_Organization","id":6},"created_at":"2022-09-14 - 11:27:47 UTC","updated_at":"2022-09-14 11:27:55 UTC","backend_identifier":"9fc32a80-a890-4913-b134-068ffaaef538","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-5.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo/","version_href":"/pulp/api/v3/repositories/rpm/rpm/e00a11c1-2b5c-4141-99e5-5bab7e580892/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/62d4611d-4ae6-4c27-b6a2-60b92fed52f8/","publication_href":"/pulp/api/v3/publications/rpm/rpm/3852dedd-0ce1-4d2d-b74f-6e2ad7b60ffe/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":24,"name":"Test - Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":10,"name":"Default - Organization View"},"content_view_version":{"id":21,"name":"Default Organization - View 1.0","content_view_id":10},"kt_environment":{"id":5,"name":"Library"},"content_type":"yum","url":"https://localhost/pulp/repos/demo_repos/zoo","arch":"noarch","os_versions":[],"content_id":"1663154868357","generic_remote_options":null,"major":null,"minor":null,"product":{"id":21,"cp_id":"160566138145","name":"Test - Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null,"environment":{"id":5,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"include_tags":null,"exclude_tags":null,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":null,"name":null},"ssl_client_cert":{"id":null,"name":null},"ssl_client_key":{"id":null,"name":null},"gpg_key":{"id":null,"name":null},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false} + string: ' {"relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo","promoted":false,"content_view_version_id":2,"library_instance_id":null,"last_contents_changed":"2023-07-26 + 13:04:09 UTC","organization_id":3,"organization":{"name":"Test Organization","label":"Test_Organization","id":3},"created_at":"2023-07-26 + 13:04:08 UTC","updated_at":"2023-07-26 13:04:31 UTC","backend_identifier":"d834ed96-f974-43a7-891c-9efcb358fe0b","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-9.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo/","version_href":"/pulp/api/v3/repositories/rpm/rpm/45e870d8-eaaa-4b5b-a486-a0579ea295a9/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/ebfd859f-5ad8-423b-9875-daccce87ee33/","publication_href":"/pulp/api/v3/publications/rpm/rpm/2ff1d94b-4ec5-4a1b-ad0d-317d3e63354a/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":7,"name":"Test + Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://localhost/pulp/repos/demo_repos/zoo","arch":"noarch","os_versions":[],"content_id":"1690376649234","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null,"environment":{"id":2,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"include_tags":null,"exclude_tags":null,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"metadata_expire":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":null,"name":null},"ssl_client_cert":{"id":null,"name":null},"ssl_client_key":{"id":null,"name":null},"gpg_key":{"id":null,"name":null},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false} ' headers: @@ -328,6 +327,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '2806' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -341,13 +342,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/repository-7.yml b/tests/test_playbooks/fixtures/repository-7.yml index 6b3c57590..11b0c4dcb 100644 --- a/tests/test_playbooks/fixtures/repository-7.yml +++ b/tests/test_playbooks/fixtures/repository-7.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -68,17 +68,18 @@ interactions: uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ - : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ - : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\"\ - :\"Test_Organization\",\"created_at\":\"2022-09-14 11:27:41 UTC\",\"updated_at\"\ - :\"2022-09-14 11:27:43 UTC\",\"id\":6,\"name\":\"Test Organization\",\"title\"\ - :\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2023-06-23 + 11:37:20 UTC\",\"updated_at\":\"2023-06-23 11:37:22 UTC\",\"id\":3,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '388' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -92,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -124,14 +123,14 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/organizations/6/products?search=name%3D%22Test+Product%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/organizations/3/products?search=name%3D%22Test+Product%22&per_page=4294967296 response: body: string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test - Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":21,"cp_id":"160566138145","name":"Test - Product","label":"Test_Product","description":"A happy little test product","provider_id":9,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":"2022-09-14 - 11:27:57 UTC","last_sync_words":"less than a minute","organization_id":6,"organization":{"name":"Test - Organization","label":"Test_Organization","id":6},"sync_plan":null,"repository_count":1}]} + Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":1,"cp_id":"830157316014","name":"Test + Product","label":"Test_Product","description":"A happy little test product","provider_id":3,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":"2023-07-26 + 13:04:36 UTC","last_sync_words":"less than a minute","organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"sync_plan":null,"repository_count":2}]} ' headers: @@ -139,6 +138,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '664' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -150,15 +151,13 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 6; Test Organization + - 3; Test Organization Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -184,15 +183,15 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/products/21/repositories?search=name%3D%22Test+Repository%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/products/1/repositories?search=name%3D%22Test+Repository%22&per_page=4294967296 response: body: - string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test - Repository\"","sort":{"by":"name","order":"asc"},"results":[{"backend_identifier":"9fc32a80-a890-4913-b134-068ffaaef538","relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-5.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo/","library_instance_id":null,"version_href":"/pulp/api/v3/repositories/rpm/rpm/e00a11c1-2b5c-4141-99e5-5bab7e580892/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/62d4611d-4ae6-4c27-b6a2-60b92fed52f8/","publication_href":"/pulp/api/v3/publications/rpm/rpm/3852dedd-0ce1-4d2d-b74f-6e2ad7b60ffe/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":24,"name":"Test - Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":10,"name":"Default - Organization View"},"content_view_version":{"id":21,"name":"Default Organization - View 1.0","content_view_id":10},"kt_environment":{"id":5,"name":"Library"},"content_type":"yum","url":"https://localhost/pulp/repos/demo_repos/zoo","arch":"noarch","os_versions":[],"content_id":"1663154868357","generic_remote_options":null,"major":null,"minor":null,"product":{"id":21,"cp_id":"160566138145","name":"Test - Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null}]} + string: '{"total":2,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test + Repository\"","sort":{"by":"name","order":"asc"},"results":[{"backend_identifier":"d834ed96-f974-43a7-891c-9efcb358fe0b","relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-9.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo/","library_instance_id":null,"version_href":"/pulp/api/v3/repositories/rpm/rpm/45e870d8-eaaa-4b5b-a486-a0579ea295a9/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/ebfd859f-5ad8-423b-9875-daccce87ee33/","publication_href":"/pulp/api/v3/publications/rpm/rpm/2ff1d94b-4ec5-4a1b-ad0d-317d3e63354a/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":7,"name":"Test + Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://localhost/pulp/repos/demo_repos/zoo","arch":"noarch","os_versions":[],"content_id":"1690376649234","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo","last_sync_words":null}],"org_repository_count":2} ' headers: @@ -200,6 +199,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '1650' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -213,13 +214,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -247,10 +246,16 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: DELETE - uri: https://foreman.example.org/katello/api/repositories/24 + uri: https://foreman.example.org/katello/api/repositories/7 response: body: - string: ' {} + string: ' {"relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo","promoted":false,"content_view_version_id":2,"library_instance_id":null,"last_contents_changed":"2023-07-26 + 13:04:09 UTC","organization_id":3,"organization":{"name":"Test Organization","label":"Test_Organization","id":3},"created_at":"2023-07-26 + 13:04:08 UTC","updated_at":"2023-07-26 13:04:31 UTC","backend_identifier":"d834ed96-f974-43a7-891c-9efcb358fe0b","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-9.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo/","version_href":"/pulp/api/v3/repositories/rpm/rpm/45e870d8-eaaa-4b5b-a486-a0579ea295a9/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/ebfd859f-5ad8-423b-9875-daccce87ee33/","publication_href":"/pulp/api/v3/publications/rpm/rpm/2ff1d94b-4ec5-4a1b-ad0d-317d3e63354a/","content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"mirror_content_only","id":7,"name":"Test + Repository","label":"just_a_test_repo","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://localhost/pulp/repos/demo_repos/zoo","arch":"noarch","os_versions":[],"content_id":"1690376649234","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":null,"last_sync_words":null,"environment":{"id":2,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"include_tags":null,"exclude_tags":null,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"metadata_expire":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":null,"name":null},"ssl_client_cert":{"id":null,"name":null},"ssl_client_key":{"id":null,"name":null},"gpg_key":{"id":null,"name":null},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false,"content_view_environments":[]} ' headers: @@ -258,6 +263,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '2792' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -271,13 +278,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/repository-8.yml b/tests/test_playbooks/fixtures/repository-8.yml index 560caca52..a65aa6aaf 100644 --- a/tests/test_playbooks/fixtures/repository-8.yml +++ b/tests/test_playbooks/fixtures/repository-8.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -68,17 +68,18 @@ interactions: uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ - : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ - : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\"\ - :\"Test_Organization\",\"created_at\":\"2022-09-14 11:27:41 UTC\",\"updated_at\"\ - :\"2022-09-14 11:27:43 UTC\",\"id\":6,\"name\":\"Test Organization\",\"title\"\ - :\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2023-06-23 + 11:37:20 UTC\",\"updated_at\":\"2023-06-23 11:37:22 UTC\",\"id\":3,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '388' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -92,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -124,13 +123,14 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/organizations/6/products?search=name%3D%22Test+Product%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/organizations/3/products?search=name%3D%22Test+Product%22&per_page=4294967296 response: body: string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test - Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":21,"cp_id":"160566138145","name":"Test - Product","label":"Test_Product","description":"A happy little test product","provider_id":9,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":null,"last_sync_words":null,"organization_id":6,"organization":{"name":"Test - Organization","label":"Test_Organization","id":6},"sync_plan":null,"repository_count":0}]} + Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":1,"cp_id":"830157316014","name":"Test + Product","label":"Test_Product","description":"A happy little test product","provider_id":3,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":"2023-06-23 + 11:37:27 UTC","last_sync_words":"about 1 month","organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"sync_plan":null,"repository_count":1}]} ' headers: @@ -138,6 +138,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '659' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -149,15 +151,13 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 6; Test Organization + - 3; Test Organization Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -183,11 +183,11 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/products/21/repositories?search=name%3D%22Test+Repository%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/products/1/repositories?search=name%3D%22Test+Repository%22&per_page=4294967296 response: body: - string: '{"total":0,"subtotal":0,"selectable":0,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test - Repository\"","sort":{"by":"name","order":"asc"},"results":[]} + string: '{"total":1,"subtotal":0,"selectable":0,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test + Repository\"","sort":{"by":"name","order":"asc"},"results":[],"org_repository_count":1} ' headers: @@ -195,6 +195,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '195' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -208,13 +210,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/fixtures/repository-9.yml b/tests/test_playbooks/fixtures/repository-9.yml index 4415ef83e..aac3dd404 100644 --- a/tests/test_playbooks/fixtures/repository-9.yml +++ b/tests/test_playbooks/fixtures/repository-9.yml @@ -14,12 +14,14 @@ interactions: uri: https://foreman.example.org/api/status response: body: - string: '{"result":"ok","status":200,"version":"3.3.0","api_version":2}' + string: '{"result":"ok","status":200,"version":"3.7.0","api_version":2}' headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '62' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -33,13 +35,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=100 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -68,17 +68,18 @@ interactions: uri: https://foreman.example.org/katello/api/organizations?search=name%3D%22Test+Organization%22&per_page=4294967296 response: body: - string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\"\ - : 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\"\ - : {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\"\ - :\"Test_Organization\",\"created_at\":\"2022-09-14 11:27:41 UTC\",\"updated_at\"\ - :\"2022-09-14 11:27:43 UTC\",\"id\":6,\"name\":\"Test Organization\",\"title\"\ - :\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" + string: "{\n \"total\": 2,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\": + 4294967296,\n \"search\": \"name=\\\"Test Organization\\\"\",\n \"sort\": + {\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"label\":\"Test_Organization\",\"created_at\":\"2023-06-23 + 11:37:20 UTC\",\"updated_at\":\"2023-06-23 11:37:22 UTC\",\"id\":3,\"name\":\"Test + Organization\",\"title\":\"Test Organization\",\"description\":\"A test organization\"}]\n}\n" headers: Cache-Control: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '388' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -92,13 +93,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=99 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -124,13 +123,14 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/organizations/6/products?search=name%3D%22Test+Product%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/organizations/3/products?search=name%3D%22Test+Product%22&per_page=4294967296 response: body: string: '{"total":1,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test - Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":21,"cp_id":"160566138145","name":"Test - Product","label":"Test_Product","description":"A happy little test product","provider_id":9,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":null,"last_sync_words":null,"organization_id":6,"organization":{"name":"Test - Organization","label":"Test_Organization","id":6},"sync_plan":null,"repository_count":0}]} + Product\"","sort":{"by":"name","order":"asc"},"results":[{"id":1,"cp_id":"830157316014","name":"Test + Product","label":"Test_Product","description":"A happy little test product","provider_id":3,"sync_plan_id":null,"sync_summary":{},"gpg_key_id":null,"ssl_ca_cert_id":null,"ssl_client_cert_id":null,"ssl_client_key_id":null,"sync_state":null,"last_sync":"2023-06-23 + 11:37:27 UTC","last_sync_words":"about 1 month","organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"sync_plan":null,"repository_count":1}]} ' headers: @@ -138,6 +138,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '659' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -149,15 +151,13 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 6; Test Organization + - 3; Test Organization Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=98 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -183,16 +183,14 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/content_credentials?organization_id=6&search=name%3D%22Test+GPG+key%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/content_credentials?organization_id=3&search=name%3D%22Test+GPG+key%22&per_page=4294967296 response: body: string: '{"total":2,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test GPG key\"","sort":{"by":"name","order":"asc"},"results":[{"name":"Test GPG - key","content_type":"gpg_key","content":"-----BEGIN PGP PUBLIC KEY BLOCK-----\nVersion: - GnuPG v1.4.5 (GNU/Linux)\n\nmQENBFVMupABCAC9AiPd5+NBtEed8BG4hf4dt94dqJ4B+Lnnv7sVdoqO3tNHA8GW\nQayAPQRN+kAkCzZ+BoqMi7rKTwMyRvUGBpkFhuVCRbQdDIJuvP1S8liP42sPMhVY\n+mb7frXQE7EUZ0MH7PfxrvgcxiFi/awmBjQZkrYYbiYZPc7NJFshoJeLe5f6ZXqX\nm9GoX5MVxwC4iRNrHxQKTywvxTURt4wTx4+ZipUmrAjUcknW+g/try61dHJhLCWi\nqH8QYZLNnSgmbK9y8BoL0wxDTeos8sGbvVSd1sVoTiktyGOROjEAUlzC7PhUMjLF\nX9ECWS2q7NoysmheJwVeZxzMxXfvg83HoLyjABEBAAG0JkthdGVsbG8gPGZvcmVt\nYW4tZGV2QGdvb2dsZWdyb3Vwcy5jb20+iQE8BBMBAgAmBQJVTLqQAhsDBQkFo5qA\nBgsJCAcDAgQVAggDBBYCAwECHgECF4AACgkQCC1M07xi0T/8+Af/b4KfwT51wFWm\n3bN/LVEYKrfSE32PnlxAVX3jY+eSRnf3Cah+QH5eAGtDIn+hb2JXr5K+CEBnmupS\nRp57oZJQnqjxK4BRY2WstABxjSXG1gx8iC/vLq6dUV3lK5LSe9hfmXMKr3vos1x1\nb2ehiNstDj264aByokU9R9J3FDtwiEc/xaA7x66SSkWILYtRBYzUlu+lUmox3wJw\n0bCCWPF9PV0IpmzSKwqHLqaV985HtVovH34n//vQiMVnVmXYiiN5WQUrJs5VBmwy\nzXXOdEGqVA/0n4y7nG+hpFWgNb2G0/eSrIg4XWseMYXIc4tJF8zX0dU263A8fP/Q\neyRp696I2g==\n=5p62\n-----END - PGP PUBLIC KEY BLOCK-----","id":3,"organization_id":6,"organization":{"name":"Test - Organization","label":"Test_Organization","id":6},"created_at":"2022-09-14 - 11:27:44 UTC","updated_at":"2022-09-14 11:27:44 UTC","gpg_key_products":[],"gpg_key_repos":[],"ssl_ca_products":[],"ssl_ca_root_repos":[],"ssl_client_products":[],"ssl_client_root_repos":[],"ssl_key_products":[],"ssl_key_root_repos":[],"permissions":{"view_content_credenials":true,"edit_content_credenials":true,"destroy_content_credenials":true}}]} + key","content_type":"gpg_key","content":"key","id":4,"organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"created_at":"2023-07-26 + 12:27:28 UTC","updated_at":"2023-07-26 12:27:28 UTC","gpg_key_products":[],"gpg_key_repos":[],"ssl_ca_alternate_content_sources":[],"ssl_client_alternate_content_sources":[],"ssl_key_alternate_content_sources":[],"ssl_ca_products":[],"ssl_ca_root_repos":[],"ssl_client_products":[],"ssl_client_root_repos":[],"ssl_key_products":[],"ssl_key_root_repos":[],"permissions":{"view_content_credenials":true,"edit_content_credenials":true,"destroy_content_credenials":true}}]} ' headers: @@ -200,6 +198,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '829' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -211,15 +211,13 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 6; Test Organization + - 3; Test Organization Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=97 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -245,16 +243,14 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/content_credentials?organization_id=6&search=name%3D%22Test+SSL+Cert%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/content_credentials?organization_id=3&search=name%3D%22Test+SSL+Cert%22&per_page=4294967296 response: body: string: '{"total":2,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test SSL Cert\"","sort":{"by":"name","order":"asc"},"results":[{"name":"Test SSL - Cert","content_type":"cert","content":"-----BEGIN PGP PUBLIC KEY BLOCK-----\nVersion: - GnuPG v1.4.5 (GNU/Linux)\n\nmQENBFVMupABCAC9AiPd5+NBtEed8BG4hf4dt94dqJ4B+Lnnv7sVdoqO3tNHA8GW\nQayAPQRN+kAkCzZ+BoqMi7rKTwMyRvUGBpkFhuVCRbQdDIJuvP1S8liP42sPMhVY\n+mb7frXQE7EUZ0MH7PfxrvgcxiFi/awmBjQZkrYYbiYZPc7NJFshoJeLe5f6ZXqX\nm9GoX5MVxwC4iRNrHxQKTywvxTURt4wTx4+ZipUmrAjUcknW+g/try61dHJhLCWi\nqH8QYZLNnSgmbK9y8BoL0wxDTeos8sGbvVSd1sVoTiktyGOROjEAUlzC7PhUMjLF\nX9ECWS2q7NoysmheJwVeZxzMxXfvg83HoLyjABEBAAG0JkthdGVsbG8gPGZvcmVt\nYW4tZGV2QGdvb2dsZWdyb3Vwcy5jb20+iQE8BBMBAgAmBQJVTLqQAhsDBQkFo5qA\nBgsJCAcDAgQVAggDBBYCAwECHgECF4AACgkQCC1M07xi0T/8+Af/b4KfwT51wFWm\n3bN/LVEYKrfSE32PnlxAVX3jY+eSRnf3Cah+QH5eAGtDIn+hb2JXr5K+CEBnmupS\nRp57oZJQnqjxK4BRY2WstABxjSXG1gx8iC/vLq6dUV3lK5LSe9hfmXMKr3vos1x1\nb2ehiNstDj264aByokU9R9J3FDtwiEc/xaA7x66SSkWILYtRBYzUlu+lUmox3wJw\n0bCCWPF9PV0IpmzSKwqHLqaV985HtVovH34n//vQiMVnVmXYiiN5WQUrJs5VBmwy\nzXXOdEGqVA/0n4y7nG+hpFWgNb2G0/eSrIg4XWseMYXIc4tJF8zX0dU263A8fP/Q\neyRp696I2g==\n=5p62\n-----END - PGP PUBLIC KEY BLOCK-----","id":4,"organization_id":6,"organization":{"name":"Test - Organization","label":"Test_Organization","id":6},"created_at":"2022-09-14 - 11:27:44 UTC","updated_at":"2022-09-14 11:27:44 UTC","gpg_key_products":[],"gpg_key_repos":[],"ssl_ca_products":[],"ssl_ca_root_repos":[],"ssl_client_products":[],"ssl_client_root_repos":[],"ssl_key_products":[],"ssl_key_root_repos":[],"permissions":{"view_content_credenials":true,"edit_content_credenials":true,"destroy_content_credenials":true}}]} + Cert","content_type":"cert","content":"key","id":5,"organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"created_at":"2023-07-26 + 12:27:29 UTC","updated_at":"2023-07-26 12:27:29 UTC","gpg_key_products":[],"gpg_key_repos":[],"ssl_ca_alternate_content_sources":[],"ssl_client_alternate_content_sources":[],"ssl_key_alternate_content_sources":[],"ssl_ca_products":[],"ssl_ca_root_repos":[],"ssl_client_products":[],"ssl_client_root_repos":[],"ssl_key_products":[],"ssl_key_root_repos":[],"permissions":{"view_content_credenials":true,"edit_content_credenials":true,"destroy_content_credenials":true}}]} ' headers: @@ -262,6 +258,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '828' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -273,15 +271,13 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 6; Test Organization + - 3; Test Organization Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=96 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -307,16 +303,14 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/content_credentials?organization_id=6&search=name%3D%22Test+SSL+Cert%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/content_credentials?organization_id=3&search=name%3D%22Test+SSL+Cert%22&per_page=4294967296 response: body: string: '{"total":2,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test SSL Cert\"","sort":{"by":"name","order":"asc"},"results":[{"name":"Test SSL - Cert","content_type":"cert","content":"-----BEGIN PGP PUBLIC KEY BLOCK-----\nVersion: - GnuPG v1.4.5 (GNU/Linux)\n\nmQENBFVMupABCAC9AiPd5+NBtEed8BG4hf4dt94dqJ4B+Lnnv7sVdoqO3tNHA8GW\nQayAPQRN+kAkCzZ+BoqMi7rKTwMyRvUGBpkFhuVCRbQdDIJuvP1S8liP42sPMhVY\n+mb7frXQE7EUZ0MH7PfxrvgcxiFi/awmBjQZkrYYbiYZPc7NJFshoJeLe5f6ZXqX\nm9GoX5MVxwC4iRNrHxQKTywvxTURt4wTx4+ZipUmrAjUcknW+g/try61dHJhLCWi\nqH8QYZLNnSgmbK9y8BoL0wxDTeos8sGbvVSd1sVoTiktyGOROjEAUlzC7PhUMjLF\nX9ECWS2q7NoysmheJwVeZxzMxXfvg83HoLyjABEBAAG0JkthdGVsbG8gPGZvcmVt\nYW4tZGV2QGdvb2dsZWdyb3Vwcy5jb20+iQE8BBMBAgAmBQJVTLqQAhsDBQkFo5qA\nBgsJCAcDAgQVAggDBBYCAwECHgECF4AACgkQCC1M07xi0T/8+Af/b4KfwT51wFWm\n3bN/LVEYKrfSE32PnlxAVX3jY+eSRnf3Cah+QH5eAGtDIn+hb2JXr5K+CEBnmupS\nRp57oZJQnqjxK4BRY2WstABxjSXG1gx8iC/vLq6dUV3lK5LSe9hfmXMKr3vos1x1\nb2ehiNstDj264aByokU9R9J3FDtwiEc/xaA7x66SSkWILYtRBYzUlu+lUmox3wJw\n0bCCWPF9PV0IpmzSKwqHLqaV985HtVovH34n//vQiMVnVmXYiiN5WQUrJs5VBmwy\nzXXOdEGqVA/0n4y7nG+hpFWgNb2G0/eSrIg4XWseMYXIc4tJF8zX0dU263A8fP/Q\neyRp696I2g==\n=5p62\n-----END - PGP PUBLIC KEY BLOCK-----","id":4,"organization_id":6,"organization":{"name":"Test - Organization","label":"Test_Organization","id":6},"created_at":"2022-09-14 - 11:27:44 UTC","updated_at":"2022-09-14 11:27:44 UTC","gpg_key_products":[],"gpg_key_repos":[],"ssl_ca_products":[],"ssl_ca_root_repos":[],"ssl_client_products":[],"ssl_client_root_repos":[],"ssl_key_products":[],"ssl_key_root_repos":[],"permissions":{"view_content_credenials":true,"edit_content_credenials":true,"destroy_content_credenials":true}}]} + Cert","content_type":"cert","content":"key","id":5,"organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"created_at":"2023-07-26 + 12:27:29 UTC","updated_at":"2023-07-26 12:27:29 UTC","gpg_key_products":[],"gpg_key_repos":[],"ssl_ca_alternate_content_sources":[],"ssl_client_alternate_content_sources":[],"ssl_key_alternate_content_sources":[],"ssl_ca_products":[],"ssl_ca_root_repos":[],"ssl_client_products":[],"ssl_client_root_repos":[],"ssl_key_products":[],"ssl_key_root_repos":[],"permissions":{"view_content_credenials":true,"edit_content_credenials":true,"destroy_content_credenials":true}}]} ' headers: @@ -324,6 +318,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '828' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -335,15 +331,13 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 6; Test Organization + - 3; Test Organization Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=95 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -369,16 +363,14 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/content_credentials?organization_id=6&search=name%3D%22Test+SSL+Cert%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/content_credentials?organization_id=3&search=name%3D%22Test+SSL+Cert%22&per_page=4294967296 response: body: string: '{"total":2,"subtotal":1,"selectable":1,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test SSL Cert\"","sort":{"by":"name","order":"asc"},"results":[{"name":"Test SSL - Cert","content_type":"cert","content":"-----BEGIN PGP PUBLIC KEY BLOCK-----\nVersion: - GnuPG v1.4.5 (GNU/Linux)\n\nmQENBFVMupABCAC9AiPd5+NBtEed8BG4hf4dt94dqJ4B+Lnnv7sVdoqO3tNHA8GW\nQayAPQRN+kAkCzZ+BoqMi7rKTwMyRvUGBpkFhuVCRbQdDIJuvP1S8liP42sPMhVY\n+mb7frXQE7EUZ0MH7PfxrvgcxiFi/awmBjQZkrYYbiYZPc7NJFshoJeLe5f6ZXqX\nm9GoX5MVxwC4iRNrHxQKTywvxTURt4wTx4+ZipUmrAjUcknW+g/try61dHJhLCWi\nqH8QYZLNnSgmbK9y8BoL0wxDTeos8sGbvVSd1sVoTiktyGOROjEAUlzC7PhUMjLF\nX9ECWS2q7NoysmheJwVeZxzMxXfvg83HoLyjABEBAAG0JkthdGVsbG8gPGZvcmVt\nYW4tZGV2QGdvb2dsZWdyb3Vwcy5jb20+iQE8BBMBAgAmBQJVTLqQAhsDBQkFo5qA\nBgsJCAcDAgQVAggDBBYCAwECHgECF4AACgkQCC1M07xi0T/8+Af/b4KfwT51wFWm\n3bN/LVEYKrfSE32PnlxAVX3jY+eSRnf3Cah+QH5eAGtDIn+hb2JXr5K+CEBnmupS\nRp57oZJQnqjxK4BRY2WstABxjSXG1gx8iC/vLq6dUV3lK5LSe9hfmXMKr3vos1x1\nb2ehiNstDj264aByokU9R9J3FDtwiEc/xaA7x66SSkWILYtRBYzUlu+lUmox3wJw\n0bCCWPF9PV0IpmzSKwqHLqaV985HtVovH34n//vQiMVnVmXYiiN5WQUrJs5VBmwy\nzXXOdEGqVA/0n4y7nG+hpFWgNb2G0/eSrIg4XWseMYXIc4tJF8zX0dU263A8fP/Q\neyRp696I2g==\n=5p62\n-----END - PGP PUBLIC KEY BLOCK-----","id":4,"organization_id":6,"organization":{"name":"Test - Organization","label":"Test_Organization","id":6},"created_at":"2022-09-14 - 11:27:44 UTC","updated_at":"2022-09-14 11:27:44 UTC","gpg_key_products":[],"gpg_key_repos":[],"ssl_ca_products":[],"ssl_ca_root_repos":[],"ssl_client_products":[],"ssl_client_root_repos":[],"ssl_key_products":[],"ssl_key_root_repos":[],"permissions":{"view_content_credenials":true,"edit_content_credenials":true,"destroy_content_credenials":true}}]} + Cert","content_type":"cert","content":"key","id":5,"organization_id":3,"organization":{"name":"Test + Organization","label":"Test_Organization","id":3},"created_at":"2023-07-26 + 12:27:29 UTC","updated_at":"2023-07-26 12:27:29 UTC","gpg_key_products":[],"gpg_key_repos":[],"ssl_ca_alternate_content_sources":[],"ssl_client_alternate_content_sources":[],"ssl_key_alternate_content_sources":[],"ssl_ca_products":[],"ssl_ca_root_repos":[],"ssl_client_products":[],"ssl_client_root_repos":[],"ssl_key_products":[],"ssl_key_root_repos":[],"permissions":{"view_content_credenials":true,"edit_content_credenials":true,"destroy_content_credenials":true}}]} ' headers: @@ -386,6 +378,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '828' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -397,15 +391,13 @@ interactions: Foreman_current_location: - ; ANY Foreman_current_organization: - - 6; Test Organization + - 3; Test Organization Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=94 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -431,11 +423,11 @@ interactions: User-Agent: - apypie (https://github.com/Apipie/apypie) method: GET - uri: https://foreman.example.org/katello/api/products/21/repositories?search=name%3D%22Test+Repository+2%22&per_page=4294967296 + uri: https://foreman.example.org/katello/api/products/1/repositories?search=name%3D%22Test+Repository+2%22&per_page=4294967296 response: body: - string: '{"total":0,"subtotal":0,"selectable":0,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test - Repository 2\"","sort":{"by":"name","order":"asc"},"results":[]} + string: '{"total":1,"subtotal":0,"selectable":0,"page":1,"per_page":"4294967296","error":null,"search":"name=\"Test + Repository 2\"","sort":{"by":"name","order":"asc"},"results":[],"org_repository_count":1} ' headers: @@ -443,6 +435,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '197' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -456,13 +450,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=93 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: @@ -478,9 +470,9 @@ interactions: message: OK - request: body: '{"name": "Test Repository 2", "label": "just_a_test_repo2", "product_id": - 21, "content_type": "yum", "url": "https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/", - "gpg_key_id": 3, "ssl_ca_cert_id": 4, "ssl_client_cert_id": 4, "ssl_client_key_id": - 4, "mirroring_policy": "additive"}' + 1, "content_type": "yum", "url": "https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/", + "gpg_key_id": 4, "ssl_ca_cert_id": 5, "ssl_client_cert_id": 5, "ssl_client_key_id": + 5, "mirroring_policy": "additive"}' headers: Accept: - application/json;version=2 @@ -489,7 +481,7 @@ interactions: Connection: - keep-alive Content-Length: - - '286' + - '285' Content-Type: - application/json User-Agent: @@ -498,15 +490,15 @@ interactions: uri: https://foreman.example.org/katello/api/repositories response: body: - string: ' {"relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo2","promoted":false,"content_view_version_id":21,"library_instance_id":null,"last_contents_changed":"2022-09-14 - 11:28:02 UTC","organization_id":6,"organization":{"name":"Test Organization","label":"Test_Organization","id":6},"created_at":"2022-09-14 - 11:28:01 UTC","updated_at":"2022-09-14 11:28:02 UTC","backend_identifier":"3e823f85-a892-4b1d-ba9f-595e56c9b167","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-5.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo2/","version_href":"/pulp/api/v3/repositories/rpm/rpm/52d07ef3-f77c-4fb7-89cf-dbca9bf2d2eb/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/126c63ab-bac7-4d57-9bd3-2f53e7339727/","publication_href":null,"content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"additive","id":25,"name":"Test - Repository 2","label":"just_a_test_repo2","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":10,"name":"Default - Organization View"},"content_view_version":{"id":21,"name":"Default Organization - View 1.0","content_view_id":10},"kt_environment":{"id":5,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1663154882204","generic_remote_options":null,"major":null,"minor":null,"product":{"id":21,"cp_id":"160566138145","name":"Test - Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo2","last_sync_words":null,"environment":{"id":5,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"include_tags":null,"exclude_tags":null,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":3,"ssl_ca_cert_id":4,"ssl_client_cert_id":4,"ssl_client_key_id":4,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":4,"name":"Test - SSL Cert"},"ssl_client_cert":{"id":4,"name":"Test SSL Cert"},"ssl_client_key":{"id":4,"name":"Test - SSL Cert"},"gpg_key":{"id":3,"name":"Test GPG key"},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false,"content_view_environments":[]} + string: ' {"relative_path":"Test_Organization/Library/custom/Test_Product/just_a_test_repo2","promoted":false,"content_view_version_id":2,"library_instance_id":null,"last_contents_changed":"2023-07-26 + 13:04:48 UTC","organization_id":3,"organization":{"name":"Test Organization","label":"Test_Organization","id":3},"created_at":"2023-07-26 + 13:04:47 UTC","updated_at":"2023-07-26 13:04:49 UTC","backend_identifier":"8d0a3018-7146-4e37-805a-a92b08fe3c1f","container_repository_name":null,"full_path":"https://centos8-stream-katello-4-9.tanso.example.com/pulp/content/Test_Organization/Library/custom/Test_Product/just_a_test_repo2/","version_href":"/pulp/api/v3/repositories/rpm/rpm/eca30b5c-cc28-4297-ba07-13aee12b9432/versions/0/","remote_href":"/pulp/api/v3/remotes/rpm/rpm/196ab34a-3a0e-41e2-aba3-ff880ecb00a0/","publication_href":null,"content_counts":{"rpm":0,"erratum":0,"package_group":0,"srpm":0,"module_stream":0},"mirroring_policy":"additive","id":8,"name":"Test + Repository 2","label":"just_a_test_repo2","description":null,"content_view_versions":[],"last_sync":null,"content_view":{"id":2,"name":"Default + Organization View"},"content_view_version":{"id":2,"name":"Default Organization + View 1.0","content_view_id":2},"kt_environment":{"id":2,"name":"Library"},"content_type":"yum","url":"https://repos.fedorapeople.org/pulp/pulp/demo_repos/zoo/","arch":"noarch","os_versions":[],"content_id":"1690376688252","generic_remote_options":null,"major":null,"minor":null,"product":{"id":1,"cp_id":"830157316014","name":"Test + Product","orphaned":false,"redhat":false,"sync_plan":null},"content_label":"Test_Organization_Test_Product_just_a_test_repo2","last_sync_words":null,"environment":{"id":2,"registry_unauthenticated_pull":false},"docker_upstream_name":null,"docker_tags_whitelist":null,"include_tags":null,"exclude_tags":null,"verify_ssl_on_sync":true,"unprotected":true,"checksum_type":null,"download_policy":"immediate","ansible_collection_requirements":null,"ansible_collection_auth_url":null,"ansible_collection_auth_token":null,"gpg_key_id":4,"ssl_ca_cert_id":5,"ssl_client_cert_id":5,"ssl_client_key_id":5,"upstream_username":null,"deb_releases":null,"deb_components":null,"deb_architectures":null,"http_proxy_policy":"global_default_http_proxy","http_proxy_id":null,"http_proxy_name":null,"retain_package_versions_count":null,"metadata_expire":null,"ignorable_content":null,"http_proxy":{"id":null,"name":null,"policy":"global_default_http_proxy"},"ssl_ca_cert":{"id":5,"name":"Test + SSL Cert"},"ssl_client_cert":{"id":5,"name":"Test SSL Cert"},"ssl_client_key":{"id":5,"name":"Test + SSL Cert"},"gpg_key":{"id":4,"name":"Test GPG key"},"permissions":{"deletable":true,"deletable_across_cv":true},"upstream_password_exists":false,"upstream_auth_exists":false,"content_view_environments":[]} ' headers: @@ -514,6 +506,8 @@ interactions: - max-age=0, private, must-revalidate Connection: - Keep-Alive + Content-Length: + - '2795' Content-Security-Policy: - 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:; img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self''; @@ -527,13 +521,11 @@ interactions: Foreman_current_organization: - ; ANY Foreman_version: - - 3.3.0 + - 3.7.0 Keep-Alive: - timeout=15, max=92 Strict-Transport-Security: - max-age=631139040; includeSubdomains - Transfer-Encoding: - - chunked X-Content-Type-Options: - nosniff X-Download-Options: diff --git a/tests/test_playbooks/repository.yml b/tests/test_playbooks/repository.yml index 7ecd07e7e..c8c503b57 100644 --- a/tests/test_playbooks/repository.yml +++ b/tests/test_playbooks/repository.yml @@ -11,11 +11,15 @@ organization_state: present - include_tasks: tasks/content_credential.yml vars: + content_credential_name: "Test GPG key" + content_credential_type: "gpg_key" + content_credential_content: "key" content_credential_state: present - include_tasks: tasks/content_credential.yml vars: content_credential_name: "Test SSL Cert" content_credential_type: "cert" + content_credential_content: "key" content_credential_state: present - include_tasks: tasks/product.yml vars: @@ -117,6 +121,24 @@ repository_mirroring_policy: mirror_content_only expected_change: false repository_name: "Test Repository 2" + - include_tasks: tasks/repository.yml + vars: + repository_state: present + repository_gpg_key: "" + repository_ssl_ca_cert: "" + repository_ssl_client_cert: "" + repository_ssl_client_key: "" + expected_change: true + repository_name: "Test Repository 2" + - include_tasks: tasks/repository.yml + vars: + repository_state: present + repository_gpg_key: "" + repository_ssl_ca_cert: "" + repository_ssl_client_cert: "" + repository_ssl_client_key: "" + expected_change: false + repository_name: "Test Repository 2" - include_tasks: tasks/repository.yml vars: repository_state: absent From 25815553557f99010f9fe66843cbec817a7aadd5 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Thu, 27 Jul 2023 09:08:33 +0200 Subject: [PATCH 16/19] patch katello apidoc to allow unsetting content credentials before 4.10 --- plugins/module_utils/foreman_helper.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/plugins/module_utils/foreman_helper.py b/plugins/module_utils/foreman_helper.py index 83a952f1b..fab8bd116 100644 --- a/plugins/module_utils/foreman_helper.py +++ b/plugins/module_utils/foreman_helper.py @@ -575,6 +575,21 @@ def _patch_organization_ignore_types_api(self): _organization_create['params'].append(_ignore_types_param) _organization_update['params'].append(_ignore_types_param) + @_check_patch_needed(fixed_version='3.8.0', plugins=['katello']) + def _patch_products_repositories_allow_nil_credential(self): + """ + This is a workaround for the missing allow_nil: true in the Products and Repositories controllers + See https://projects.theforeman.org/issues/36497 + """ + + for resource in ['products', 'repositories']: + methods = self.foremanapi.apidoc['docs']['resources'][resource]['methods'] + for action in ['create', 'update']: + resource_action = next(x for x in methods if x['name'] == action) + for param in ['gpg_key_id', 'ssl_ca_cert_id', 'ssl_client_cert_id', 'ssl_client_key_id']: + resource_param = next(x for x in resource_action['params'] if x['name'] == param) + resource_param['allow_nil'] = True + def check_requirements(self): if not HAS_APYPIE: self.fail_json(msg=missing_required_lib("requests"), exception=APYPIE_IMP_ERR) @@ -620,6 +635,7 @@ def apply_apidoc_patches(self): self._patch_cv_filter_rule_api() self._patch_ak_product_content_per_page() self._patch_organization_ignore_types_api() + self._patch_products_repositories_allow_nil_credential() @_exception2fail_json(msg="Failed to connect to Foreman server: {0}") def status(self): From 9cd309302aed1a6541c9a2d8c4d272339d73b5e2 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 22 Aug 2023 11:11:50 +0200 Subject: [PATCH 17/19] ignore `retries` keyword in callback tests its value is sometimes present and sometimes not, based on ansible version --- tests/test_callback.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_callback.py b/tests/test_callback.py index 91a7b9540..03783e4ba 100644 --- a/tests/test_callback.py +++ b/tests/test_callback.py @@ -39,7 +39,7 @@ def drop_incompatible_items(d): dd = {} for k, v in d.items(): if k in ['msg', 'start', 'end', 'delta', 'uuid', 'timeout', '_ansible_no_log', 'warn', 'connection', - 'extended_allitems', 'loop_control', 'expand_argument_vars']: + 'extended_allitems', 'loop_control', 'expand_argument_vars', 'retries']: continue if isinstance(v, dict): From 1c7cbd279d78eb1f9f55a73152dd8eb257a282ea Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 15 Aug 2023 11:07:49 +0200 Subject: [PATCH 18/19] document that some inventory params only work for report api inventories --- plugins/inventory/foreman.py | 48 ++++++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 13 deletions(-) diff --git a/plugins/inventory/foreman.py b/plugins/inventory/foreman.py index b64b4cd19..1c165196b 100644 --- a/plugins/inventory/foreman.py +++ b/plugins/inventory/foreman.py @@ -16,6 +16,10 @@ - requests >= 1.1 description: - Get inventory hosts from Foreman. + - Can use the Reports API (default) or the Hosts API to fetch information about the hosts. + - The Reports API is faster with many hosts. + - The Reports API requires the C(foreman_ansible) plugin to be installed on the Foreman server. + - Some options only work when using the Reports API. - Uses a YAML configuration file that ends with ``foreman.(yml|yaml)``. extends_documentation_fragment: - inventory_cache @@ -85,13 +89,13 @@ type: int default: 250 use_reports_api: - description: Use Reporting API. + description: Use Reports API. type: boolean default: true foreman: description: - Foreman server related configuration, deprecated. - - You can pass I(use_reports_api) in this dict to enable the Reporting API. + - You can pass I(use_reports_api) in this dict to enable the Reports API. - Only for backward compatibility. report: description: @@ -108,39 +112,57 @@ type: int default: 600 want_organization: - description: Toggle, if true the inventory will fetch organization the host belongs to and create groupings for the same. + description: + - Toggle, if true the inventory will fetch organization the host belongs to and create groupings for the same. + - Only applies to inventories using the Reports API - attribute is ignored otherwise. type: boolean default: true want_location: - description: Toggle, if true the inventory will fetch location the host belongs to and create groupings for the same. + description: + - Toggle, if true the inventory will fetch location the host belongs to and create groupings for the same. + - Only applies to inventories using the Reports API - attribute is ignored otherwise. type: boolean default: true want_ipv4: - description: Toggle, if true the inventory will fetch ipv4 address of the host. + description: + - Toggle, if true the inventory will fetch ipv4 address of the host. + - Only applies to inventories using the Reports API - attribute is ignored otherwise. type: boolean default: true want_ipv6: - description: Toggle, if true the inventory will fetch ipv6 address of the host. + description: + - Toggle, if true the inventory will fetch ipv6 address of the host. + - Only applies to inventories using the Reports API - attribute is ignored otherwise. type: boolean default: true want_host_group: - description: Toggle, if true the inventory will fetch host_groups and create groupings for the same. + description: + - Toggle, if true the inventory will fetch host_groups and create groupings for the same. + - Only applies to inventories using the Reports API - attribute is ignored otherwise. type: boolean default: true want_subnet: - description: Toggle, if true the inventory will fetch subnet. + description: + - Toggle, if true the inventory will fetch subnet. + - Only applies to inventories using the Reports API - attribute is ignored otherwise. type: boolean default: true want_subnet_v6: - description: Toggle, if true the inventory will fetch ipv6 subnet. + description: + - Toggle, if true the inventory will fetch ipv6 subnet. + - Only applies to inventories using the Reports API - attribute is ignored otherwise. type: boolean default: true want_smart_proxies: - description: Toggle, if true the inventory will fetch smart proxy that the host is registered to. + description: + - Toggle, if true the inventory will fetch smart proxy that the host is registered to. + - Only applies to inventories using the Reports API - attribute is ignored otherwise. type: boolean default: true want_content_facet_attributes: - description: Toggle, if true the inventory will fetch content view details that the host is tied to. + description: + - Toggle, if true the inventory will fetch content view details that the host is tied to. + - Only applies to inventories using the Reports API - attribute is ignored otherwise. type: boolean default: true hostnames: @@ -196,7 +218,7 @@ class InventoryModule(BaseInventoryPlugin, Cacheable, Constructable): def __init__(self): super(InventoryModule, self).__init__() - self.MINIMUM_FOREMAN_VERSION_FOR_REPORTING_API = '1.24.0' + self.MINIMUM_FOREMAN_VERSION_FOR_REPORTS_API = '1.24.0' # from config self.foreman_url = None @@ -377,7 +399,7 @@ def _use_inventory_report(self): return False status_url = "%s/api/v2/status" % self.foreman_url result = self._get_json(status_url) - foreman_version = (LooseVersion(result.get('version')) >= LooseVersion(self.MINIMUM_FOREMAN_VERSION_FOR_REPORTING_API)) + foreman_version = (LooseVersion(result.get('version')) >= LooseVersion(self.MINIMUM_FOREMAN_VERSION_FOR_REPORTS_API)) return foreman_version def _post_request(self): From 4c34fdee304c5c8e00d4046d6ca8d0ea42f3261f Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 15 Aug 2023 08:12:49 +0200 Subject: [PATCH 19/19] Release 3.13.0 --- CHANGELOG.rst | 20 ++++++++++++++++++ changelogs/changelog.yaml | 21 +++++++++++++++++++ changelogs/fragments/1641-openstack.yml | 2 -- ...4-smart_class_parameter-override_false.yml | 2 -- .../fragments/bz2224122-repo-org-scope.yml | 2 -- .../repositories_role-state_override.yml | 2 -- galaxy.yml | 8 +++++-- 7 files changed, 47 insertions(+), 10 deletions(-) delete mode 100644 changelogs/fragments/1641-openstack.yml delete mode 100644 changelogs/fragments/1644-smart_class_parameter-override_false.yml delete mode 100644 changelogs/fragments/bz2224122-repo-org-scope.yml delete mode 100644 changelogs/fragments/repositories_role-state_override.yml diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 16b2c7970..c402553e2 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,6 +6,26 @@ theforeman.foreman Release Notes This changelog describes changes after version 0.8.1. +v3.13.0 +======= + +Minor Changes +------------- + +- compute_resource - add support for OpenStack +- repositories role - allow disabling/removing of repositories by setting the ``state`` parameter + +Bugfixes +-------- + +- repository - don't fail when removing a content credential from a repository (https://bugzilla.redhat.com/show_bug.cgi?id=2224122) +- smart_class_parameter - correctly allow setting ``override`` to ``false`` (https://github.com/theforeman/foreman-ansible-modules/issues/1644) + +New Modules +----------- + +- theforeman.foreman.wait_for_task - Wait for a task + v3.12.0 ======= diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index f78d49c0d..1a15335b1 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -623,6 +623,27 @@ releases: - 2023-06-26-forgotten-changelogs.yml - content_view_filter_deb_support.yml release_date: '2023-07-10' + 3.13.0: + changes: + bugfixes: + - repository - don't fail when removing a content credential from a repository + (https://bugzilla.redhat.com/show_bug.cgi?id=2224122) + - smart_class_parameter - correctly allow setting ``override`` to ``false`` + (https://github.com/theforeman/foreman-ansible-modules/issues/1644) + minor_changes: + - compute_resource - add support for OpenStack + - repositories role - allow disabling/removing of repositories by setting the + ``state`` parameter + fragments: + - 1641-openstack.yml + - 1644-smart_class_parameter-override_false.yml + - bz2224122-repo-org-scope.yml + - repositories_role-state_override.yml + modules: + - description: Wait for a task + name: wait_for_task + namespace: '' + release_date: '2023-08-15' 3.2.0: changes: bugfixes: diff --git a/changelogs/fragments/1641-openstack.yml b/changelogs/fragments/1641-openstack.yml deleted file mode 100644 index 57669e191..000000000 --- a/changelogs/fragments/1641-openstack.yml +++ /dev/null @@ -1,2 +0,0 @@ -minor_changes: - - compute_resource - add support for OpenStack \ No newline at end of file diff --git a/changelogs/fragments/1644-smart_class_parameter-override_false.yml b/changelogs/fragments/1644-smart_class_parameter-override_false.yml deleted file mode 100644 index 07bfcce41..000000000 --- a/changelogs/fragments/1644-smart_class_parameter-override_false.yml +++ /dev/null @@ -1,2 +0,0 @@ -bugfixes: - - smart_class_parameter - correctly allow setting ``override`` to ``false`` (https://github.com/theforeman/foreman-ansible-modules/issues/1644) \ No newline at end of file diff --git a/changelogs/fragments/bz2224122-repo-org-scope.yml b/changelogs/fragments/bz2224122-repo-org-scope.yml deleted file mode 100644 index 81b3cba30..000000000 --- a/changelogs/fragments/bz2224122-repo-org-scope.yml +++ /dev/null @@ -1,2 +0,0 @@ -bugfixes: - - repository - don't fail when removing a content credential from a repository (https://bugzilla.redhat.com/show_bug.cgi?id=2224122) diff --git a/changelogs/fragments/repositories_role-state_override.yml b/changelogs/fragments/repositories_role-state_override.yml deleted file mode 100644 index 8fb830936..000000000 --- a/changelogs/fragments/repositories_role-state_override.yml +++ /dev/null @@ -1,2 +0,0 @@ -minor_changes: - - repositories role - allow disabling/removing of repositories by setting the ``state`` parameter diff --git a/galaxy.yml b/galaxy.yml index 5a7a1c4d1..72a7aa3b6 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -6,6 +6,7 @@ authors: - "Adam Růžička " - "Alan.Wong " - "AlanCoding " + - "Andrea Perotti " - "Andrew Kofink " - "Anthony Green " - "Anton " @@ -39,6 +40,7 @@ authors: - "Jesper Reenberg " - "John Berninger " - "Josh Swanson " + - "Julien Godin " - "Kenny Tordeurs " - "Kirill Shirinkin " - "Leos Stejskal " @@ -77,11 +79,13 @@ authors: - "Sorin Sbarnea " - "Steffen Frömer " - "Stoned Elipot " + - "Sven Meeus " - "TTherouanne " - "Thomas Mueller " - "William Bradford Clark " - "Yifat Makias " - "achevalet " + - "alesc " - "bob <57952350+TheRedGreek@users.noreply.github.com>" - "calvingsmith <4283930+calvingsmith@users.noreply.github.com>" - "divialth <65872926+divialth@users.noreply.github.com>" @@ -93,8 +97,8 @@ authors: - "metalcated " - "russianguppie <46544650+russianguppie@users.noreply.github.com>" - "willtome " - - "Julien Godin " -version: "3.13.0-dev" + - "yuqo2450 <79540477+yuqo2450@users.noreply.github.com>" +version: "3.13.0" license: - "GPL-3.0-or-later" tags: