Skip to content

Commit 49e0018

Browse files
committed
WIP test connecting to live vcsim
1 parent d48e65e commit 49e0018

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

spec/models/manageiq/providers/vmware/infra_manager_spec.rb

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,11 @@
4242
end
4343

4444
context ".verify_credentials" do
45-
let(:verify_params) { {"endpoints" => {"default" => {"hostname" => "vcenter"}}, "authentications" => {"default" => {"username" => "root", "password" => "vmware"}}} }
45+
let(:verify_params) { {"endpoints" => {"default" => {"hostname" => "localhost", "port" => 8989}}, "authentications" => {"default" => {"username" => "root", "password" => "vmware"}}} }
4646
let(:current_time) { Time.now.utc.to_s }
4747
let(:is_virtual_center) { true }
4848
let(:api_version) { '6.5.0' }
4949

50-
before do
51-
miq_vim = double("VMwareWebService/MiqVim")
52-
allow(miq_vim).to receive(:isVirtualCenter).and_return(is_virtual_center)
53-
allow(miq_vim).to receive(:currentTime).and_return(current_time)
54-
allow(miq_vim).to receive(:apiVersion).and_return(api_version)
55-
allow(miq_vim).to receive(:disconnect)
56-
57-
require "VMwareWebService/MiqVim"
58-
expect(MiqVim).to receive(:new).and_return(miq_vim)
59-
end
60-
6150
context "virtual-center" do
6251
it "is successful" do
6352
expect(described_class.verify_credentials(verify_params)).to be_truthy

spec/spec_helper.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
end
1616

1717
VCR.configure do |config|
18+
# Allow connections to a local vcsim
19+
config.ignore_request do |req|
20+
uri = URI(request.uri)
21+
uri.host == "localhost" && uri.port = 8989
22+
end
23+
1824
config.ignore_hosts 'codeclimate.com' if ENV['CI']
1925
config.cassette_library_dir = File.join(ManageIQ::Providers::Vmware::Engine.root, 'spec/vcr_cassettes')
2026

0 commit comments

Comments
 (0)