1
0
Fork 0

Backport testing changes from devel

This commit is contained in:
KVS85 2019-04-22 15:21:38 +02:00
parent 1bd25865fe
commit b5cd164727
20 changed files with 123 additions and 89 deletions

View File

@ -8,3 +8,4 @@ permissions
permissions_server
audit_client
audit_server
resilience_transactions

View File

@ -30,6 +30,11 @@ const functionsDocumentation = {
'replication_random': 'replication randomized tests for transactions',
'replication_aql': 'replication AQL tests',
'replication_ongoing': 'replication ongoing tests',
'replication_ongoing_32': 'replication ongoing "32" tests',
'replication_ongoing_global': 'replication ongoing "global" tests',
'replication_ongoing_global_spec': 'replication ongoing "global-spec" tests',
'replication_ongoing_frompresent': 'replication ongoing "frompresent" tests',
'replication_ongoing_frompresent_32': 'replication ongoing "frompresent-32" tests',
'replication_static': 'replication static tests',
'replication_sync': 'replication sync tests',
'shell_replication': 'shell replication tests'
@ -61,7 +66,7 @@ function shellReplication (options) {
// //////////////////////////////////////////////////////////////////////////////
function replicationFuzz (options) {
let testCases = tu.scanTestPath('js/server/tests/replication/');
let testCases = tu.scanTestPath('js/server/tests/replication/fuzz');
options.replication = true;
options.test = 'replication-fuzz';
@ -120,7 +125,7 @@ function replicationFuzz (options) {
// //////////////////////////////////////////////////////////////////////////////
function replicationRandom (options) {
let testCases = tu.scanTestPath('js/server/tests/replication/');
let testCases = tu.scanTestPath('js/server/tests/replication/random');
options.replication = true;
options.test = 'replication-random';
@ -179,7 +184,7 @@ function replicationRandom (options) {
// //////////////////////////////////////////////////////////////////////////////
function replicationAql (options) {
let testCases = tu.scanTestPath('js/server/tests/replication/');
let testCases = tu.scanTestPath('js/server/tests/replication/aql');
options.replication = true;
options.test = 'replication-aql';
@ -234,73 +239,81 @@ function replicationAql (options) {
}
// //////////////////////////////////////////////////////////////////////////////
// / @brief TEST: replication_ongoing
// / @brief TEST: replication_ongoing*
// //////////////////////////////////////////////////////////////////////////////
function replicationOngoing (options) {
let testCases = tu.scanTestPath('js/server/tests/replication/');
options.replication = true;
if (options.test === undefined) {
options.test = 'replication-ongoing';
}
let startStopHandlers = {
postStart: function (options,
var _replicationOngoing = function(path) {
this.func = function replicationOngoing (options) {
let testCases = tu.scanTestPath(path);
options.replication = true;
if (options.test === undefined) {
options.test = 'replication-ongoing';
}
let startStopHandlers = {
postStart: function (options,
serverOptions,
instanceInfo,
customInstanceInfos,
startStopHandlers) {
let message;
let slave = pu.startInstance('tcp', options, {}, 'slave_ongoing');
let state = (typeof slave === 'object');
if (state) {
message = 'failed to start slave instance!';
}
return {
instanceInfo: slave,
message: message,
state: state,
env: {
'flatCommands': slave.endpoint
}
};
},
preStop: function (options,
serverOptions,
instanceInfo,
customInstanceInfos,
startStopHandlers) {
let message;
let slave = pu.startInstance('tcp', options, {}, 'slave_ongoing');
let state = (typeof slave === 'object');
if (state) {
message = 'failed to start slave instance!';
}
return {
instanceInfo: slave,
message: message,
state: state,
env: {
'flatCommands': slave.endpoint
pu.shutdownInstance(customInstanceInfos.postStart.instanceInfo, options);
return {};
},
postStop: function (options,
serverOptions,
instanceInfo,
customInstanceInfos,
startStopHandlers) {
if (options.cleanup) {
pu.cleanupLastDirectory(options);
}
};
},
preStop: function (options,
serverOptions,
instanceInfo,
customInstanceInfos,
startStopHandlers) {
pu.shutdownInstance(customInstanceInfos.postStart.instanceInfo, options);
return {};
},
postStop: function (options,
serverOptions,
instanceInfo,
customInstanceInfos,
startStopHandlers) {
if (options.cleanup) {
pu.cleanupLastDirectory(options);
return { state: true };
}
return { state: true };
}
};
return tu.performTests(options, testCases, path, tu.runInArangosh, {'server.authentication':'true'}, startStopHandlers);
};
};
return tu.performTests(options, testCases, 'replication_ongoing', tu.runInArangosh, {'server.authentication':'true'}, startStopHandlers);
}
const replicationOngoing = (new _replicationOngoing('js/server/tests/replication/ongoing')).func;
const replicationOngoing32 = (new _replicationOngoing('js/server/tests/replication/ongoing/32')).func;
const replicationOngoingGlobal = (new _replicationOngoing('js/server/tests/replication/ongoing/global')).func;
const replicationOngoingGlobalSpec = (new _replicationOngoing('js/server/tests/replication/ongoing/global/spec')).func;
const replicationOngoingFrompresent = (new _replicationOngoing('js/server/tests/replication/ongoing/frompresent')).func;
const replicationOngoingFrompresent32 = (new _replicationOngoing('js/server/tests/replication/ongoing/frompresent/32')).func;
// //////////////////////////////////////////////////////////////////////////////
// / @brief TEST: replication_static
// //////////////////////////////////////////////////////////////////////////////
function replicationStatic (options) {
let testCases = tu.scanTestPath('js/server/tests/replication/');
let testCases = tu.scanTestPath('js/server/tests/replication/static');
options.replication = true;
if (options.test === undefined) {
@ -373,7 +386,7 @@ function replicationStatic (options) {
return tu.performTests(
options,
testCases,
'master_static',
'replication_static',
tu.runInArangosh,
{
'server.authentication': 'true'
@ -386,7 +399,7 @@ function replicationStatic (options) {
// //////////////////////////////////////////////////////////////////////////////
function replicationSync (options) {
let testCases = tu.scanTestPath('js/server/tests/replication/');
let testCases = tu.scanTestPath('js/server/tests/replication/sync');
options.replication = true;
if (options.test === undefined) {
@ -464,6 +477,11 @@ function setup (testFns, defaultFns, opts, fnDocs, optionsDoc) {
testFns['replication_fuzz'] = replicationFuzz;
testFns['replication_random'] = replicationRandom;
testFns['replication_ongoing'] = replicationOngoing;
testFns['replication_ongoing_32'] = replicationOngoing32;
testFns['replication_ongoing_global'] = replicationOngoingGlobal;
testFns['replication_ongoing_global_spec'] = replicationOngoingGlobalSpec;
testFns['replication_ongoing_frompresent'] = replicationOngoingFrompresent;
testFns['replication_ongoing_frompresent_32'] = replicationOngoingFrompresent32;
testFns['replication_static'] = replicationStatic;
testFns['replication_sync'] = replicationSync;
for (var attrname in functionsDocumentation) { fnDocs[attrname] = functionsDocumentation[attrname]; }

View File

@ -2,31 +2,35 @@
/* global */
'use strict';
// //////////////////////////////////////////////////////////////////////////////
// / DISCLAIMER
// /
// / Copyright 2016 ArangoDB GmbH, Cologne, Germany
// / Copyright 2014 triagens GmbH, Cologne, Germany
// /
// / Licensed under the Apache License, Version 2.0 (the "License")
// / you may not use this file except in compliance with the License.
// / You may obtain a copy of the License at
// /
// / http://www.apache.org/licenses/LICENSE-2.0
// /
// / Unless required by applicable law or agreed to in writing, software
// / distributed under the License is distributed on an "AS IS" BASIS,
// / WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// / See the License for the specific language governing permissions and
// / limitations under the License.
// /
// / Copyright holder is ArangoDB GmbH, Cologne, Germany
// /
// / @author Max Neunhoeffer
// //////////////////////////////////////////////////////////////////////////////
// /////////////////////////////////////////////////////////////////////////////
// DISCLAIMER
//
// Copyright 2016-2018 ArangoDB GmbH, Cologne, Germany
// Copyright 2014 triagens GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License")
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
// @author Max Neunhoeffer
// /////////////////////////////////////////////////////////////////////////////
const functionsDocumentation = {
'resilience': 'resilience tests',
'resilience_move': 'resilience "move" tests',
'resilience_repair': 'resilience "repair" tests',
'resilience_failover': 'resilience "failover" tests',
'resilience_failover_failure': 'resilience "failover failure" tests',
'resilience_sharddist': 'resilience "sharddist" tests',
'client_resilience': 'client resilience tests',
'cluster_sync': 'cluster sync tests',
'active_failover': 'active failover tests'
@ -40,15 +44,22 @@ const tu = require('@arangodb/test-utils');
// / @brief TEST: resilience
// //////////////////////////////////////////////////////////////////////////////
function resilience (options) {
let testCases = tu.scanTestPath('js/server/tests/resilience');
options.cluster = true;
options.propagateInstanceInfo = true;
if (options.dbServers < 5) {
options.dbServers = 5;
}
return tu.performTests(options, testCases, 'resilience', tu.runThere);
}
var _resilience = function(path) {
this.func = function resilience (options) {
let testCases = tu.scanTestPath(path);
options.cluster = true;
options.propagateInstanceInfo = true;
if (options.dbServers < 5) {
options.dbServers = 5;
}
return tu.performTests(options, testCases, path, tu.runThere);
};
};
const resilienceMove = (new _resilience('js/server/tests/resilience/move')).func;
const resilienceRepair = (new _resilience('js/server/tests/resilience/repair/')).func;
const resilienceFailover = (new _resilience('js/server/tests/resilience/failover')).func;
const resilienceFailoverFailure = (new _resilience('js/server/tests/resilience/failover-failure')).func;
const resilienceSharddist = (new _resilience('js/server/tests/resilience/sharddist')).func;
// //////////////////////////////////////////////////////////////////////////////
// / @brief TEST: client resilience
@ -112,7 +123,11 @@ function activeFailover (options) {
}
function setup (testFns, defaultFns, opts, fnDocs, optionsDoc) {
testFns['resilience'] = resilience;
testFns['resilience_move'] = resilienceMove;
testFns['resilience_repair'] = resilienceRepair;
testFns['resilience_failover'] = resilienceFailoverFailure;
testFns['resilience_failover_failure'] = resilienceFailoverFailure;
testFns['resilience_sharddist'] = resilienceSharddist;
testFns['client_resilience'] = clientResilience;
testFns['cluster_sync'] = clusterSync;
testFns['active_failover'] = activeFailover;