Fixes #38241 - Extend userdata API by MAC address endpoint #18
Annotations
5 errors
Error:
test/templates/templates_userdata_api_test.rb#L31
WebMock::NetConnectNotAllowedError: Real HTTP connections are disabled. Unregistered request: GET https://foreman.example.com/userdata/00:a1:b2:c3:d4:f5/user-data?mac=00:a1:b2:c3:d4:f5&url=http://proxy.lan:8443 with headers {'Accept'=>['*/*', 'application/json,version=2'], 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/json', 'Cookie'=>'', 'User-Agent'=>'Ruby', 'X-Forwarded-For'=>'127.0.0.1'}
You can stub this request with the following snippet:
stub_request(:get, "https://foreman.example.com/userdata/00:a1:b2:c3:d4:f5/user-data?mac=00:a1:b2:c3:d4:f5&url=http://proxy.lan:8443").
with(
headers: {
'Accept'=>['*/*', 'application/json,version=2'],
'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
'Content-Type'=>'application/json',
'Cookie'=>'',
'User-Agent'=>'Ruby',
'X-Forwarded-For'=>'127.0.0.1'
}).
to_return(status: 200, body: "", headers: {})
registered request stubs:
stub_request(:get, "https://foreman.example.com/userdata/00:a1:b2:c3:d4:f5/user-data?url=http%3A%2F%2Fproxy.lan%3A8443")
============================================================
/home/runner/work/smart-proxy/smart-proxy/vendor/bundle/ruby/3.0.0/gems/webmock-3.25.0/lib/webmock/http_lib_adapters/net_http.rb:120:in `request'
/home/runner/work/smart-proxy/smart-proxy/lib/proxy/request.rb:48:in `send_request'
/home/runner/work/smart-proxy/smart-proxy/modules/templates/proxy_request.rb:49:in `call_template'
/home/runner/work/smart-proxy/smart-proxy/modules/templates/proxy_request.rb:12:in `get'
/home/runner/work/smart-proxy/smart-proxy/modules/templates/userdata_proxy_request.rb:6:in `get'
/home/runner/work/smart-proxy/smart-proxy/modules/templates/templates_userdata_api.rb:14:in `block (2 levels) in <class:TemplatesUserdataApi>'
/home/runner/work/smart-proxy/smart-proxy/lib/proxy/helpers.rb:19:in `log_halt'
/home/runner/work/smart-proxy/smart-proxy/modules/templates/templates_userdata_api.rb:13:in `block in <class:TemplatesUserdataApi>'
/home/runner/work/smart-proxy/smart-proxy/vendor/bundle/ruby/3.0.0/gems/sinatra-2.2.4/lib/sinatra/base.rb:1696:in `call'
/home/runner/work/smart-proxy/smart-proxy/vendor/bundle/ruby/3.0.0/gems/sinatra-2.2.4/lib/sinatra/base.rb:1696:in `block in compile!'
/home/runner/work/smart-proxy/smart-proxy/vendor/bundle/ruby/3.0.0/gems/sinatra-2.2.4/lib/sinatra/base.rb:1030:in `block (3 levels) in route!'
/home/runner/work/smart-proxy/smart-proxy/vendor/bundle/ruby/3.0.0/gems/sinatra-2.2.4/lib/sinatra/base.rb:1049:in `route_eval'
/home/runner/work/smart-proxy/smart-proxy/vendor/bundle/ruby/3.0.0/gems/sinatra-2.2.4/lib/sinatra/base.rb:1030:in `block (2 levels) in route!'
/home/runner/work/smart-proxy/smart-proxy/vendor/bundle/ruby/3.0.0/gems/sinatra-2.2.4/lib/sinatra/base.rb:1078:in `block in process_route'
/home/runner/work/smart-proxy/smart-proxy/vendor/bundle/ruby/3.0.0/gems/sinatra-2.2.4/lib/sinatra/base.rb:1076:in `catch'
/home/runner/work/smart-proxy/smart-proxy/vendor/bundle/ruby/3.0.0/gems/sinatra-2.2.4/lib/sinatra/base.rb:1076:in `process_route'
/home/runner/work/smart-proxy/smart-proxy/vendor/bundle/ruby/3.0.0/gems/sinatra-2.2.4/lib/sinatra/base.rb:1028:in `block in route!'
/home/runner/work/smart-proxy/smart-proxy/vendor/bundle/ruby/3.0.0/gems/sinatra-2.2.4/lib/sinatra/base.rb:1025:in `each'
/home/runner/work/smart-proxy/smart-proxy/vendor/bundle/ruby/3.0.0/gems/sinatra-2.2.4/lib/sinatra/base.rb:1025:in `route!'
/home/runner/work/smart-proxy/smart-proxy/vendor/bundle/ruby/3.0.0/gems/sinatra-2.2.4/lib/sinatra/base.rb:1147:in `block in dispatch!'
/home/runner/work/smart-proxy/smart-proxy/vendor/bundle/ruby/3.0.0/gems/sinatra-2.2.4/lib/sinatra/base.rb:1119:in `block in invoke'
/home/runner/work/smart-proxy/smart-proxy/vendor/bundle/ruby/3.0.0/gems/sinatra-2.2.4/lib/sinatra/base.rb:1119:in `catch'
/home/runner/work/smart-proxy/smart-proxy/vendor/bundle/ruby/3.0.0/gems/sinatra-2.2.4/lib/sinatra/base.rb:1119:in `invoke'
/home/runner/work/smart-proxy/smart-proxy/vendor/bundle/ruby/3.0.0/gems/sinatra-2.2.4/lib/sinatra/base.rb:1142:in `dispatch!'
|
Test - Ruby 3.0
Process completed with exit code 1.
|
Error:
test/templates/templates_userdata_api_test.rb#L31
WebMock::NetConnectNotAllowedError: Real HTTP connections are disabled. Unregistered request: GET https://foreman.example.com/userdata/00:a1:b2:c3:d4:f5/user-data?mac=00:a1:b2:c3:d4:f5&url=http://proxy.lan:8443 with headers {'Accept'=>['*/*', 'application/json,version=2'], 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/json', 'Cookie'=>'', 'User-Agent'=>'Ruby', 'X-Forwarded-For'=>'127.0.0.1'}
You can stub this request with the following snippet:
stub_request(:get, "https://foreman.example.com/userdata/00:a1:b2:c3:d4:f5/user-data?mac=00:a1:b2:c3:d4:f5&url=http://proxy.lan:8443").
with(
headers: {
'Accept'=>['*/*', 'application/json,version=2'],
'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
'Content-Type'=>'application/json',
'Cookie'=>'',
'User-Agent'=>'Ruby',
'X-Forwarded-For'=>'127.0.0.1'
}).
to_return(status: 200, body: "", headers: {})
registered request stubs:
stub_request(:get, "https://foreman.example.com/userdata/00:a1:b2:c3:d4:f5/user-data?url=http%3A%2F%2Fproxy.lan%3A8443")
============================================================
/home/runner/work/smart-proxy/smart-proxy/vendor/bundle/ruby/2.7.0/gems/webmock-3.25.0/lib/webmock/http_lib_adapters/net_http.rb:120:in `request'
/home/runner/work/smart-proxy/smart-proxy/lib/proxy/request.rb:48:in `send_request'
/home/runner/work/smart-proxy/smart-proxy/modules/templates/proxy_request.rb:49:in `call_template'
/home/runner/work/smart-proxy/smart-proxy/modules/templates/proxy_request.rb:12:in `get'
/home/runner/work/smart-proxy/smart-proxy/modules/templates/userdata_proxy_request.rb:6:in `get'
/home/runner/work/smart-proxy/smart-proxy/modules/templates/templates_userdata_api.rb:14:in `block (2 levels) in <class:TemplatesUserdataApi>'
/home/runner/work/smart-proxy/smart-proxy/lib/proxy/helpers.rb:19:in `log_halt'
/home/runner/work/smart-proxy/smart-proxy/modules/templates/templates_userdata_api.rb:13:in `block in <class:TemplatesUserdataApi>'
/home/runner/work/smart-proxy/smart-proxy/vendor/bundle/ruby/2.7.0/gems/sinatra-2.2.4/lib/sinatra/base.rb:1696:in `call'
/home/runner/work/smart-proxy/smart-proxy/vendor/bundle/ruby/2.7.0/gems/sinatra-2.2.4/lib/sinatra/base.rb:1696:in `block in compile!'
/home/runner/work/smart-proxy/smart-proxy/vendor/bundle/ruby/2.7.0/gems/sinatra-2.2.4/lib/sinatra/base.rb:1030:in `block (3 levels) in route!'
/home/runner/work/smart-proxy/smart-proxy/vendor/bundle/ruby/2.7.0/gems/sinatra-2.2.4/lib/sinatra/base.rb:1049:in `route_eval'
/home/runner/work/smart-proxy/smart-proxy/vendor/bundle/ruby/2.7.0/gems/sinatra-2.2.4/lib/sinatra/base.rb:1030:in `block (2 levels) in route!'
/home/runner/work/smart-proxy/smart-proxy/vendor/bundle/ruby/2.7.0/gems/sinatra-2.2.4/lib/sinatra/base.rb:1078:in `block in process_route'
/home/runner/work/smart-proxy/smart-proxy/vendor/bundle/ruby/2.7.0/gems/sinatra-2.2.4/lib/sinatra/base.rb:1076:in `catch'
/home/runner/work/smart-proxy/smart-proxy/vendor/bundle/ruby/2.7.0/gems/sinatra-2.2.4/lib/sinatra/base.rb:1076:in `process_route'
/home/runner/work/smart-proxy/smart-proxy/vendor/bundle/ruby/2.7.0/gems/sinatra-2.2.4/lib/sinatra/base.rb:1028:in `block in route!'
/home/runner/work/smart-proxy/smart-proxy/vendor/bundle/ruby/2.7.0/gems/sinatra-2.2.4/lib/sinatra/base.rb:1025:in `each'
/home/runner/work/smart-proxy/smart-proxy/vendor/bundle/ruby/2.7.0/gems/sinatra-2.2.4/lib/sinatra/base.rb:1025:in `route!'
/home/runner/work/smart-proxy/smart-proxy/vendor/bundle/ruby/2.7.0/gems/sinatra-2.2.4/lib/sinatra/base.rb:1147:in `block in dispatch!'
/home/runner/work/smart-proxy/smart-proxy/vendor/bundle/ruby/2.7.0/gems/sinatra-2.2.4/lib/sinatra/base.rb:1119:in `block in invoke'
/home/runner/work/smart-proxy/smart-proxy/vendor/bundle/ruby/2.7.0/gems/sinatra-2.2.4/lib/sinatra/base.rb:1119:in `catch'
/home/runner/work/smart-proxy/smart-proxy/vendor/bundle/ruby/2.7.0/gems/sinatra-2.2.4/lib/sinatra/base.rb:1119:in `invoke'
/home/runner/work/smart-proxy/smart-proxy/vendor/bundle/ruby/2.7.0/gems/sinatra-2.2.4/lib/sinatra/base.rb:1142:in `dispatch!'
|
Test - Ruby 2.7
Process completed with exit code 1.
|
Test suite
Process completed with exit code 1.
|
Artifacts
Produced during runtime
Name | Size | |
---|---|---|
Gemfile-ruby-2.7.lock
|
1.47 KB |
|
Gemfile-ruby-3.0.lock
|
1.5 KB |
|