Skip to content

Commit

Permalink
Test Vm reconnect while having more archived duplicates
Browse files Browse the repository at this point in the history
Test Vm reconnect while having more archived duplicates
  • Loading branch information
Ladas committed May 14, 2018
1 parent 01a0ec0 commit 34e484c
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,25 @@
end
end

it "will reconnect powered off VM" do
existing_ref = "#{@ems.subscription}/miq-azure-test1/microsoft.compute/virtualmachines/miqazure-centos1"
vm_oldest = FactoryGirl.create(:vm_azure, :ems_ref => existing_ref, :uid_ems => existing_ref)
FactoryGirl.create(:vm_azure, :ems_ref => existing_ref, :uid_ems => existing_ref)

2.times do # Run twice to verify that a second run with existing data does not change anything
refresh_with_cassette([vm_powered_off_target], vcr_suffix("powered_off_vm_refresh"))

assert_specific_az
assert_specific_flavor
assert_specific_vm_powered_off

expect(Vm.count).to eq(2)
expect(@ems.vms.count).to eq(1)
# We will reconnect the oldest one
expect(@ems.vms.first.id).to eq(vm_oldest.id)
end
end

it "will refresh VM with managed disk" do
2.times do # Run twice to verify that a second run with existing data does not change anything
refresh_with_cassette([vm_with_managed_disk_target], vcr_suffix("vm_with_managed_disk_refresh"))
Expand Down

0 comments on commit 34e484c

Please sign in to comment.