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:
@ -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')
|
||||
|
Reference in New Issue
Block a user