Skip to content
This repository has been archived by the owner on Jan 14, 2020. It is now read-only.

Commit

Permalink
int-test: remove unnecessary wait and add more logging info.
Browse files Browse the repository at this point in the history
- Since chairman is gone and host document is updated with AZ, we don't need sleep/wait.
- Adding logging in case of vm creation failure.

Change-Id: I73963f7ab24791a4f5f0e84406ade128d57ed190
(cherry picked from commit f8f2338)
  • Loading branch information
umerkhan authored and Gerrit Code Review committed Jun 18, 2016
1 parent 9006356 commit 4c422ff
Showing 1 changed file with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,22 @@
expect(host).to_not be_nil
expect(host.address).to_not be_nil

# To be on safe side, wait few sec and let agent register with chairman for updated availability zone
sleep_time = 5
sleep(sleep_time)
# create VMs in specific availability zone
for i in 1..3
vm_name = random_name("vm-#{i}-")
begin
vm = create_vm(@seeder.project!, name: vm_name, affinities: [{id: availability_zone.id, kind: "availabilityZone"}])
rescue EsxCloud::Error => e
host_service = EsxCloud::Dcp::CloudStore::HostFactory.get_host host.id
fail "Create VM failed. Host: #{host.id} HostState: #{host_service["agentState"]} Error: #{e}"
end

# create VMs in specific availability zone
for i in 1..3
vm_name = random_name("vm-#{i}-")
vm = create_vm(@seeder.project!, name: vm_name, affinities: [{id: availability_zone.id, kind: "availabilityZone"}])
expect(vm).to_not be_nil
expect(vm.name).to eq(vm_name)
expect(vm.host).to eq(host.address)
expect(vm).to_not be_nil
expect(vm.name).to eq(vm_name)
expect(vm.host).to eq(host.address)

vm.delete
end
vm.delete
end
end

it "set host's availability zone again should fail" do
Expand Down

0 comments on commit 4c422ff

Please sign in to comment.