Fix MaxCtrl cluster tests
The configuration used an invalid parameter name which caused the two MaxScales to use the same directory for persisted configurations. The test also tried to sync with the wrong server causing the same listener to be created twice on the same port but on different MaxScales. Cleaned up the startup and shutdown scripts to always start from a clean state.
This commit is contained in:
@ -224,14 +224,12 @@ describe('Cluster Sync', function() {
|
||||
.then(() => doCommand('create listener RW-Split-Router my-listener-2 5998 --hosts ' + primary_host))
|
||||
// Sync after creation should succeed
|
||||
.then(() => doCommand('cluster sync ' + secondary_host + ' --hosts ' + primary_host))
|
||||
// Destroy the created server, should succeed
|
||||
.then(() => doCommand('destroy listener RW-Split-Router my-listener-2'))
|
||||
.then(() => doCommand('cluster sync ' + secondary_host + ' --hosts ' + primary_host))
|
||||
// Destroy the created listener, should succeed
|
||||
.then(() => doCommand('destroy listener RW-Split-Router my-listener-2 --hosts ' + primary_host))
|
||||
.then(() => doCommand('cluster sync ' + primary_host + ' --hosts ' + secondary_host))
|
||||
} else {
|
||||
// MaxScales are on different machines
|
||||
|
||||
return doCommand('create listener RW-Split-Router my-listener-2 5999 --hosts ' + secondary_host)
|
||||
// As both MaxScales are on the same machine, both can't listen on the same port. The sync should fail due to this
|
||||
.then(() => doCommand('cluster sync ' + secondary_host + ' --hosts ' + primary_host))
|
||||
.then(() => doCommand('destroy listener RW-Split-Router my-listener-2'))
|
||||
.then(() => doCommand('cluster sync ' + secondary_host + ' --hosts ' + primary_host))
|
||||
|
Reference in New Issue
Block a user