-
Notifications
You must be signed in to change notification settings - Fork 900
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7a6eb40
commit febf6b3
Showing
4 changed files
with
48 additions
and
57 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,15 +51,15 @@ | |
let(:src_cluster) { FactoryGirl.create(:ems_cluster, :ext_management_system => src_ems) } | ||
let(:src_host) { FactoryGirl.create(:host, :ext_management_system => src_ems, :ipaddress => '10.0.0.1') } | ||
let(:src_storage) { FactoryGirl.create(:storage, :ext_management_system => src_ems) } | ||
|
||
let(:src_lan_1) { FactoryGirl.create(:lan) } | ||
let(:src_lan_2) { FactoryGirl.create(:lan) } | ||
let(:src_nic_1) { FactoryGirl.create(:guest_device_nic, :lan => src_lan_1) } | ||
let(:src_nic_2) { FactoryGirl.create(:guest_device_nic, :lan => src_lan_2) } | ||
|
||
let(:src_disk_1) { instance_double("disk", :device_name => "Hard disk 1", :device_type => "disk", :filename => "[datastore12] test_vm/test_vm.vmdk", :size => 17_179_869_184) } | ||
let(:src_disk_2) { instance_double("disk", :device_name => "Hard disk 2", :device_type => "disk", :filename => "[datastore12] test_vm/test_vm-2.vmdk", :size => 17_179_869_184) } | ||
|
||
let(:src_hardware) { FactoryGirl.create(:hardware, :nics => [src_nic_1, src_nic_2]) } | ||
|
||
let(:src_vm) { FactoryGirl.create(:vm_vmware, :ext_management_system => src_ems, :ems_cluster => src_cluster, :host => src_host, :hardware => src_hardware) } | ||
|
@@ -70,22 +70,22 @@ | |
{:path => src_disk_2.filename, :size => src_disk_2.size, :percent => 0, :weight => 50.0 } | ||
] | ||
end | ||
|
||
before do | ||
allow(src_hardware).to receive(:disks).and_return([src_disk_1, src_disk_2]) | ||
allow(src_disk_1).to receive(:storage).and_return(src_storage) | ||
allow(src_host).to receive(:fingerprint).and_return('01:23:45:67:89:ab:cd:ef:01:23:45:67:89:ab:cd:ef:01:23:45:67') | ||
allow(src_host).to receive(:authentication_userid).and_return('esx_user') | ||
allow(src_host).to receive(:authentication_password).and_return('esx_passwd') | ||
end | ||
|
||
context "destination is rhevm" do | ||
let(:dst_ems) { FactoryGirl.create(:ems_redhat, :zone => FactoryGirl.create(:zone)) } | ||
let(:dst_cluster) { FactoryGirl.create(:ems_cluster, :ext_management_system => dst_ems) } | ||
let(:dst_storage) { FactoryGirl.create(:storage) } | ||
let(:dst_lan_1) { FactoryGirl.create(:lan) } | ||
let(:dst_lan_2) { FactoryGirl.create(:lan) } | ||
|
||
let(:mapping) do | ||
FactoryGirl.create( | ||
:transformation_mapping, | ||
|
@@ -121,12 +121,12 @@ | |
task.options[:transformation_host_id] = conversion_host.id | ||
allow(task).to receive(:source_disks).and_return(source_disks) | ||
end | ||
|
||
context "transport method is vddk" do | ||
before do | ||
conversion_host.vddk_transport_supported = true | ||
end | ||
|
||
it "#conversion_options" do | ||
expect(conversion_host.conversion_options(task)).to eq( | ||
:vm_name => src_vm.name, | ||
|
@@ -145,13 +145,13 @@ | |
) | ||
end | ||
end | ||
|
||
context "transport method is ssh" do | ||
before do | ||
conversion_host.vddk_transport_supported = false | ||
conversion_host.ssh_transport_supported = true | ||
end | ||
|
||
it "#conversion_options" do | ||
expect(conversion_host.conversion_options(task)).to eq( | ||
:vm_name => "ssh://[email protected]/vmfs/volumes/#{src_storage.name}/#{src_vm.location}", | ||
|
@@ -168,7 +168,7 @@ | |
end | ||
end | ||
end | ||
|
||
context "destination is openstack" do | ||
let(:dst_ems) { FactoryGirl.create(:ems_openstack, :zone => FactoryGirl.create(:zone)) } | ||
let(:dst_cloud_tenant) { FactoryGirl.create(:cloud_tenant, :ext_management_system => dst_ems) } | ||
|
@@ -177,7 +177,7 @@ | |
let(:dst_cloud_network_2) { FactoryGirl.create(:cloud_network) } | ||
let(:dst_flavor) { FactoryGirl.create(:flavor) } | ||
let(:dst_security_group) { FactoryGirl.create(:security_group) } | ||
|
||
let(:mapping) do | ||
FactoryGirl.create( | ||
:transformation_mapping, | ||
|
@@ -215,12 +215,12 @@ | |
task.options[:transformation_host_id] = conversion_host.id | ||
allow(task).to receive(:source_disks).and_return(source_disks) | ||
end | ||
|
||
context "transport method is vddk" do | ||
before do | ||
conversion_host.vddk_transport_supported = true | ||
end | ||
|
||
it "#conversion_options" do | ||
expect(conversion_host.conversion_options(task)).to eq( | ||
:vm_name => src_vm.name, | ||
|
@@ -250,7 +250,7 @@ | |
) | ||
end | ||
end | ||
|
||
context "transport method is ssh" do | ||
before do | ||
conversion_host.vddk_transport_supported = false | ||
|
@@ -259,8 +259,8 @@ | |
|
||
it "#conversion_options" do | ||
expect(conversion_host.conversion_options(task)).to eq( | ||
:vm_name => "ssh://[email protected]/vmfs/volumes/#{src_storage.name}/#{src_vm.location}", | ||
:transport_method => 'ssh', | ||
:vm_name => "ssh://[email protected]/vmfs/volumes/#{src_storage.name}/#{src_vm.location}", | ||
:transport_method => 'ssh', | ||
:osp_environment => { | ||
:os_no_cache => true, | ||
:os_auth_url => URI::Generic.build( | ||
|
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