diff --git a/maxctrl/test/diagnostics.js b/maxctrl/test/diagnostics.js index 1ca3ae672..58a7f88c1 100644 --- a/maxctrl/test/diagnostics.js +++ b/maxctrl/test/diagnostics.js @@ -24,7 +24,7 @@ var tests = [ 'show server server1', 'show service RW-Split-Router', 'show monitor MariaDB-Monitor', - 'show session 5', + 'show sessions', 'show filter Hint', 'show module readwritesplit', 'show maxscale', diff --git a/server/core/test/rest-api/package.json b/server/core/test/rest-api/package.json index 633c0e5f5..57e50d498 100644 --- a/server/core/test/rest-api/package.json +++ b/server/core/test/rest-api/package.json @@ -12,6 +12,7 @@ "ajv": "^5.5.2", "chai": "^3.5.0", "chai-as-promised": "^6.0.0", + "mariadb": "^2.0.1-beta", "mocha": "^5.2.0", "request": "^2.87.0", "request-promise-native": "^1.0.5" diff --git a/server/core/test/rest-api/test/schema_validation.js b/server/core/test/rest-api/test/schema_validation.js index 968ded380..772f7f03d 100644 --- a/server/core/test/rest-api/test/schema_validation.js +++ b/server/core/test/rest-api/test/schema_validation.js @@ -1,6 +1,20 @@ // These tests use the server/test/maxscale_test.cnf configuration require("../utils.js")() +const mariadb = require('mariadb'); +var conn + +function createConnection() { + return mariadb.createConnection({host: '127.0.0.1', port: 4006, user: 'maxuser', password: 'maxpwd'}) + .then(c => { + conn = c + }) +} + +function closeConnection() { + conn.end() + conn = null +} describe("Resource Collections", function() { before(startMaxScale) @@ -36,6 +50,7 @@ describe("Resource Collections", function() { describe("Individual Resources", function() { before(startMaxScale) + before(createConnection) var tests = [ "/servers/server1", @@ -63,11 +78,13 @@ describe("Individual Resources", function() { }); }) + after(closeConnection) after(stopMaxScale) }); describe("Resource Self Links", function() { before(startMaxScale) + before(createConnection) var tests = [ "/servers", @@ -108,5 +125,6 @@ describe("Resource Self Links", function() { }); }) + after(closeConnection) after(stopMaxScale) });