Files
MaxScale/maxctrl/test/diagnostics.js
Markus Mäkelä e76dc80e47 MXS-1300: Reorganize and refactor tests
The tests are now sorted by command type. This allows for more consistent
test creation as tests can be done per source code file instead of per
object type.

Added helper functions for common testing operations. The two main ones
are doCommand, which executes a MaxCtrl command and returns a result, and
verifyCommand, that executes a command and verifies the result via the
REST API.
2017-07-23 08:21:00 +03:00

37 lines
772 B
JavaScript

require('../test_utils.js')()
var ctrl = require('../lib/core.js')
var opts = { extra_args: [ '--quiet'] }
var tests = [
'list servers',
'list services',
'list listeners RW-Split-Router',
'list monitors',
'list sessions',
'list filters',
'list modules',
'list users',
'list commands',
'show server server1',
'show service RW-Split-Router',
'show monitor MySQL-Monitor',
'show session 5',
'show filter Hint',
'show module readwritesplit',
'show maxscale',
]
describe("Diagnostic commands", function() {
before(startMaxScale)
tests.forEach(function(i) {
it(i, function() {
return doCommand(i)
.should.be.fulfilled
});
})
after(stopMaxScale)
});