Merge "Add polling for image list tests"

This commit is contained in:
Jenkins 2016-07-21 20:55:27 +00:00 committed by Gerrit Code Review
commit 6b4f81d69e
1 changed files with 10 additions and 4 deletions

View File

@ -113,10 +113,16 @@ describe 'allinone', :if => os[:family] == 'ubuntu' do
cirros'
result = shell("#{credentials} #{command}")
expect(result.exit_code).to eq(0)
sleep(10) # command returns immediately but image needs time to upload
result = shell("#{credentials} openstack image list --long")
expect(result.stdout).to match(/cirros.*active/)
expect(result.exit_code).to eq(0)
list_command = "#{credentials} openstack image list --long"
timeout = 60
end_time = Time.now + timeout
image_list = shell(list_command)
while image_list.stdout =~ /saving/ && Time.now() < end_time
sleep(10)
image_list = shell(list_command)
end
expect(image_list.stdout).to match(/cirros.*active/)
expect(image_list.exit_code).to eq(0)
end
it 'should be able to upload a keypair' do