Skip to content

Commit

Permalink
fix resource_info tests
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Sep 10, 2024
1 parent 221b0a1 commit defc756
Show file tree
Hide file tree
Showing 8 changed files with 487 additions and 655 deletions.
136 changes: 51 additions & 85 deletions tests/test_playbooks/fixtures/resource_info-0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,60 +11,44 @@ interactions:
User-Agent:
- apypie (https://github.com/Apipie/apypie)
method: GET
uri: https://centos7-foreman-1-23.yatsu.example.com/api/status
uri: https://foreman.example.org/api/status
response:
body:
string: !!python/unicode '{"result":"ok","status":200,"version":"1.23.1","api_version":2}'
string: '{"result":"ok","status":200,"version":"3.13.0-develop","api_version":2}'
headers:
cache-control:
Cache-Control:
- max-age=0, private, must-revalidate
connection:
Connection:
- Keep-Alive
content-length:
- '63'
content-security-policy:
Content-Length:
- '71'
Content-Security-Policy:
- 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:;
img-src ''self'' data: *.gravatar.com; script-src ''unsafe-eval'' ''unsafe-inline''
''self''; style-src ''unsafe-inline'' ''self'''
content-type:
img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self'';
style-src ''unsafe-inline'' ''self'''
Content-Type:
- application/json; charset=utf-8
date:
- Fri, 29 Nov 2019 12:01:43 GMT
etag:
- W/"f26fab35869f9a602399f2f56dc6b2ef"
foreman_api_version:
Foreman_api_version:
- '2'
foreman_current_location:
Foreman_current_location:
- ; ANY
foreman_current_organization:
Foreman_current_organization:
- ; ANY
foreman_version:
- 1.23.1
keep-alive:
- timeout=5, max=100
server:
- Apache
set-cookie:
- _session_id=a126f6c4c85f96d4b8c4d538838d449c; path=/; secure; HttpOnly; SameSite=Lax
status:
- 200 OK
strict-transport-security:
Foreman_version:
- 3.13.0-develop
Keep-Alive:
- timeout=15, max=100
Strict-Transport-Security:
- max-age=631139040; includeSubdomains
x-content-type-options:
X-Content-Type-Options:
- nosniff
x-download-options:
X-Download-Options:
- noopen
x-frame-options:
X-Frame-Options:
- sameorigin
x-permitted-cross-domain-policies:
X-Permitted-Cross-Domain-Policies:
- none
x-powered-by:
- Phusion Passenger 4.0.53
x-request-id:
- a2cdb87f-2061-4eb0-ab7b-a6a895c5e057
x-runtime:
- '0.105805'
x-xss-protection:
X-XSS-Protection:
- 1; mode=block
status:
code: 200
Expand All @@ -78,70 +62,52 @@ interactions:
- gzip, deflate
Connection:
- keep-alive
Cookie:
- _session_id=a126f6c4c85f96d4b8c4d538838d449c
User-Agent:
- apypie (https://github.com/Apipie/apypie)
method: GET
uri: https://centos7-foreman-1-23.yatsu.example.com/api/settings?per_page=4294967296&search=name+%3D+http_proxy
uri: https://foreman.example.org/api/settings?search=name+%3D+http_proxy&per_page=4294967296
response:
body:
string: !!python/unicode "{\n \"total\": 135,\n \"subtotal\": 1,\n \"page\":
1,\n \"per_page\": 4294967296,\n \"search\": \"name = http_proxy\",\n \"sort\":
{\n \"by\": null,\n \"order\": null\n },\n \"results\": [{\"value\":null,\"description\":\"Sets
a proxy for all outgoing HTTP connections.\",\"category\":\"Setting::General\",\"settings_type\":null,\"default\":null,\"created_at\":\"2019-10-18
08:35:25 UTC\",\"updated_at\":\"2019-10-18 08:35:25 UTC\",\"id\":11,\"name\":\"http_proxy\",\"full_name\":\"HTTP(S)
proxy\",\"category_name\":\"General\"}]\n}\n"
string: "{\n \"total\": 0,\n \"subtotal\": 1,\n \"page\": 1,\n \"per_page\":
4294967296,\n \"search\": \"name = http_proxy\",\n \"sort\": {\n \"by\":
null,\n \"order\": null\n },\n \"results\": [{\"description\":\"Set a
proxy for all outgoing HTTP(S) connections from Foreman. System-wide proxies
must be configured at the operating system level.\",\"settings_type\":null,\"default\":null,\"updated_at\":null,\"id\":\"http_proxy\",\"name\":\"http_proxy\",\"full_name\":\"HTTP(S)
proxy\",\"value\":null,\"category\":\"general\",\"category_name\":\"General\",\"readonly\":false,\"config_file\":null,\"encrypted\":false,\"select_values\":null}]\n}\n"
headers:
cache-control:
Cache-Control:
- max-age=0, private, must-revalidate
connection:
Connection:
- Keep-Alive
content-length:
- '480'
content-security-policy:
Content-Length:
- '579'
Content-Security-Policy:
- 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:;
img-src ''self'' data: *.gravatar.com; script-src ''unsafe-eval'' ''unsafe-inline''
''self''; style-src ''unsafe-inline'' ''self'''
content-type:
img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self'';
style-src ''unsafe-inline'' ''self'''
Content-Type:
- application/json; charset=utf-8
date:
- Fri, 29 Nov 2019 12:01:43 GMT
etag:
- W/"2c9ad527f2fde387381ba7e9b3cf97c6-gzip"
foreman_api_version:
Foreman_api_version:
- '2'
foreman_current_location:
Foreman_current_location:
- ; ANY
foreman_current_organization:
Foreman_current_organization:
- ; ANY
foreman_version:
- 1.23.1
keep-alive:
- timeout=5, max=99
server:
- Apache
status:
- 200 OK
strict-transport-security:
Foreman_version:
- 3.13.0-develop
Keep-Alive:
- timeout=15, max=99
Strict-Transport-Security:
- max-age=631139040; includeSubdomains
vary:
- Accept-Encoding
x-content-type-options:
X-Content-Type-Options:
- nosniff
x-download-options:
X-Download-Options:
- noopen
x-frame-options:
X-Frame-Options:
- sameorigin
x-permitted-cross-domain-policies:
X-Permitted-Cross-Domain-Policies:
- none
x-powered-by:
- Phusion Passenger 4.0.53
x-request-id:
- 75384dfa-3738-47c6-aa81-841a93fe775d
x-runtime:
- '0.017151'
x-xss-protection:
X-XSS-Protection:
- 1; mode=block
status:
code: 200
Expand Down
130 changes: 48 additions & 82 deletions tests/test_playbooks/fixtures/resource_info-1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,60 +11,44 @@ interactions:
User-Agent:
- apypie (https://github.com/Apipie/apypie)
method: GET
uri: https://centos7-foreman-1-23.yatsu.example.com/api/status
uri: https://foreman.example.org/api/status
response:
body:
string: !!python/unicode '{"result":"ok","status":200,"version":"1.23.1","api_version":2}'
string: '{"result":"ok","status":200,"version":"3.13.0-develop","api_version":2}'
headers:
cache-control:
Cache-Control:
- max-age=0, private, must-revalidate
connection:
Connection:
- Keep-Alive
content-length:
- '63'
content-security-policy:
Content-Length:
- '71'
Content-Security-Policy:
- 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:;
img-src ''self'' data: *.gravatar.com; script-src ''unsafe-eval'' ''unsafe-inline''
''self''; style-src ''unsafe-inline'' ''self'''
content-type:
img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self'';
style-src ''unsafe-inline'' ''self'''
Content-Type:
- application/json; charset=utf-8
date:
- Fri, 29 Nov 2019 12:01:44 GMT
etag:
- W/"f26fab35869f9a602399f2f56dc6b2ef"
foreman_api_version:
Foreman_api_version:
- '2'
foreman_current_location:
Foreman_current_location:
- ; ANY
foreman_current_organization:
Foreman_current_organization:
- ; ANY
foreman_version:
- 1.23.1
keep-alive:
- timeout=5, max=100
server:
- Apache
set-cookie:
- _session_id=9019c95e4f41ab6ce2a6328805e6430b; path=/; secure; HttpOnly; SameSite=Lax
status:
- 200 OK
strict-transport-security:
Foreman_version:
- 3.13.0-develop
Keep-Alive:
- timeout=15, max=100
Strict-Transport-Security:
- max-age=631139040; includeSubdomains
x-content-type-options:
X-Content-Type-Options:
- nosniff
x-download-options:
X-Download-Options:
- noopen
x-frame-options:
X-Frame-Options:
- sameorigin
x-permitted-cross-domain-policies:
X-Permitted-Cross-Domain-Policies:
- none
x-powered-by:
- Phusion Passenger 4.0.53
x-request-id:
- 56967311-f69f-48a2-8e4c-8b55f049d2af
x-runtime:
- '0.104241'
x-xss-protection:
X-XSS-Protection:
- 1; mode=block
status:
code: 200
Expand All @@ -78,67 +62,49 @@ interactions:
- gzip, deflate
Connection:
- keep-alive
Cookie:
- _session_id=9019c95e4f41ab6ce2a6328805e6430b
User-Agent:
- apypie (https://github.com/Apipie/apypie)
method: GET
uri: https://centos7-foreman-1-23.yatsu.example.com/api/subnets?per_page=4294967296&search=
uri: https://foreman.example.org/api/http_proxies?per_page=4294967296
response:
body:
string: !!python/unicode "{\n \"total\": 0,\n \"subtotal\": 0,\n \"page\":
1,\n \"per_page\": 4294967296,\n \"search\": \"\",\n \"sort\": {\n \"by\":
null,\n \"order\": null\n },\n \"results\": []\n}\n"
string: "{\n \"total\": 0,\n \"subtotal\": 0,\n \"page\": 1,\n \"per_page\":
4294967296,\n \"search\": null,\n \"sort\": {\n \"by\": null,\n \"order\":
null\n },\n \"results\": []\n}\n"
headers:
cache-control:
Cache-Control:
- max-age=0, private, must-revalidate
connection:
Connection:
- Keep-Alive
content-length:
- '157'
content-security-policy:
Content-Length:
- '159'
Content-Security-Policy:
- 'default-src ''self''; child-src ''self''; connect-src ''self'' ws: wss:;
img-src ''self'' data: *.gravatar.com; script-src ''unsafe-eval'' ''unsafe-inline''
''self''; style-src ''unsafe-inline'' ''self'''
content-type:
img-src ''self'' data:; script-src ''unsafe-eval'' ''unsafe-inline'' ''self'';
style-src ''unsafe-inline'' ''self'''
Content-Type:
- application/json; charset=utf-8
date:
- Fri, 29 Nov 2019 12:01:44 GMT
etag:
- W/"40a0449a96292ac57dbe10f6cd6b803f-gzip"
foreman_api_version:
Foreman_api_version:
- '2'
foreman_current_location:
Foreman_current_location:
- ; ANY
foreman_current_organization:
Foreman_current_organization:
- ; ANY
foreman_version:
- 1.23.1
keep-alive:
- timeout=5, max=99
server:
- Apache
status:
- 200 OK
strict-transport-security:
Foreman_version:
- 3.13.0-develop
Keep-Alive:
- timeout=15, max=99
Strict-Transport-Security:
- max-age=631139040; includeSubdomains
vary:
- Accept-Encoding
x-content-type-options:
X-Content-Type-Options:
- nosniff
x-download-options:
X-Download-Options:
- noopen
x-frame-options:
X-Frame-Options:
- sameorigin
x-permitted-cross-domain-policies:
X-Permitted-Cross-Domain-Policies:
- none
x-powered-by:
- Phusion Passenger 4.0.53
x-request-id:
- 46b4d8c8-5b8f-498c-99f4-309e49d4e259
x-runtime:
- '0.014897'
x-xss-protection:
X-XSS-Protection:
- 1; mode=block
status:
code: 200
Expand Down
Loading

0 comments on commit defc756

Please sign in to comment.