From 5de91e737dbb1cfbf64dba0000f72fcaee0b1851 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Tue, 24 Jul 2018 08:10:58 +0300 Subject: [PATCH] MXS-1929: Extend create/destroy MaxCtrl tests Added creation and destruction tests for services and filters. They don't cover the assignment of filters to services as that is not yet implemented. --- maxctrl/test/createdestroy.js | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/maxctrl/test/createdestroy.js b/maxctrl/test/createdestroy.js index b2f3bcde2..412326449 100644 --- a/maxctrl/test/createdestroy.js +++ b/maxctrl/test/createdestroy.js @@ -165,5 +165,38 @@ describe("Create/Destroy Commands", function() { .should.be.rejected }) + it('create service', function() { + return verifyCommand('create service test-service readwritesplit user=maxuser password=maxpwd', + 'services/test-service') + .should.be.fulfilled + }) + + it('destroy service', function() { + return doCommand('destroy service test-service') + .should.be.fulfilled + }) + + it('create service with server relationship', function() { + return doCommand('create server test-server 127.0.0.1 3306') + .then(() => verifyCommand('create service test-service readwritesplit user=maxuser password=maxpwd --servers test-server', + 'services/test-service')) + .then(() => request.get(host + 'services/test-service', {json: true})) + .then((res) => { + console.log(res) + return true + }) + }) + + it('create filter', function() { + return verifyCommand('create filter test-filter qlafilter filebase=/tmp/qla.log', + 'filters/test-filter') + .should.be.fulfilled + }) + + it('destroy filter', function() { + return doCommand('destroy filter test-filter') + .should.be.fulfilled + }) + after(stopMaxScale) });