MXS-1300: Fix monitor and listener creation
The creation commands for monitors and listeners referred to undefined variables. Also fixed the test case names being duplicated.
This commit is contained in:
parent
2411288388
commit
fa6bea33fe
@ -95,7 +95,7 @@ exports.builder = function(yargs) {
|
||||
|
||||
if (argv.servers) {
|
||||
for (i = 0; i < argv.servers.length; i++) {
|
||||
_.set(server, 'data.relationships.servers.data[' + i + ']', {id: argv.monitors[i], type: 'servers'})
|
||||
_.set(monitor, 'data.relationships.servers.data[' + i + ']', {id: argv.servers[i], type: 'servers'})
|
||||
}
|
||||
}
|
||||
|
||||
@ -155,12 +155,6 @@ exports.builder = function(yargs) {
|
||||
}
|
||||
}
|
||||
|
||||
if (argv.servers) {
|
||||
for (i = 0; i < argv.servers.length; i++) {
|
||||
_.set(server, 'data.relationships.servers.data[' + i + ']', {id: argv.monitors[i], type: 'servers'})
|
||||
}
|
||||
}
|
||||
|
||||
maxctrl(argv, function(host) {
|
||||
return doRequest(host, 'services/' + argv.service + '/listeners', null, {method: 'POST', body: listener})
|
||||
})
|
||||
|
@ -5,7 +5,7 @@
|
||||
"repository": "https://github.com/mariadb-corporation/MaxScale",
|
||||
"main": "maxctrl.js",
|
||||
"scripts": {
|
||||
"test": "mocha --timeout 30000 --slow 10000"
|
||||
"test": "mocha --timeout 15000 --slow 10000"
|
||||
},
|
||||
"keywords": [
|
||||
"maxscale"
|
||||
|
@ -1,6 +1,6 @@
|
||||
require('../test_utils.js')()
|
||||
|
||||
describe("Server states", function() {
|
||||
describe("Server Commands", function() {
|
||||
before(startMaxScale)
|
||||
|
||||
var ctrl = require('maxctrl-core')
|
||||
@ -29,16 +29,6 @@ describe("Server states", function() {
|
||||
.should.be.fulfilled
|
||||
})
|
||||
|
||||
it('create server with options', function() {
|
||||
return ctrl.execute('create server server5 127.0.0.1 3003 --authenticator GSSAPIBackendAuth'.split(' '), opts)
|
||||
.then(function() {
|
||||
return request.get(host + 'servers/server5', {json: true})
|
||||
})
|
||||
.then(function(res) {
|
||||
res.data.attributes.parameters.authenticator.should.equal("GSSAPIBackendAuth")
|
||||
})
|
||||
})
|
||||
|
||||
it('create server with bad parameters', function() {
|
||||
return ctrl.execute('create server server5 bad parameter'.split(' '), opts)
|
||||
.should.be.rejected
|
||||
@ -49,6 +39,16 @@ describe("Server states", function() {
|
||||
.should.be.rejected
|
||||
})
|
||||
|
||||
it('create server with options', function() {
|
||||
return ctrl.execute('create server server5 127.0.0.1 3003 --authenticator GSSAPIBackendAuth'.split(' '), opts)
|
||||
.then(function() {
|
||||
return request.get(host + 'servers/server5', {json: true})
|
||||
})
|
||||
.then(function(res) {
|
||||
res.data.attributes.parameters.authenticator.should.equal("GSSAPIBackendAuth")
|
||||
})
|
||||
})
|
||||
|
||||
it('alter server with bad parameters', function() {
|
||||
return ctrl.execute('alter server server1 port not-a-port'.split(' '), opts)
|
||||
.should.be.rejected
|
||||
|
@ -1,6 +1,6 @@
|
||||
require('../test_utils.js')()
|
||||
|
||||
describe("Server states", function() {
|
||||
describe("Service Commands", function() {
|
||||
before(startMaxScale)
|
||||
|
||||
var ctrl = require('maxctrl-core')
|
||||
|
Loading…
x
Reference in New Issue
Block a user