MaxScale/maxctrl/test/startstop.js
Markus Mäkelä ccebf38bc0 Update test configuration files
Updated the REST API and MaxCtrl configuration files with new object
names. Updated tests with new object names.
2018-01-22 15:29:21 +02:00

54 lines
1.7 KiB
JavaScript

require('../test_utils.js')()
describe('Start/Stop Commands', function() {
before(startMaxScale)
it('stop service', function() {
return verifyCommand('stop service Read-Connection-Router', 'services/Read-Connection-Router')
.then(function(res) {
res.data.attributes.state.should.equal('Stopped')
})
})
it('start service', function() {
return verifyCommand('start service Read-Connection-Router', 'services/Read-Connection-Router')
.then(function(res) {
res.data.attributes.state.should.equal('Started')
})
})
it('stop monitor', function() {
return verifyCommand('stop monitor MariaDB-Monitor', 'monitors/MariaDB-Monitor')
.then(function(res) {
res.data.attributes.state.should.equal('Stopped')
})
})
it('start monitor', function() {
return verifyCommand('start monitor MariaDB-Monitor', 'monitors/MariaDB-Monitor')
.then(function(res) {
res.data.attributes.state.should.equal('Running')
})
})
it('stop maxscale', function() {
return verifyCommand('stop maxscale', 'services')
.then(function(res) {
res.data.forEach((i) => {
i.attributes.state.should.equal('Stopped')
})
})
})
it('start maxscale', function() {
return verifyCommand('start maxscale', 'services')
.then(function(res) {
res.data.forEach((i) => {
i.attributes.state.should.equal('Started')
})
})
})
after(stopMaxScale)
});