From 70e98b915f9085742d57b3abd98de28a271ce813 Mon Sep 17 00:00:00 2001 From: felipedf Date: Thu, 11 Jan 2018 10:22:18 -0300 Subject: [PATCH] Fixing tests for the new hostname validation --- .../event_catcher/runner_spec.rb | 2 +- .../event_catcher/stream_spec.rb | 2 +- .../physical_infra_manager/refresh_parser_spec.rb | 2 +- .../physical_infra_manager/refresher_spec.rb | 2 +- .../lenovo/physical_infra_manager_spec.rb | 14 +++++++------- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/spec/models/manageiq/providers/lenovo/physical_infra_manager/event_catcher/runner_spec.rb b/spec/models/manageiq/providers/lenovo/physical_infra_manager/event_catcher/runner_spec.rb index 5211caa71a..2d7f0e60d9 100644 --- a/spec/models/manageiq/providers/lenovo/physical_infra_manager/event_catcher/runner_spec.rb +++ b/spec/models/manageiq/providers/lenovo/physical_infra_manager/event_catcher/runner_spec.rb @@ -2,7 +2,7 @@ let(:ems) do FactoryGirl.create(:physical_infra_with_authentication, :name => "LXCA", - :hostname => "https://10.243.9.123") + :hostname => "10.243.9.123") end let(:runner) { described_class.new(:ems_id => ems.id) } diff --git a/spec/models/manageiq/providers/lenovo/physical_infra_manager/event_catcher/stream_spec.rb b/spec/models/manageiq/providers/lenovo/physical_infra_manager/event_catcher/stream_spec.rb index 11099e1f04..98573a36cb 100644 --- a/spec/models/manageiq/providers/lenovo/physical_infra_manager/event_catcher/stream_spec.rb +++ b/spec/models/manageiq/providers/lenovo/physical_infra_manager/event_catcher/stream_spec.rb @@ -2,7 +2,7 @@ let(:ems) do FactoryGirl.create(:physical_infra_with_authentication, :name => "LXCA", - :hostname => "https://10.243.9.123", + :hostname => "10.243.9.123", :port => "443") end diff --git a/spec/models/manageiq/providers/lenovo/physical_infra_manager/refresh_parser_spec.rb b/spec/models/manageiq/providers/lenovo/physical_infra_manager/refresh_parser_spec.rb index 29e447886f..698041a234 100644 --- a/spec/models/manageiq/providers/lenovo/physical_infra_manager/refresh_parser_spec.rb +++ b/spec/models/manageiq/providers/lenovo/physical_infra_manager/refresh_parser_spec.rb @@ -9,7 +9,7 @@ let(:ems) do ems = FactoryGirl.create(:physical_infra, :name => "LXCA", - :hostname => "https://10.243.9.123", + :hostname => "10.243.9.123", :port => "443", :ipaddress => "https://10.243.9.123/443") ems.authentications = [auth] diff --git a/spec/models/manageiq/providers/lenovo/physical_infra_manager/refresher_spec.rb b/spec/models/manageiq/providers/lenovo/physical_infra_manager/refresher_spec.rb index 1c9f8e99cb..19309b5644 100644 --- a/spec/models/manageiq/providers/lenovo/physical_infra_manager/refresher_spec.rb +++ b/spec/models/manageiq/providers/lenovo/physical_infra_manager/refresher_spec.rb @@ -9,7 +9,7 @@ let(:ems) do ems = FactoryGirl.create(:physical_infra, :name => "LXCA", - :hostname => "https://10.243.9.123", + :hostname => "10.243.9.123", :port => "443", :ipaddress => "https://10.243.9.123:443") ems.authentications = [auth] diff --git a/spec/models/manageiq/providers/lenovo/physical_infra_manager_spec.rb b/spec/models/manageiq/providers/lenovo/physical_infra_manager_spec.rb index d2a8cf3883..a84002c6d9 100644 --- a/spec/models/manageiq/providers/lenovo/physical_infra_manager_spec.rb +++ b/spec/models/manageiq/providers/lenovo/physical_infra_manager_spec.rb @@ -13,7 +13,7 @@ :ems_ref => "BD775D06821111E189A3E41F13ED5A1A") @physical_infra_manager = FactoryGirl.create(:physical_infra, :name => "LXCA", - :hostname => "https://10.243.9.123", + :hostname => "10.243.9.123", :port => "443", :ipaddress => "https://10.243.9.123") @auth = FactoryGirl.create(:authentication, @@ -49,7 +49,7 @@ :ems_ref => "EADEBE8316174750A27FEC2E8226AC48") @physical_infra_manager = FactoryGirl.create(:physical_infra, :name => "LXCA", - :hostname => "https://10.243.9.123", + :hostname => "10.243.9.123", :port => "443", :ipaddress => "https://10.243.9.123") @auth = FactoryGirl.create(:authentication, @@ -127,9 +127,9 @@ it "should build the console URI" do @physical_infra_manager = FactoryGirl.create(:physical_infra, :name => "LXCA1", - :hostname => "10.241.5.555", + :hostname => "10.243.5.255", :port => "443", - :ipaddress => "10.243.5.555") + :ipaddress => "10.243.5.255") console_uri = URI::HTTPS.build(:host => @physical_infra_manager.hostname, :port => @physical_infra_manager.port) @@ -246,7 +246,7 @@ before :each do @physical_infra_manager = FactoryGirl.create(:physical_infra, :name => "LXCA", - :hostname => "https://sample.com", + :hostname => "sample.com", :port => "443") @auth = FactoryGirl.create(:authentication, @@ -264,7 +264,7 @@ @pattern_id = "1" response_body = {:status => [200, "OK"], :body => JSON.generate("uuid" => [@uuid], "restart" => "immediate")} WebMock.allow_net_connect! - stub_request(:post, File.join(@physical_infra_manager.hostname, @base_uri + @pattern_id)).to_return(response_body) + stub_request(:post, File.join("https://" + @physical_infra_manager.hostname, @base_uri + @pattern_id)).to_return(response_body) end subject do @@ -288,7 +288,7 @@ @pattern_id = "2" WebMock.allow_net_connect! - stub_request(:post, File.join(@physical_infra_manager.hostname, @base_uri + @pattern_id)).to_return(:status => [404, "OK"]) + stub_request(:post, File.join("https://" + @physical_infra_manager.hostname, @base_uri + @pattern_id)).to_return(:status => [404, "OK"]) end subject do