res 1.2.4 → 1.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dcf73c2d31e4a4a6efe8416ab4a55578d9aa5917
4
- data.tar.gz: b97d9c7d2861c7d38cc21b538edc8bf7fb0b4ba7
3
+ metadata.gz: 397c8eaa87c2580e7614f5cffbecb68002b49918
4
+ data.tar.gz: bf6cbb9371ce3a37f97ad4f312343024723bf602
5
5
  SHA512:
6
- metadata.gz: cceb20237589a154257dbeec297d8a538a9c75f2261a1c2d2d817d76fd016bf70a33710ee66e42f3ae4e1ddf8e5e265e9613e17594566d7db8d96a79738569e3
7
- data.tar.gz: 63d21f4d44a2210595d374f2d4f6004145374b5f3e935c128b3750779731d0afd8b4dafac44da401a2edb2f05ef4e9c2ffb21c8e8b4ede45a492d96b95095e29
6
+ metadata.gz: b2da6b94daacf555737a09118713510f2335095f2b5cad63f09e57149ee93939ffdcf70da43cb8b0d7cc11a80f11150d57723f31e396032907c4db04125891f3
7
+ data.tar.gz: 2e1d7b1350423779a1e8210483d65922747cc58bb249f5f7a6d9315b6503797d0e6206993b9f336a7685caa6d728be1ec22f1a94ecc819825b629cabe077ff40
data/bin/res CHANGED
@@ -170,6 +170,9 @@ if options.reporter
170
170
  reporter = Res::Reporters::Lion.new(
171
171
  :config_file => options.config_file,
172
172
  :url => options.url,
173
+ :cert => options.cert,
174
+ :cacert => options.cacert,
175
+ :ssl_verify_mode => options.ssl_verify_mode,
173
176
  :ir => ir
174
177
  )
175
178
 
@@ -9,7 +9,7 @@ module Res
9
9
  def initialize(args)
10
10
  @url = args[:url]
11
11
  @config = Res::Config.new([:url, :tag, :description, :app_name],
12
- :optional => [:hive_job_id, :queue],
12
+ :optional => [:hive_job_id, :queue, :cert, :cacert, :ssl_verify_mode],
13
13
  :pre_env => 'LION_')
14
14
  config.process(args)
15
15
  end
@@ -37,17 +37,24 @@ module Res
37
37
  :status => status,
38
38
  :perf_values => values.compact!
39
39
  }
40
+
41
+
40
42
  uri = URI.parse(config.url)
41
- net = Net::HTTP.new(uri.host, uri.port)
42
- request = Net::HTTP::Post.new("/import")
43
- request.set_form_data(lion_data)
44
-
45
- net.read_timeout = 60
46
- net.open_timeout = 10
47
-
48
- response = net.start do |http|
49
- http.request(request)
43
+ @http = Net::HTTP.new(uri.host, uri.port)
44
+ if config.cert
45
+ pem = File.read(config.cert)
46
+ @http.use_ssl = true if uri.scheme == 'https'
47
+ @http.cert = OpenSSL::X509::Certificate.new(pem)
48
+ @http.key = OpenSSL::PKey::RSA.new(pem)
49
+ @http.ca_file = config.cacert if config.cacert
50
+ @http.verify_mode = config.ssl_verify_mode if config.ssl_verify_mode
50
51
  end
52
+
53
+ request = Net::HTTP::Post.new(config.url + "/import")
54
+ request.content_type = 'application/json'
55
+ request.body = lion_data.to_json
56
+
57
+ @http.request(request)
51
58
  end
52
59
 
53
60
  end
data/lib/res/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Res
2
- VERSION = '1.2.4'
2
+ VERSION = '1.2.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: res
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - BBC
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-04-19 00:00:00.000000000 Z
13
+ date: 2016-05-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: json
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  version: '0'
129
129
  requirements: []
130
130
  rubyforge_project:
131
- rubygems_version: 2.4.8
131
+ rubygems_version: 2.4.5.1
132
132
  signing_key:
133
133
  specification_version: 4
134
134
  summary: Test Result report libraries