diff --git a/devops-service/features/flavor.feature b/devops-service/features/flavor.feature index 273f670..0401ab5 100644 --- a/devops-service/features/flavor.feature +++ b/devops-service/features/flavor.feature @@ -10,10 +10,10 @@ Feature: flavors """ [ { - "id" => "flavor_id", - "v_cpus" => "v_cpus", - "ram" => "ram", - "disk" => "disk" + "id": "flavor_id", + "v_cpus": "v_cpus", + "ram": "ram", + "disk": "disk" } ] """ diff --git a/devops-service/features/step_definitions/http_queries_steps.rb b/devops-service/features/step_definitions/http_queries_steps.rb index fbc3d05..9065a88 100644 --- a/devops-service/features/step_definitions/http_queries_steps.rb +++ b/devops-service/features/step_definitions/http_queries_steps.rb @@ -4,7 +4,6 @@ DEFAULT_HEADERS = { 'Accept' => 'application/json' } When(/^I send GET '(.*)' query$/) do |path| - puts path get(path, {}, DEFAULT_HEADERS) end diff --git a/devops-service/features/support/env.rb b/devops-service/features/support/env.rb index ce51154..2e5ce5d 100644 --- a/devops-service/features/support/env.rb +++ b/devops-service/features/support/env.rb @@ -25,8 +25,23 @@ class RequestSender @last_res = nil $test_hash = Hash.new + # config: + # host= + # port= + # username= + # password= + def initialize + file = "tests.conf" + abort("File does not exist: #{File.absolute_path(file)}") unless File.exists?(file) + @config = {} + File.open(file).each_line do |l| + b = l.split("=") + @config[ b[0] ] = b[1].strip + end + end + def host - "http://#{HOST}:#{PORT}" + "http://#{@config["host"]}:#{@config["port"]}" end def last_response @@ -54,7 +69,7 @@ class RequestSender def submit http = HTTPClient.new - http.set_auth(host, USERNAME, PASSWORD) + http.set_auth(nil, @config["username"], @config["password"]) res = yield http @last_res = res end