MXS-1300: Add more MaxCtrl cluster tests

Added scripts that start two MaxScale on the same machine. This allows the
cluster synchronization commands to be tested locally.
This commit is contained in:
Markus Mäkelä
2017-08-03 09:51:45 +03:00
parent 3bd13cded6
commit 161776d576
7 changed files with 295 additions and 11 deletions

View File

@ -28,6 +28,19 @@ module.exports = function() {
})
};
// Start two MaxScales
this.startDoubleMaxScale = function() {
return new Promise(function(resolve, reject) {
child_process.execFile("./start_double_maxscale.sh", function(err, stdout, stderr) {
if (err) {
reject()
} else {
resolve()
}
})
})
};
// Stop MaxScale, this should be called in the `after` handler of each test unit
this.stopMaxScale = function() {
return new Promise(function(resolve, reject) {
@ -41,6 +54,19 @@ module.exports = function() {
})
};
// Stop two MaxScales
this.stopDoubleMaxScale = function() {
return new Promise(function(resolve, reject) {
child_process.execFile("./stop_double_maxscale.sh", function(err, stdout, stderr) {
if (err) {
reject()
} else {
resolve()
}
})
})
};
// Execute a single MaxCtrl command, returns a Promise
this.doCommand = function(command) {
var ctrl = require('./lib/core.js')