diff --git a/maxctrl/lib/list.js b/maxctrl/lib/list.js index ed234150f..0e727e10b 100644 --- a/maxctrl/lib/list.js +++ b/maxctrl/lib/list.js @@ -71,15 +71,6 @@ exports.builder = function(yargs) { .then(() => filterResource(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) { diff --git a/maxctrl/test/alter.js b/maxctrl/test/alter.js index 2114c11e8..a25c03e1f 100644 --- a/maxctrl/test/alter.js +++ b/maxctrl/test/alter.js @@ -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() { return doCommand('alter service Read-Connection-Router turbocharge yes-please') .should.be.rejected diff --git a/maxctrl/test/createdestroy.js b/maxctrl/test/createdestroy.js index 3b7acbaef..de2d6ea62 100644 --- a/maxctrl/test/createdestroy.js +++ b/maxctrl/test/createdestroy.js @@ -198,6 +198,31 @@ describe("Create/Destroy Commands", function() { .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() { return doCommand('create filter test-filter qlafilter filebase-not-required') .should.be.rejected diff --git a/maxctrl/test/diagnostics.js b/maxctrl/test/diagnostics.js index 74f021b97..dc3acacae 100644 --- a/maxctrl/test/diagnostics.js +++ b/maxctrl/test/diagnostics.js @@ -18,6 +18,7 @@ var tests = [ 'show modules', 'show maxscale', 'show logging', + 'show threads', 'show server server1', 'show service RW-Split-Router', 'show monitor MariaDB-Monitor',