multibinder 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/bin/multibinder +1 -0
- data/lib/multibinder/version.rb +1 -1
- data/multibinder.gemspec +1 -1
- data/script/cibuild +2 -2
- data/script/deploy +13 -0
- data/test/httpbinder.rb +10 -6
- data/test/test-haproxy.sh +3 -3
- data/test/test-simple.sh +8 -8
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dabc32c60bf41a7ac5df3709688f87b62aedf037
|
4
|
+
data.tar.gz: 1353e78eb3c9ba7b1d99a2ee7006b66f90af8214
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f8d608341c689a49983a185d4bc24201a701a95e3351e6518148e1e5ee9e8f9863a672bb0413a94cb23899308f037ee0b54080d8d79f234ef8581823d19ec5c
|
7
|
+
data.tar.gz: 42f99726970af3eeccb0b0adcb6ecbe30fc60a9a4dab7d1e2241a1da54ab61abf411dbb6c30801da01c62f65f40b04a382d0ee3f2f503fb2de2703569fac96ae
|
data/.gitignore
CHANGED
data/bin/multibinder
CHANGED
data/lib/multibinder/version.rb
CHANGED
data/multibinder.gemspec
CHANGED
@@ -17,6 +17,6 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
|
-
spec.add_development_dependency "bundler", "~> 1.
|
20
|
+
spec.add_development_dependency "bundler", "~> 1.5"
|
21
21
|
spec.add_development_dependency "rake", "~> 10.0"
|
22
22
|
end
|
data/script/cibuild
CHANGED
@@ -3,9 +3,9 @@
|
|
3
3
|
export RUBY_VERSION=2.1.6-github
|
4
4
|
export RBENV_VERSION=2.1.6-github
|
5
5
|
export PATH=/usr/share/rbenv/shims:/usr/sbin:$PATH
|
6
|
-
export BASE_DIR=/data/
|
6
|
+
export BASE_DIR=/data/multibinder
|
7
7
|
|
8
|
-
|
8
|
+
bundle install --local --quiet --path vendor/gems
|
9
9
|
|
10
10
|
REALPATH=$(cd $(dirname "$0") && pwd)
|
11
11
|
|
data/script/deploy
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
|
3
|
+
export RUBY_VERSION=2.1.6-github
|
4
|
+
export RBENV_VERSION=2.1.6-github
|
5
|
+
export PATH=/usr/share/rbenv/shims:/usr/sbin:$PATH
|
6
|
+
export BASE_DIR=/data/multibinder
|
7
|
+
|
8
|
+
REALPATH=$(cd $(dirname "$0") && pwd)
|
9
|
+
cd $REALPATH/../
|
10
|
+
|
11
|
+
bundle install --local --quiet --path vendor/gems
|
12
|
+
|
13
|
+
sudo sv 1 multibinder
|
data/test/httpbinder.rb
CHANGED
@@ -9,13 +9,17 @@ loop do
|
|
9
9
|
request = socket.gets
|
10
10
|
puts request
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
begin
|
13
|
+
socket.print "HTTP/1.0 200 OK\r\n"
|
14
|
+
socket.print "Content-Type: text/plain\r\n"
|
15
|
+
socket.print "Connection: close\r\n"
|
15
16
|
|
16
|
-
|
17
|
+
socket.print "\r\n"
|
17
18
|
|
18
|
-
|
19
|
+
socket.print "Hello World #{ARGV[1] || ''}!\n"
|
19
20
|
|
20
|
-
|
21
|
+
socket.close
|
22
|
+
rescue Errno::EPIPE
|
23
|
+
puts 'Client unexpectedly closed connection'
|
24
|
+
end
|
21
25
|
end
|
data/test/test-haproxy.sh
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#!/bin/
|
1
|
+
#!/bin/bash
|
2
2
|
#
|
3
3
|
# test-haproxy.sh: check that we can work with haproxy (if it's installed)
|
4
4
|
|
@@ -9,7 +9,7 @@ TEST_PORT=8000
|
|
9
9
|
|
10
10
|
tests_use_port $TEST_PORT
|
11
11
|
|
12
|
-
if ! which
|
12
|
+
if ! which haproxy >/dev/null 2>&1; then
|
13
13
|
echo "haproxy not available, skipping tests."
|
14
14
|
exit 0
|
15
15
|
fi
|
@@ -20,7 +20,7 @@ begin_test "haproxy runs with multibinder"
|
|
20
20
|
|
21
21
|
export TEMPDIR
|
22
22
|
|
23
|
-
MULTIBINDER_SOCK=${TEMPDIR}/multibinder.sock
|
23
|
+
launch_service "haproxy" bundle exec env MULTIBINDER_SOCK=${TEMPDIR}/multibinder.sock ruby test/haproxy_shim.rb $(offset_port $TEST_PORT)
|
24
24
|
|
25
25
|
wait_for_port "haproxy" $(offset_port $TEST_PORT)
|
26
26
|
|
data/test/test-simple.sh
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#!/bin/
|
1
|
+
#!/bin/bash
|
2
2
|
#
|
3
3
|
# test-simple.sh: simple sanity checks
|
4
4
|
|
@@ -13,7 +13,7 @@ begin_test "server binds and accepts through multibinder"
|
|
13
13
|
(
|
14
14
|
setup
|
15
15
|
|
16
|
-
MULTIBINDER_SOCK=${TEMPDIR}/multibinder.sock
|
16
|
+
launch_service "http" bundle exec env MULTIBINDER_SOCK=${TEMPDIR}/multibinder.sock ruby test/httpbinder.rb $(offset_port $TEST_PORT)
|
17
17
|
|
18
18
|
wait_for_port "binder" $(offset_port $TEST_PORT)
|
19
19
|
|
@@ -25,7 +25,7 @@ begin_test "server can restart without requests failing while down"
|
|
25
25
|
(
|
26
26
|
setup
|
27
27
|
|
28
|
-
MULTIBINDER_SOCK=${TEMPDIR}/multibinder.sock
|
28
|
+
launch_service "http" bundle exec env MULTIBINDER_SOCK=${TEMPDIR}/multibinder.sock ruby test/httpbinder.rb $(offset_port $TEST_PORT)
|
29
29
|
|
30
30
|
wait_for_port "binder" $(offset_port $TEST_PORT)
|
31
31
|
|
@@ -37,7 +37,7 @@ begin_test "server can restart without requests failing while down"
|
|
37
37
|
sleep 0.5
|
38
38
|
|
39
39
|
# now restart the service
|
40
|
-
MULTIBINDER_SOCK=${TEMPDIR}/multibinder.sock
|
40
|
+
launch_service "http" bundle exec env MULTIBINDER_SOCK=${TEMPDIR}/multibinder.sock ruby test/httpbinder.rb $(offset_port $TEST_PORT)
|
41
41
|
|
42
42
|
# curl should finish, and succeed
|
43
43
|
wait $curl_pid
|
@@ -49,12 +49,12 @@ begin_test "server can load a second copy then terminate the first"
|
|
49
49
|
(
|
50
50
|
setup
|
51
51
|
|
52
|
-
MULTIBINDER_SOCK=${TEMPDIR}/multibinder.sock
|
52
|
+
launch_service "http" bundle exec env MULTIBINDER_SOCK=${TEMPDIR}/multibinder.sock ruby test/httpbinder.rb $(offset_port $TEST_PORT) "first"
|
53
53
|
wait_for_port "binder" $(offset_port $TEST_PORT)
|
54
54
|
|
55
55
|
curl --max-time 5 http://localhost:$(offset_port $TEST_PORT)/r1 | grep -q 'Hello World first'
|
56
56
|
|
57
|
-
MULTIBINDER_SOCK=${TEMPDIR}/multibinder.sock
|
57
|
+
launch_service "http2" bundle exec env MULTIBINDER_SOCK=${TEMPDIR}/multibinder.sock ruby test/httpbinder.rb $(offset_port $TEST_PORT) "second"
|
58
58
|
|
59
59
|
curl --max-time 5 http://localhost:$(offset_port $TEST_PORT)/r2 | egrep -q 'Hello World (first|second)'
|
60
60
|
|
@@ -70,7 +70,7 @@ begin_test "multibinder restarts safely on sigusr1"
|
|
70
70
|
(
|
71
71
|
setup
|
72
72
|
|
73
|
-
MULTIBINDER_SOCK=${TEMPDIR}/multibinder.sock
|
73
|
+
launch_service "http" bundle exec env MULTIBINDER_SOCK=${TEMPDIR}/multibinder.sock ruby test/httpbinder.rb $(offset_port $TEST_PORT)
|
74
74
|
wait_for_port "binder" $(offset_port $TEST_PORT)
|
75
75
|
|
76
76
|
curl --max-time 5 http://localhost:$(offset_port $TEST_PORT)/r1 | grep -q 'Hello World'
|
@@ -86,7 +86,7 @@ begin_test "multibinder restarts safely on sigusr1"
|
|
86
86
|
lsof -i :$(offset_port $TEST_PORT) -a -p $(service_pid "multibinder")
|
87
87
|
|
88
88
|
# should be able to request the bind again
|
89
|
-
MULTIBINDER_SOCK=${TEMPDIR}/multibinder.sock
|
89
|
+
launch_service "http" bundle exec env MULTIBINDER_SOCK=${TEMPDIR}/multibinder.sock ruby test/httpbinder.rb $(offset_port $TEST_PORT)
|
90
90
|
wait_for_port "multibinder" $(offset_port $TEST_PORT)
|
91
91
|
|
92
92
|
# requests should work
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: multibinder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Theo Julienne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.5'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1.
|
26
|
+
version: '1.5'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -56,6 +56,7 @@ files:
|
|
56
56
|
- lib/multibinder/version.rb
|
57
57
|
- multibinder.gemspec
|
58
58
|
- script/cibuild
|
59
|
+
- script/deploy
|
59
60
|
- script/test
|
60
61
|
- test/haproxy_shim.rb
|
61
62
|
- test/httpbinder.rb
|