Browse Source

Add test for auth_pass option submitted by hpeinar

gh-pages
Bryce Baril 11 years ago
parent
commit
8f71003009
  1. 3
      changelog.md
  2. 2
      index.js
  3. 18
      test.js

3
changelog.md

@ -1,6 +1,9 @@
Changelog
=========
## v0.8.5 - (pending release)
* Add `auth_pass` option to connect and immediately authenticate (Henrik Peinar)
## v0.8.4 - June 24, 2013
Many contributed features and fixes, including:
* Ignore password set if not needed. (jbergknoff)

2
index.js

@ -67,7 +67,7 @@ function RedisClient(stream, options) {
this.closing = false;
this.server_info = {};
this.auth_pass = null;
if(options.auth_pass !== undefined) {
if (options.auth_pass !== undefined) {
this.auth_pass = options.auth_pass;
}
this.parser_module = null;

18
test.js

@ -1962,6 +1962,24 @@ tests.auth = function () {
});
};
tests.auth2 = function () {
var name = "AUTH2", client4, ready_count = 0;
client4 = redis.createClient(9006, "filefish.redistogo.com", {auth_pass: "664b1b6aaf134e1ec281945a8de702a9"});
// test auth, then kill the connection so it'll auto-reconnect and auto-re-auth
client4.on("ready", function () {
ready_count++;
if (ready_count === 1) {
client4.stream.destroy();
} else {
client4.quit(function (err, res) {
next(name);
});
}
});
};
tests.reconnectRetryMaxDelay = function() {
var time = new Date().getTime(),
name = 'reconnectRetryMaxDelay',

Loading…
Cancel
Save