lbspec 0.2.12 → 0.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 43048b897beb3ba1a36100e000c80c834e583e6b
4
- data.tar.gz: 2dfab8428ce339d379cf35e0b5bcacb6b30b6acf
3
+ metadata.gz: 54d84e1c4eaec31b2382125950e00a920f3a8060
4
+ data.tar.gz: 8625ccd2d2c09e0352b4c57ba49638a0904022a1
5
5
  SHA512:
6
- metadata.gz: f14e286e526b7a04d013d40dc879c18290e6faacb37d0b96865d72defdf40b09c05ca391861426e0070f801f2bcc1ffeee58cd6f0590a9446379ee885f6dac7e
7
- data.tar.gz: b8ccc5ae96580c571872900149ec3885a505e0f13d95cfed0241ff0d51240c2f79d6d7befdfdd87aa0e8dc35b78011ce2dcbfb28d7b3c3793709d0e9ee2040a4
6
+ metadata.gz: 3e6b849c0db14c5f8f95c940c171352558963525ca0e16ad0a093bae2bea0d9a2dd8500e455f00d60ed60f1d5d96149763c1404b8d89f01ca776ead014a30093
7
+ data.tar.gz: 6c8fccc2d834d5cd7d67b0042d88a083febf4db5707865642280f3d8845377d97a23bd56320f8a2f94de3e0e56321caca6e1868344d3d922ed829a842cbaf2c5
data/README.md CHANGED
@@ -98,6 +98,16 @@ vhost_c:443
98
98
  vhost_c:443/test/
99
99
  should transfer requests to ["node_b", "node_c"] port 80 https.
100
100
  should respond 200 OK
101
+ vhost_c:80/test/
102
+ should transfer requests to node_c http from node_a.
103
+ loadbalancer
104
+ should healthcheck node_c including /test/healthcheck from 192.168.1.1.
105
+ loadbalancer
106
+ should healthcheck node_c including /test/healthcheck at interval of 5 sec.
107
+
108
+ Finished in 5.1 seconds
109
+ 16 examples, 0 failures
110
+ $
101
111
  ```
102
112
 
103
113
 
@@ -117,7 +117,7 @@ module Lbspec
117
117
  end
118
118
 
119
119
  def capture_command
120
- "sudo ngrep -W byline #{@prove} #{@bpf} | grep -v \"match:\""
120
+ %Q(sudo ngrep -W byline "#{@prove}" #{@bpf} | grep -v "match:")
121
121
  end
122
122
  end
123
123
  end
@@ -37,19 +37,19 @@ module Lbspec
37
37
 
38
38
  def send_http(prove)
39
39
  @port = 80 unless @port
40
- uri = 'http://' + "#{@addr}:#{@port}#{@path}?#{prove}"
41
- command = build_curl_command(uri, @options)
40
+ uri = 'http://' + "#{@addr}:#{@port}#{@path}"
41
+ command = build_curl_command(uri, prove, @options)
42
42
  Lbspec::Util.exec_command(command, @from)
43
43
  end
44
44
 
45
45
  def send_https(prove)
46
46
  @port = 443 unless @port == 0
47
- uri = 'https://' + "#{@addr}:#{@port}#{@path}?#{prove}"
48
- command = build_curl_command(uri, @options)
47
+ uri = 'https://' + "#{@addr}:#{@port}#{@path}"
48
+ command = build_curl_command(uri, prove, @options)
49
49
  Lbspec::Util.exec_command(command, @from)
50
50
  end
51
51
 
52
- def build_curl_command(uri, options = {})
52
+ def build_curl_command(uri, prove, options = {})
53
53
  env, opt = '', ''
54
54
  opt << (options[:timeout] ? " -m #{options[:timeout]}" : '')
55
55
  opt << (options[:ignore_valid_ssl] ? ' -k' : '')
@@ -59,7 +59,7 @@ module Lbspec
59
59
  env << %Q(NO_PROXY="#{options[:noproxy]}" )
60
60
  end
61
61
  opt << header_option(options[:header])
62
- "#{env}curl -v -i -s #{opt} '#{uri}'"
62
+ "#{env}curl -v -i -H 'X-Lbspec-Prove: #{prove}' -s #{opt} '#{uri}'"
63
63
  end
64
64
 
65
65
  def header_option(header)
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  # Lbspec is an RSpec plugin for easy Loadbalancer testing.
3
3
  module Lbspec
4
- VERSION = '0.2.12'
4
+ VERSION = '0.2.13'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lbspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.12
4
+ version: 0.2.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - OTA Hiroshi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-24 00:00:00.000000000 Z
11
+ date: 2014-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler