Fixes #36745 - VM is not associated upon host registration #1155
Annotations
10 errors
Run rake test:functionals:
test/controllers/api/v2/registration_controller_test.rb#L70
Failure: test_0001_without param
WebMock::NetConnectNotAllowedError: Real HTTP connections are disabled. Unregistered request: POST https://ec2.eu-west-1.amazonaws.com/ with body 'Action=DescribeInstances&Version=2016-11-15' with headers {'Authorization'=>'AWS4-HMAC-SHA256 Credential=MyString/20240516/eu-west-1/ec2/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=46e93ba8b325a7cafd2facbcf87de37807f4776d0815f7a9fd5ca7030cc1f8d1', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'ec2.eu-west-1.amazonaws.com', 'User-Agent'=>'fog-core/2.4.0', 'X-Amz-Date'=>'20240516T104822Z'}
You can stub this request with the following snippet:
stub_request(:post, "https://ec2.eu-west-1.amazonaws.com/").
with(
body: {"Action"=>"DescribeInstances", "Version"=>"2016-11-15"},
headers: {
'Authorization'=>'AWS4-HMAC-SHA256 Credential=MyString/20240516/eu-west-1/ec2/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=46e93ba8b325a7cafd2facbcf87de37807f4776d0815f7a9fd5ca7030cc1f8d1',
'Content-Type'=>'application/x-www-form-urlencoded',
'Host'=>'ec2.eu-west-1.amazonaws.com',
'User-Agent'=>'fog-core/2.4.0',
'X-Amz-Date'=>'20240516T104822Z'
}).
to_return(status: 200, body: "", headers: {})
============================================================
lib/foreman/http_proxy/excon_connection_extension.rb:13:in `request'
app/models/compute_resources/foreman/model/ec2.rb:151:in `find'
app/models/compute_resources/foreman/model/ec2.rb:151:in `associated_vm'
app/services/compute_resource_host_associator.rb:19:in `associate_host'
app/controllers/api/v2/registration_controller.rb:132:in `block in associate_vm'
app/controllers/api/v2/registration_controller.rb:130:in `associate_vm'
app/controllers/api/v2/registration_controller.rb:80:in `block in host'
app/controllers/api/v2/registration_controller.rb:77:in `host'
app/controllers/concerns/foreman/controller/timezone.rb:10:in `set_timezone'
app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller'
test/controllers/api/v2/registration_controller_test.rb:187:in `block (3 levels) in <class:RegistrationControllerTest>'
|
Run rake test:functionals:
test/controllers/api/v2/registration_controller_test.rb#L70
Failure: test_0003_with setup_insights = false
WebMock::NetConnectNotAllowedError: Real HTTP connections are disabled. Unregistered request: POST https://ec2.eu-west-1.amazonaws.com/ with body 'Action=DescribeInstances&Version=2016-11-15' with headers {'Authorization'=>'AWS4-HMAC-SHA256 Credential=MyString/20240516/eu-west-1/ec2/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=46e93ba8b325a7cafd2facbcf87de37807f4776d0815f7a9fd5ca7030cc1f8d1', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'ec2.eu-west-1.amazonaws.com', 'User-Agent'=>'fog-core/2.4.0', 'X-Amz-Date'=>'20240516T104822Z'}
You can stub this request with the following snippet:
stub_request(:post, "https://ec2.eu-west-1.amazonaws.com/").
with(
body: {"Action"=>"DescribeInstances", "Version"=>"2016-11-15"},
headers: {
'Authorization'=>'AWS4-HMAC-SHA256 Credential=MyString/20240516/eu-west-1/ec2/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=46e93ba8b325a7cafd2facbcf87de37807f4776d0815f7a9fd5ca7030cc1f8d1',
'Content-Type'=>'application/x-www-form-urlencoded',
'Host'=>'ec2.eu-west-1.amazonaws.com',
'User-Agent'=>'fog-core/2.4.0',
'X-Amz-Date'=>'20240516T104822Z'
}).
to_return(status: 200, body: "", headers: {})
============================================================
lib/foreman/http_proxy/excon_connection_extension.rb:13:in `request'
app/models/compute_resources/foreman/model/ec2.rb:151:in `find'
app/models/compute_resources/foreman/model/ec2.rb:151:in `associated_vm'
app/services/compute_resource_host_associator.rb:19:in `associate_host'
app/controllers/api/v2/registration_controller.rb:132:in `block in associate_vm'
app/controllers/api/v2/registration_controller.rb:130:in `associate_vm'
app/controllers/api/v2/registration_controller.rb:80:in `block in host'
app/controllers/api/v2/registration_controller.rb:77:in `host'
app/controllers/concerns/foreman/controller/timezone.rb:10:in `set_timezone'
app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller'
test/controllers/api/v2/registration_controller_test.rb:206:in `block (3 levels) in <class:RegistrationControllerTest>'
|
Run rake test:functionals:
test/controllers/api/v2/registration_controller_test.rb#L70
Failure: test_0002_with setup_insights = true
WebMock::NetConnectNotAllowedError: Real HTTP connections are disabled. Unregistered request: POST https://ec2.eu-west-1.amazonaws.com/ with body 'Action=DescribeInstances&Version=2016-11-15' with headers {'Authorization'=>'AWS4-HMAC-SHA256 Credential=MyString/20240516/eu-west-1/ec2/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=4fe7bde46f8a93adddd77e10b4a56697a3498acfde3128244e739ba23a081a3e', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'ec2.eu-west-1.amazonaws.com', 'User-Agent'=>'fog-core/2.4.0', 'X-Amz-Date'=>'20240516T104823Z'}
You can stub this request with the following snippet:
stub_request(:post, "https://ec2.eu-west-1.amazonaws.com/").
with(
body: {"Action"=>"DescribeInstances", "Version"=>"2016-11-15"},
headers: {
'Authorization'=>'AWS4-HMAC-SHA256 Credential=MyString/20240516/eu-west-1/ec2/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=4fe7bde46f8a93adddd77e10b4a56697a3498acfde3128244e739ba23a081a3e',
'Content-Type'=>'application/x-www-form-urlencoded',
'Host'=>'ec2.eu-west-1.amazonaws.com',
'User-Agent'=>'fog-core/2.4.0',
'X-Amz-Date'=>'20240516T104823Z'
}).
to_return(status: 200, body: "", headers: {})
============================================================
lib/foreman/http_proxy/excon_connection_extension.rb:13:in `request'
app/models/compute_resources/foreman/model/ec2.rb:151:in `find'
app/models/compute_resources/foreman/model/ec2.rb:151:in `associated_vm'
app/services/compute_resource_host_associator.rb:19:in `associate_host'
app/controllers/api/v2/registration_controller.rb:132:in `block in associate_vm'
app/controllers/api/v2/registration_controller.rb:130:in `associate_vm'
app/controllers/api/v2/registration_controller.rb:80:in `block in host'
app/controllers/api/v2/registration_controller.rb:77:in `host'
app/controllers/concerns/foreman/controller/timezone.rb:10:in `set_timezone'
app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller'
test/controllers/api/v2/registration_controller_test.rb:196:in `block (3 levels) in <class:RegistrationControllerTest>'
|
Run rake test:functionals:
test/controllers/api/v2/registration_controller_test.rb#L70
Failure: test_0001_without param
WebMock::NetConnectNotAllowedError: Real HTTP connections are disabled. Unregistered request: POST https://ec2.eu-west-1.amazonaws.com/ with body 'Action=DescribeInstances&Version=2016-11-15' with headers {'Authorization'=>'AWS4-HMAC-SHA256 Credential=MyString/20240516/eu-west-1/ec2/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=3a83be7790688c4d949d3583a895625596d1e71541e9430080ef4a461d292f70', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'ec2.eu-west-1.amazonaws.com', 'User-Agent'=>'fog-core/2.4.0', 'X-Amz-Date'=>'20240516T104840Z'}
You can stub this request with the following snippet:
stub_request(:post, "https://ec2.eu-west-1.amazonaws.com/").
with(
body: {"Action"=>"DescribeInstances", "Version"=>"2016-11-15"},
headers: {
'Authorization'=>'AWS4-HMAC-SHA256 Credential=MyString/20240516/eu-west-1/ec2/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=3a83be7790688c4d949d3583a895625596d1e71541e9430080ef4a461d292f70',
'Content-Type'=>'application/x-www-form-urlencoded',
'Host'=>'ec2.eu-west-1.amazonaws.com',
'User-Agent'=>'fog-core/2.4.0',
'X-Amz-Date'=>'20240516T104840Z'
}).
to_return(status: 200, body: "", headers: {})
============================================================
lib/foreman/http_proxy/excon_connection_extension.rb:13:in `request'
app/models/compute_resources/foreman/model/ec2.rb:151:in `find'
app/models/compute_resources/foreman/model/ec2.rb:151:in `associated_vm'
app/services/compute_resource_host_associator.rb:19:in `associate_host'
app/controllers/api/v2/registration_controller.rb:132:in `block in associate_vm'
app/controllers/api/v2/registration_controller.rb:130:in `associate_vm'
app/controllers/api/v2/registration_controller.rb:80:in `block in host'
app/controllers/api/v2/registration_controller.rb:77:in `host'
app/controllers/concerns/foreman/controller/timezone.rb:10:in `set_timezone'
app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller'
test/controllers/api/v2/registration_controller_test.rb:247:in `block (3 levels) in <class:RegistrationControllerTest>'
|
Run rake test:functionals:
test/controllers/api/v2/registration_controller_test.rb#L70
Failure: test_0002_with param
WebMock::NetConnectNotAllowedError: Real HTTP connections are disabled. Unregistered request: POST https://ec2.eu-west-1.amazonaws.com/ with body 'Action=DescribeInstances&Version=2016-11-15' with headers {'Authorization'=>'AWS4-HMAC-SHA256 Credential=MyString/20240516/eu-west-1/ec2/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=3a83be7790688c4d949d3583a895625596d1e71541e9430080ef4a461d292f70', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'ec2.eu-west-1.amazonaws.com', 'User-Agent'=>'fog-core/2.4.0', 'X-Amz-Date'=>'20240516T104840Z'}
You can stub this request with the following snippet:
stub_request(:post, "https://ec2.eu-west-1.amazonaws.com/").
with(
body: {"Action"=>"DescribeInstances", "Version"=>"2016-11-15"},
headers: {
'Authorization'=>'AWS4-HMAC-SHA256 Credential=MyString/20240516/eu-west-1/ec2/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=3a83be7790688c4d949d3583a895625596d1e71541e9430080ef4a461d292f70',
'Content-Type'=>'application/x-www-form-urlencoded',
'Host'=>'ec2.eu-west-1.amazonaws.com',
'User-Agent'=>'fog-core/2.4.0',
'X-Amz-Date'=>'20240516T104840Z'
}).
to_return(status: 200, body: "", headers: {})
============================================================
lib/foreman/http_proxy/excon_connection_extension.rb:13:in `request'
app/models/compute_resources/foreman/model/ec2.rb:151:in `find'
app/models/compute_resources/foreman/model/ec2.rb:151:in `associated_vm'
app/services/compute_resource_host_associator.rb:19:in `associate_host'
app/controllers/api/v2/registration_controller.rb:132:in `block in associate_vm'
app/controllers/api/v2/registration_controller.rb:130:in `associate_vm'
app/controllers/api/v2/registration_controller.rb:80:in `block in host'
app/controllers/api/v2/registration_controller.rb:77:in `host'
app/controllers/concerns/foreman/controller/timezone.rb:10:in `set_timezone'
app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller'
test/controllers/api/v2/registration_controller_test.rb:256:in `block (3 levels) in <class:RegistrationControllerTest>'
|
Run rake test:functionals:
test/controllers/api/v2/registration_controller_test.rb#L70
Failure: test_0005_should render error when no OS
WebMock::NetConnectNotAllowedError: Real HTTP connections are disabled. Unregistered request: POST https://ec2.eu-west-1.amazonaws.com/ with body 'Action=DescribeInstances&Version=2016-11-15' with headers {'Authorization'=>'AWS4-HMAC-SHA256 Credential=MyString/20240516/eu-west-1/ec2/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=308fe143c65524346982708f07a74856f94b78bec0610d233869fce63fad8027', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'ec2.eu-west-1.amazonaws.com', 'User-Agent'=>'fog-core/2.4.0', 'X-Amz-Date'=>'20240516T104917Z'}
You can stub this request with the following snippet:
stub_request(:post, "https://ec2.eu-west-1.amazonaws.com/").
with(
body: {"Action"=>"DescribeInstances", "Version"=>"2016-11-15"},
headers: {
'Authorization'=>'AWS4-HMAC-SHA256 Credential=MyString/20240516/eu-west-1/ec2/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=308fe143c65524346982708f07a74856f94b78bec0610d233869fce63fad8027',
'Content-Type'=>'application/x-www-form-urlencoded',
'Host'=>'ec2.eu-west-1.amazonaws.com',
'User-Agent'=>'fog-core/2.4.0',
'X-Amz-Date'=>'20240516T104917Z'
}).
to_return(status: 200, body: "", headers: {})
============================================================
lib/foreman/http_proxy/excon_connection_extension.rb:13:in `request'
app/models/compute_resources/foreman/model/ec2.rb:151:in `find'
app/models/compute_resources/foreman/model/ec2.rb:151:in `associated_vm'
app/services/compute_resource_host_associator.rb:19:in `associate_host'
app/controllers/api/v2/registration_controller.rb:132:in `block in associate_vm'
app/controllers/api/v2/registration_controller.rb:130:in `associate_vm'
app/controllers/api/v2/registration_controller.rb:80:in `block in host'
app/controllers/api/v2/registration_controller.rb:77:in `host'
app/controllers/concerns/foreman/controller/timezone.rb:10:in `set_timezone'
app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller'
test/controllers/api/v2/registration_controller_test.rb:160:in `block (2 levels) in <class:RegistrationControllerTest>'
|
Run rake test:functionals:
test/controllers/api/v2/registration_controller_test.rb#L70
Failure: test_0003_should render template
WebMock::NetConnectNotAllowedError: Real HTTP connections are disabled. Unregistered request: POST https://ec2.eu-west-1.amazonaws.com/ with body 'Action=DescribeInstances&Version=2016-11-15' with headers {'Authorization'=>'AWS4-HMAC-SHA256 Credential=MyString/20240516/eu-west-1/ec2/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=308fe143c65524346982708f07a74856f94b78bec0610d233869fce63fad8027', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'ec2.eu-west-1.amazonaws.com', 'User-Agent'=>'fog-core/2.4.0', 'X-Amz-Date'=>'20240516T104917Z'}
You can stub this request with the following snippet:
stub_request(:post, "https://ec2.eu-west-1.amazonaws.com/").
with(
body: {"Action"=>"DescribeInstances", "Version"=>"2016-11-15"},
headers: {
'Authorization'=>'AWS4-HMAC-SHA256 Credential=MyString/20240516/eu-west-1/ec2/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=308fe143c65524346982708f07a74856f94b78bec0610d233869fce63fad8027',
'Content-Type'=>'application/x-www-form-urlencoded',
'Host'=>'ec2.eu-west-1.amazonaws.com',
'User-Agent'=>'fog-core/2.4.0',
'X-Amz-Date'=>'20240516T104917Z'
}).
to_return(status: 200, body: "", headers: {})
============================================================
lib/foreman/http_proxy/excon_connection_extension.rb:13:in `request'
app/models/compute_resources/foreman/model/ec2.rb:151:in `find'
app/models/compute_resources/foreman/model/ec2.rb:151:in `associated_vm'
app/services/compute_resource_host_associator.rb:19:in `associate_host'
app/controllers/api/v2/registration_controller.rb:132:in `block in associate_vm'
app/controllers/api/v2/registration_controller.rb:130:in `associate_vm'
app/controllers/api/v2/registration_controller.rb:80:in `block in host'
app/controllers/api/v2/registration_controller.rb:77:in `host'
app/controllers/concerns/foreman/controller/timezone.rb:10:in `set_timezone'
app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller'
test/controllers/api/v2/registration_controller_test.rb:147:in `block (2 levels) in <class:RegistrationControllerTest>'
|
Run rake test:functionals:
test/controllers/api/v2/registration_controller_test.rb#L70
Failure: test_0001_should find and create host
WebMock::NetConnectNotAllowedError: Real HTTP connections are disabled. Unregistered request: POST https://ec2.eu-west-1.amazonaws.com/ with body 'Action=DescribeInstances&Version=2016-11-15' with headers {'Authorization'=>'AWS4-HMAC-SHA256 Credential=MyString/20240516/eu-west-1/ec2/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=308fe143c65524346982708f07a74856f94b78bec0610d233869fce63fad8027', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'ec2.eu-west-1.amazonaws.com', 'User-Agent'=>'fog-core/2.4.0', 'X-Amz-Date'=>'20240516T104917Z'}
You can stub this request with the following snippet:
stub_request(:post, "https://ec2.eu-west-1.amazonaws.com/").
with(
body: {"Action"=>"DescribeInstances", "Version"=>"2016-11-15"},
headers: {
'Authorization'=>'AWS4-HMAC-SHA256 Credential=MyString/20240516/eu-west-1/ec2/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=308fe143c65524346982708f07a74856f94b78bec0610d233869fce63fad8027',
'Content-Type'=>'application/x-www-form-urlencoded',
'Host'=>'ec2.eu-west-1.amazonaws.com',
'User-Agent'=>'fog-core/2.4.0',
'X-Amz-Date'=>'20240516T104917Z'
}).
to_return(status: 200, body: "", headers: {})
============================================================
lib/foreman/http_proxy/excon_connection_extension.rb:13:in `request'
app/models/compute_resources/foreman/model/ec2.rb:151:in `find'
app/models/compute_resources/foreman/model/ec2.rb:151:in `associated_vm'
app/services/compute_resource_host_associator.rb:19:in `associate_host'
app/controllers/api/v2/registration_controller.rb:132:in `block in associate_vm'
app/controllers/api/v2/registration_controller.rb:130:in `associate_vm'
app/controllers/api/v2/registration_controller.rb:80:in `block in host'
app/controllers/api/v2/registration_controller.rb:77:in `host'
app/controllers/concerns/foreman/controller/timezone.rb:10:in `set_timezone'
app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller'
test/controllers/api/v2/registration_controller_test.rb:131:in `block (2 levels) in <class:RegistrationControllerTest>'
|
Run rake test:functionals:
test/controllers/api/v2/registration_controller_test.rb#L70
Failure: test_0006_should render error when template is invalid
WebMock::NetConnectNotAllowedError: Real HTTP connections are disabled. Unregistered request: POST https://ec2.eu-west-1.amazonaws.com/ with body 'Action=DescribeInstances&Version=2016-11-15' with headers {'Authorization'=>'AWS4-HMAC-SHA256 Credential=MyString/20240516/eu-west-1/ec2/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=308fe143c65524346982708f07a74856f94b78bec0610d233869fce63fad8027', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'ec2.eu-west-1.amazonaws.com', 'User-Agent'=>'fog-core/2.4.0', 'X-Amz-Date'=>'20240516T104917Z'}
You can stub this request with the following snippet:
stub_request(:post, "https://ec2.eu-west-1.amazonaws.com/").
with(
body: {"Action"=>"DescribeInstances", "Version"=>"2016-11-15"},
headers: {
'Authorization'=>'AWS4-HMAC-SHA256 Credential=MyString/20240516/eu-west-1/ec2/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=308fe143c65524346982708f07a74856f94b78bec0610d233869fce63fad8027',
'Content-Type'=>'application/x-www-form-urlencoded',
'Host'=>'ec2.eu-west-1.amazonaws.com',
'User-Agent'=>'fog-core/2.4.0',
'X-Amz-Date'=>'20240516T104917Z'
}).
to_return(status: 200, body: "", headers: {})
============================================================
lib/foreman/http_proxy/excon_connection_extension.rb:13:in `request'
app/models/compute_resources/foreman/model/ec2.rb:151:in `find'
app/models/compute_resources/foreman/model/ec2.rb:151:in `associated_vm'
app/services/compute_resource_host_associator.rb:19:in `associate_host'
app/controllers/api/v2/registration_controller.rb:132:in `block in associate_vm'
app/controllers/api/v2/registration_controller.rb:130:in `associate_vm'
app/controllers/api/v2/registration_controller.rb:80:in `block in host'
app/controllers/api/v2/registration_controller.rb:77:in `host'
app/controllers/concerns/foreman/controller/timezone.rb:10:in `set_timezone'
app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller'
test/controllers/api/v2/registration_controller_test.rb:175:in `block (2 levels) in <class:RegistrationControllerTest>'
|
Run rake test:functionals:
test/controllers/api/v2/registration_controller_test.rb#L70
Failure: test_0004_should set build on host
WebMock::NetConnectNotAllowedError: Real HTTP connections are disabled. Unregistered request: POST https://ec2.eu-west-1.amazonaws.com/ with body 'Action=DescribeInstances&Version=2016-11-15' with headers {'Authorization'=>'AWS4-HMAC-SHA256 Credential=MyString/20240516/eu-west-1/ec2/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=308fe143c65524346982708f07a74856f94b78bec0610d233869fce63fad8027', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'ec2.eu-west-1.amazonaws.com', 'User-Agent'=>'fog-core/2.4.0', 'X-Amz-Date'=>'20240516T104917Z'}
You can stub this request with the following snippet:
stub_request(:post, "https://ec2.eu-west-1.amazonaws.com/").
with(
body: {"Action"=>"DescribeInstances", "Version"=>"2016-11-15"},
headers: {
'Authorization'=>'AWS4-HMAC-SHA256 Credential=MyString/20240516/eu-west-1/ec2/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=308fe143c65524346982708f07a74856f94b78bec0610d233869fce63fad8027',
'Content-Type'=>'application/x-www-form-urlencoded',
'Host'=>'ec2.eu-west-1.amazonaws.com',
'User-Agent'=>'fog-core/2.4.0',
'X-Amz-Date'=>'20240516T104917Z'
}).
to_return(status: 200, body: "", headers: {})
============================================================
lib/foreman/http_proxy/excon_connection_extension.rb:13:in `request'
app/models/compute_resources/foreman/model/ec2.rb:151:in `find'
app/models/compute_resources/foreman/model/ec2.rb:151:in `associated_vm'
app/services/compute_resource_host_associator.rb:19:in `associate_host'
app/controllers/api/v2/registration_controller.rb:132:in `block in associate_vm'
app/controllers/api/v2/registration_controller.rb:130:in `associate_vm'
app/controllers/api/v2/registration_controller.rb:80:in `block in host'
app/controllers/api/v2/registration_controller.rb:77:in `host'
app/controllers/concerns/foreman/controller/timezone.rb:10:in `set_timezone'
app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller'
test/controllers/api/v2/registration_controller_test.rb:153:in `block (2 levels) in <class:RegistrationControllerTest>'
|
Loading