Skip to content

Commit

Permalink
[test] ensure that api configuration got written to the backend in te…
Browse files Browse the repository at this point in the history
…st suite
  • Loading branch information
adrianschroeter committed May 21, 2014
1 parent 98d057e commit 40f36bd
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 24 deletions.
47 changes: 25 additions & 22 deletions src/api/script/start_test_backend
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,31 @@ reposrv = Thread.new do
end
end

while !dienow
puts 'Connecting to srcserver...'
begin
Net::HTTP.start(CONFIG['source_host'], CONFIG['source_port']) { |http| http.get('/') }
rescue Errno::ECONNREFUSED, Errno::ENETUNREACH
sleep 0.5
next
end
break
end

while !dienow
puts 'Connecting to repserver...'
begin
Net::HTTP.start(CONFIG['source_host'], 3201) { |http| http.get('/') }
rescue Errno::ECONNREFUSED, Errno::ENETUNREACH
sleep 0.5
next
end
break
end

# ensure that backend is in sync with api fixtures
Suse::Backend.put('/configuration', Configuration.first.render_xml)

puts 'Starting backend serviceserver...'
servicesrv = Thread.new do
servicesrv_out = IO.popen("cd #{Rails.root}/tmp/backend_config; exec perl #{perlopts} ./bs_service 2>&1")
Expand Down Expand Up @@ -154,28 +179,6 @@ publishsrv = Thread.new do
end
end

while !dienow
puts 'Connecting to srcserver...'
begin
Net::HTTP.start(CONFIG['source_host'], CONFIG['source_port']) { |http| http.get('/') }
rescue Errno::ECONNREFUSED, Errno::ENETUNREACH
sleep 0.5
next
end
break
end

while !dienow
puts 'Connecting to repserver...'
begin
Net::HTTP.start(CONFIG['source_host'], 3201) { |http| http.get('/') }
rescue Errno::ECONNREFUSED, Errno::ENETUNREACH
sleep 0.5
next
end
break
end

while !dienow
puts 'Connecting to serviceserver...'
begin
Expand Down
2 changes: 0 additions & 2 deletions src/api/test/functional/configurations_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,5 @@ def test_show_and_update_configuration
:tag => "arch", :content => "i586"
assert_no_xml_tag :parent => { :tag => "schedulers" },
:tag => "arch", :content => "s390x"
get '/configuration'
assert_response :success
end
end

0 comments on commit 40f36bd

Please sign in to comment.