def test_04_02_created_instance_goes_to_running_state
20.times do |tick|
get_auth_url "/api;driver=rhevm/instances/#{(@@instance2/'instance').first[:id]}", { :tick => tick}
last_response.status.should_not == 500
state = (last_xml_response/'instance/state').first.text
break if state=='RUNNING'
sleep(5)
end
@@instance2 = last_xml_response
get_auth_url "/api;driver=rhevm/instances/#{(@@instance2/'instance').first[:id]}"
last_response.status.should_not == 500
(last_xml_response/'instance/state').first.text.should == 'RUNNING'
(last_xml_response/'instance/actions/link[@rel="stop"]').first.should_not == nil
end