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_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=39b9f771f1f2626428bac61a590445963b653b916da6ace88290b0c281ee3f02', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'ec2.eu-west-1.amazonaws.com', 'User-Agent'=>'fog-core/2.4.0', 'X-Amz-Date'=>'20240516T104850Z'}
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=39b9f771f1f2626428bac61a590445963b653b916da6ace88290b0c281ee3f02',
'Content-Type'=>'application/x-www-form-urlencoded',
'Host'=>'ec2.eu-west-1.amazonaws.com',
'User-Agent'=>'fog-core/2.4.0',
'X-Amz-Date'=>'20240516T104850Z'
}).
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_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=39b9f771f1f2626428bac61a590445963b653b916da6ace88290b0c281ee3f02', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'ec2.eu-west-1.amazonaws.com', 'User-Agent'=>'fog-core/2.4.0', 'X-Amz-Date'=>'20240516T104850Z'}
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=39b9f771f1f2626428bac61a590445963b653b916da6ace88290b0c281ee3f02',
'Content-Type'=>'application/x-www-form-urlencoded',
'Host'=>'ec2.eu-west-1.amazonaws.com',
'User-Agent'=>'fog-core/2.4.0',
'X-Amz-Date'=>'20240516T104850Z'
}).
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_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=fd0a481b3c54578d5152c6a2f9c4cf567b93059a774a81393c6411e053de8c5c', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'ec2.eu-west-1.amazonaws.com', 'User-Agent'=>'fog-core/2.4.0', 'X-Amz-Date'=>'20240516T104947Z'}
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=fd0a481b3c54578d5152c6a2f9c4cf567b93059a774a81393c6411e053de8c5c',
'Content-Type'=>'application/x-www-form-urlencoded',
'Host'=>'ec2.eu-west-1.amazonaws.com',
'User-Agent'=>'fog-core/2.4.0',
'X-Amz-Date'=>'20240516T104947Z'
}).
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_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=fd0a481b3c54578d5152c6a2f9c4cf567b93059a774a81393c6411e053de8c5c', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'ec2.eu-west-1.amazonaws.com', 'User-Agent'=>'fog-core/2.4.0', 'X-Amz-Date'=>'20240516T104947Z'}
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=fd0a481b3c54578d5152c6a2f9c4cf567b93059a774a81393c6411e053de8c5c',
'Content-Type'=>'application/x-www-form-urlencoded',
'Host'=>'ec2.eu-west-1.amazonaws.com',
'User-Agent'=>'fog-core/2.4.0',
'X-Amz-Date'=>'20240516T104947Z'
}).
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>'
|
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=fd0a481b3c54578d5152c6a2f9c4cf567b93059a774a81393c6411e053de8c5c', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'ec2.eu-west-1.amazonaws.com', 'User-Agent'=>'fog-core/2.4.0', 'X-Amz-Date'=>'20240516T104947Z'}
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=fd0a481b3c54578d5152c6a2f9c4cf567b93059a774a81393c6411e053de8c5c',
'Content-Type'=>'application/x-www-form-urlencoded',
'Host'=>'ec2.eu-west-1.amazonaws.com',
'User-Agent'=>'fog-core/2.4.0',
'X-Amz-Date'=>'20240516T104947Z'
}).
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_0002_should find and update 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=fd0a481b3c54578d5152c6a2f9c4cf567b93059a774a81393c6411e053de8c5c', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'ec2.eu-west-1.amazonaws.com', 'User-Agent'=>'fog-core/2.4.0', 'X-Amz-Date'=>'20240516T104947Z'}
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=fd0a481b3c54578d5152c6a2f9c4cf567b93059a774a81393c6411e053de8c5c',
'Content-Type'=>'application/x-www-form-urlencoded',
'Host'=>'ec2.eu-west-1.amazonaws.com',
'User-Agent'=>'fog-core/2.4.0',
'X-Amz-Date'=>'20240516T104947Z'
}).
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:141:in `block (2 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=fd0a481b3c54578d5152c6a2f9c4cf567b93059a774a81393c6411e053de8c5c', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'ec2.eu-west-1.amazonaws.com', 'User-Agent'=>'fog-core/2.4.0', 'X-Amz-Date'=>'20240516T104947Z'}
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=fd0a481b3c54578d5152c6a2f9c4cf567b93059a774a81393c6411e053de8c5c',
'Content-Type'=>'application/x-www-form-urlencoded',
'Host'=>'ec2.eu-west-1.amazonaws.com',
'User-Agent'=>'fog-core/2.4.0',
'X-Amz-Date'=>'20240516T104947Z'
}).
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_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=fd0a481b3c54578d5152c6a2f9c4cf567b93059a774a81393c6411e053de8c5c', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'ec2.eu-west-1.amazonaws.com', 'User-Agent'=>'fog-core/2.4.0', 'X-Amz-Date'=>'20240516T104947Z'}
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=fd0a481b3c54578d5152c6a2f9c4cf567b93059a774a81393c6411e053de8c5c',
'Content-Type'=>'application/x-www-form-urlencoded',
'Host'=>'ec2.eu-west-1.amazonaws.com',
'User-Agent'=>'fog-core/2.4.0',
'X-Amz-Date'=>'20240516T104947Z'
}).
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_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=b7320f45c03868fb53694bb7e650b063f82b3c558252a8315adeabcbe4bde59d', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'ec2.eu-west-1.amazonaws.com', 'User-Agent'=>'fog-core/2.4.0', 'X-Amz-Date'=>'20240516T105019Z'}
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=b7320f45c03868fb53694bb7e650b063f82b3c558252a8315adeabcbe4bde59d',
'Content-Type'=>'application/x-www-form-urlencoded',
'Host'=>'ec2.eu-west-1.amazonaws.com',
'User-Agent'=>'fog-core/2.4.0',
'X-Amz-Date'=>'20240516T105019Z'
}).
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:217: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_remote_execution = 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=fcab70849c039a5fc4907b9f81e4752f8f0cc272baec6dfb06bafe60f115ede7', 'Content-Type'=>'application/x-www-form-urlencoded', 'Host'=>'ec2.eu-west-1.amazonaws.com', 'User-Agent'=>'fog-core/2.4.0', 'X-Amz-Date'=>'20240516T105020Z'}
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=fcab70849c039a5fc4907b9f81e4752f8f0cc272baec6dfb06bafe60f115ede7',
'Content-Type'=>'application/x-www-form-urlencoded',
'Host'=>'ec2.eu-west-1.amazonaws.com',
'User-Agent'=>'fog-core/2.4.0',
'X-Amz-Date'=>'20240516T105020Z'
}).
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:226:in `block (3 levels) in <class:RegistrationControllerTest>'
|
Loading