-
Notifications
You must be signed in to change notification settings - Fork 896
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a setting that by default will disable the use of the OvirtSDK for refresh and provisioning.
- Loading branch information
Boris Odnopozov
committed
Mar 20, 2017
1 parent
ccb1cf8
commit d2cbf43
Showing
9 changed files
with
82 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
spec/models/manageiq/providers/redhat/infra_manager/refresh/parse/parser_builder_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
describe ManageIQ::Providers::Redhat::InfraManager::Refresh::Parse::ParserBuilder do | ||
let(:ems) { FactoryGirl.build(:ems_redhat) } | ||
let(:use_ovirt_engine_sdk) { true } | ||
let(:options) { {} } | ||
subject { described_class.new(ems, options).build } | ||
describe 'chooses the right parsing strategy' do | ||
before do | ||
::Settings.ems.ems_redhat.use_ovirt_engine_sdk = use_ovirt_engine_sdk | ||
end | ||
|
||
context "when v4 api" do | ||
before(:each) do | ||
allow(ems).to receive(:highest_supported_api_version).and_return(4) | ||
end | ||
|
||
it 'returns the api4 parser' do | ||
expect(subject).to eq(ManageIQ::Providers::Redhat::InfraManager::Refresh::Parse::Strategies::Api4) | ||
end | ||
|
||
context "when use_ovirt_engine_sdk setting is turned to false" do | ||
let(:use_ovirt_engine_sdk) { false } | ||
it 'returns the api3 parser' do | ||
expect(subject).to eq(ManageIQ::Providers::Redhat::InfraManager::Refresh::Parse::Strategies::Api3) | ||
end | ||
end | ||
|
||
context "forced version 3" do | ||
let(:options) { { :force_version => 3 } } | ||
|
||
it 'returns the api3 parser' do | ||
expect(subject).to eq(ManageIQ::Providers::Redhat::InfraManager::Refresh::Parse::Strategies::Api3) | ||
end | ||
end | ||
|
||
end | ||
|
||
context "when v3 api" do | ||
before(:each) do | ||
allow(ems).to receive(:highest_supported_api_version).and_return(3) | ||
end | ||
|
||
it 'returns the api3 parser' do | ||
expect(subject).to eq(ManageIQ::Providers::Redhat::InfraManager::Refresh::Parse::Strategies::Api3) | ||
end | ||
|
||
context "forced version 4" do | ||
let(:options) { { :force_version => 4 } } | ||
|
||
it 'returns the api4 parser' do | ||
expect(subject).to eq(ManageIQ::Providers::Redhat::InfraManager::Refresh::Parse::Strategies::Api4) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters