Fill the gaps in MaxCtrl testing
The MaxCtrl test suite now covers most of the code that can be tested within reasonable limits. Also removed some dead code in `list servers`.
This commit is contained in:
@ -71,15 +71,6 @@ exports.builder = function(yargs) {
|
|||||||
.then(() => filterResource(res, fields))
|
.then(() => filterResource(res, fields))
|
||||||
.then((res) => rawCollectionAsTable(res, fields))
|
.then((res) => rawCollectionAsTable(res, fields))
|
||||||
})
|
})
|
||||||
|
|
||||||
return getRawCollection(host, 'servers', fields)
|
|
||||||
.then((res) => {
|
|
||||||
res.forEach((i) => {
|
|
||||||
// The server name will be first
|
|
||||||
//console.log(i[0])
|
|
||||||
})
|
|
||||||
return rawCollectionAsTable(res, fields);
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.command('services', 'List services', function(yargs) {
|
.command('services', 'List services', function(yargs) {
|
||||||
|
|||||||
@ -44,6 +44,17 @@ describe("Alter Commands", function() {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('alter service filters', function() {
|
||||||
|
return verifyCommand('alter service-filters Read-Connection-Router', 'services/Read-Connection-Router')
|
||||||
|
.then(function(res) {
|
||||||
|
res.data.relationships.should.not.have.keys("filters")
|
||||||
|
})
|
||||||
|
.then(() => verifyCommand('alter service-filters Read-Connection-Router QLA', 'services/Read-Connection-Router'))
|
||||||
|
.then(function(res) {
|
||||||
|
res.data.relationships.filters.data.length.should.equal(1)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
it('will not alter non-existent service parameter', function() {
|
it('will not alter non-existent service parameter', function() {
|
||||||
return doCommand('alter service Read-Connection-Router turbocharge yes-please')
|
return doCommand('alter service Read-Connection-Router turbocharge yes-please')
|
||||||
.should.be.rejected
|
.should.be.rejected
|
||||||
|
|||||||
@ -198,6 +198,31 @@ describe("Create/Destroy Commands", function() {
|
|||||||
.should.be.fulfilled
|
.should.be.fulfilled
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('destroy service with server relationships', function() {
|
||||||
|
return doCommand('destroy service test-service')
|
||||||
|
.should.be.rejected
|
||||||
|
.then(() => doCommand('unlink service test-service test-server'))
|
||||||
|
.then(() => doCommand('destroy service test-service'))
|
||||||
|
.should.be.fulfilled
|
||||||
|
})
|
||||||
|
|
||||||
|
it('create service with filter relationship', function() {
|
||||||
|
return doCommand('create filter test-filter-1 qlafilter filebase=/tmp/qla')
|
||||||
|
.then(() => verifyCommand('create service test-service-2 readwritesplit user=maxuser password=maxpwd --filters test-filter-1',
|
||||||
|
'services/test-service-2'))
|
||||||
|
.then((res) => {
|
||||||
|
res.data.relationships.filters.data.length.should.equal(1)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
it('destroy service with filter relationships', function() {
|
||||||
|
return doCommand('destroy service test-service-2')
|
||||||
|
.should.be.rejected
|
||||||
|
.then(() => doCommand('alter service-filters test-service-2'))
|
||||||
|
.then(() => doCommand('destroy service test-service-2'))
|
||||||
|
.should.be.fulfilled
|
||||||
|
})
|
||||||
|
|
||||||
it('create filter with bad parameters', function() {
|
it('create filter with bad parameters', function() {
|
||||||
return doCommand('create filter test-filter qlafilter filebase-not-required')
|
return doCommand('create filter test-filter qlafilter filebase-not-required')
|
||||||
.should.be.rejected
|
.should.be.rejected
|
||||||
|
|||||||
@ -18,6 +18,7 @@ var tests = [
|
|||||||
'show modules',
|
'show modules',
|
||||||
'show maxscale',
|
'show maxscale',
|
||||||
'show logging',
|
'show logging',
|
||||||
|
'show threads',
|
||||||
'show server server1',
|
'show server server1',
|
||||||
'show service RW-Split-Router',
|
'show service RW-Split-Router',
|
||||||
'show monitor MariaDB-Monitor',
|
'show monitor MariaDB-Monitor',
|
||||||
|
|||||||
Reference in New Issue
Block a user