-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #407 from jlledom/THREESCALE-10826-async-unix-path
THREESCALE-10826: Add support for unix sockets in async mode
- Loading branch information
Showing
7 changed files
with
117 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,12 @@ def test_redis_url | |
assert_client_config(config_obj, storage) | ||
end | ||
|
||
def test_redis_unix | ||
config_obj = url('unix:///tmp/redis_unix.6379.sock') | ||
storage = StorageAsync::Client.send :new, config_obj | ||
assert_client_config(config_obj, storage) | ||
end | ||
|
||
def test_redis_protected_url | ||
assert_nothing_raised do | ||
StorageAsync::Client.send :new, url('redis://user:[email protected]:6379/0') | ||
|
@@ -303,13 +309,17 @@ def create_certs(alg) | |
def assert_client_config(conf, conn, test_cert_type = nil) | ||
client = conn.instance_variable_get(:@inner).instance_variable_get(:@redis_async) | ||
|
||
url = URI(conf[:url]) | ||
host, port = client.endpoint.address | ||
assert_equal url.host, host | ||
assert_equal url.port, port | ||
|
||
db = client.protocol.instance_variable_get(:@db) | ||
assert_equal conf[:db], db | ||
if conf[:url].to_s.strip.empty? | ||
path = conf[:path] | ||
assert_equal path, client.endpoint.path | ||
else | ||
url = URI(conf[:url]) | ||
host, port = client.endpoint.address | ||
assert_equal url.host, host | ||
assert_equal url.port, port | ||
db = client.protocol.instance_variable_get(:@db) | ||
assert_equal conf[:db], db | ||
end | ||
|
||
assert_acl_credentials(conf, client) | ||
assert_tls_certs(conf, client, test_cert_type) | ||
|