You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-09 00:22:08 +03:00
Skip tls tests on windows and stunnel
This will also remove the libwrap option to work on arch
This commit is contained in:
@@ -5,7 +5,6 @@ cert = __dirname/redis.js.org.cert
|
||||
key = __dirname/redis.js.org.key
|
||||
client = no
|
||||
foreground = yes
|
||||
libwrap = no
|
||||
debug = 7
|
||||
[redis]
|
||||
accept = 127.0.0.1:6380
|
||||
|
@@ -103,7 +103,7 @@ describe("connection tests", function () {
|
||||
max_attempts: 1
|
||||
};
|
||||
client = redis.createClient(options);
|
||||
assert.strictEqual(client.connection_option.family, ip === 'IPv6' ? 6 : 4);
|
||||
assert.strictEqual(client.connection_options.family, ip === 'IPv6' ? 6 : 4);
|
||||
assert.strictEqual(Object.keys(options).length, 4);
|
||||
var end = helper.callFuncAfter(done, 2);
|
||||
|
||||
@@ -142,7 +142,7 @@ describe("connection tests", function () {
|
||||
assert(client.stream._events.timeout);
|
||||
});
|
||||
assert.strictEqual(client.address, '192.168.74.167:6379');
|
||||
assert.strictEqual(client.connection_option.family, 4);
|
||||
assert.strictEqual(client.connection_options.family, 4);
|
||||
var time = Date.now();
|
||||
|
||||
client.on("reconnecting", function (params) {
|
||||
@@ -162,7 +162,7 @@ describe("connection tests", function () {
|
||||
host: '2001:db8::ff00:42:8329' // auto detect ip v6
|
||||
});
|
||||
assert.strictEqual(client.address, '2001:db8::ff00:42:8329:6379');
|
||||
assert.strictEqual(client.connection_option.family, 6);
|
||||
assert.strictEqual(client.connection_options.family, 6);
|
||||
process.nextTick(function() {
|
||||
assert.strictEqual(client.stream._events.timeout, undefined);
|
||||
});
|
||||
@@ -240,7 +240,7 @@ describe("connection tests", function () {
|
||||
|
||||
it("connects with a port only", function (done) {
|
||||
client = redis.createClient(6379);
|
||||
assert.strictEqual(client.connection_option.family, 4);
|
||||
assert.strictEqual(client.connection_options.family, 4);
|
||||
client.on("error", done);
|
||||
|
||||
client.once("ready", function () {
|
||||
|
@@ -15,14 +15,29 @@ var tls_options = {
|
||||
|
||||
var tls_port = 6380;
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
return;
|
||||
}
|
||||
|
||||
// Wait until stunnel4 is in the travis whitelist
|
||||
// Check: https://github.com/travis-ci/apt-package-whitelist/issues/403
|
||||
// If this is merged, remove the travis env checks
|
||||
describe("TLS connection tests", function () {
|
||||
before(function (done) {
|
||||
if (process.env.TRAVIS === 'true') {
|
||||
done();
|
||||
return;
|
||||
}
|
||||
helper.stopStunnel(function () {
|
||||
helper.startStunnel(done);
|
||||
});
|
||||
});
|
||||
|
||||
after(function (done) {
|
||||
if (process.env.TRAVIS === 'true') {
|
||||
done();
|
||||
return;
|
||||
}
|
||||
helper.stopStunnel(done);
|
||||
});
|
||||
|
||||
@@ -33,13 +48,12 @@ describe("TLS connection tests", function () {
|
||||
var client;
|
||||
|
||||
afterEach(function () {
|
||||
if (client) {
|
||||
client.end();
|
||||
}
|
||||
client.end(true);
|
||||
});
|
||||
|
||||
describe("on lost connection", function () {
|
||||
it("emit an error after max retry attempts and do not try to reconnect afterwards", function (done) {
|
||||
if (process.env.TRAVIS === 'true') this.skip();
|
||||
var max_attempts = 4;
|
||||
var options = {
|
||||
parser: parser,
|
||||
@@ -69,6 +83,7 @@ describe("TLS connection tests", function () {
|
||||
});
|
||||
|
||||
it("emit an error after max retry timeout and do not try to reconnect afterwards", function (done) {
|
||||
if (process.env.TRAVIS === 'true') this.skip();
|
||||
var connect_timeout = 500; // in ms
|
||||
client = redis.createClient({
|
||||
parser: parser,
|
||||
@@ -97,6 +112,7 @@ describe("TLS connection tests", function () {
|
||||
});
|
||||
|
||||
it("end connection while retry is still ongoing", function (done) {
|
||||
if (process.env.TRAVIS === 'true') this.skip();
|
||||
var connect_timeout = 1000; // in ms
|
||||
client = redis.createClient({
|
||||
parser: parser,
|
||||
@@ -116,6 +132,7 @@ describe("TLS connection tests", function () {
|
||||
});
|
||||
|
||||
it("can not connect with wrong host / port in the options object", function (done) {
|
||||
if (process.env.TRAVIS === 'true') this.skip();
|
||||
var options = {
|
||||
host: 'somewhere',
|
||||
max_attempts: 1,
|
||||
@@ -136,6 +153,7 @@ describe("TLS connection tests", function () {
|
||||
describe("when not connected", function () {
|
||||
|
||||
it("connect with host and port provided in the options object", function (done) {
|
||||
if (process.env.TRAVIS === 'true') this.skip();
|
||||
client = redis.createClient({
|
||||
host: 'localhost',
|
||||
parser: parser,
|
||||
@@ -150,6 +168,7 @@ describe("TLS connection tests", function () {
|
||||
});
|
||||
|
||||
it("connects correctly with args", function (done) {
|
||||
if (process.env.TRAVIS === 'true') this.skip();
|
||||
var args_host = args[1];
|
||||
var args_options = args[2] || {};
|
||||
args_options.tls = tls_options;
|
||||
@@ -166,6 +185,7 @@ describe("TLS connection tests", function () {
|
||||
|
||||
if (ip === 'IPv4') {
|
||||
it('allows connecting with the redis url and no auth and options as second parameter', function (done) {
|
||||
if (process.env.TRAVIS === 'true') this.skip();
|
||||
var options = {
|
||||
detect_buffers: false,
|
||||
magic: Math.random(),
|
||||
@@ -176,6 +196,7 @@ describe("TLS connection tests", function () {
|
||||
// verify connection is using TCP, not UNIX socket
|
||||
assert.strictEqual(client.connection_options.host, config.HOST[ip]);
|
||||
assert.strictEqual(client.connection_options.port, tls_port);
|
||||
assert(typeof client.stream.getCipher === 'function');
|
||||
// verify passed options are in use
|
||||
assert.strictEqual(client.options.magic, options.magic);
|
||||
client.on("ready", function () {
|
||||
@@ -184,6 +205,7 @@ describe("TLS connection tests", function () {
|
||||
});
|
||||
|
||||
it('allows connecting with the redis url and no auth and options as third parameter', function (done) {
|
||||
if (process.env.TRAVIS === 'true') this.skip();
|
||||
client = redis.createClient('redis://' + config.HOST[ip] + ':' + tls_port, null, {
|
||||
detect_buffers: false,
|
||||
tls: tls_options
|
||||
|
Reference in New Issue
Block a user