MaxScale/maxctrl/test/enabledisable.js
Markus Mäkelä d2b474e021 Fix enabled admin users being shown as basic users
The enabled admins for the Linux users were shown as basic users. This was
caused by the separation of the two admin types.

Added tests that check that enabled Linux accounts show the correct type
in the output.
2017-09-11 12:49:11 +03:00

52 lines
1.6 KiB
JavaScript

require('../test_utils.js')()
describe("Enable/Disable Commands", function() {
before(startMaxScale)
it('enable log-priority', function() {
return verifyCommand('enable log-priority info', 'maxscale/logs')
.then(function(res) {
res.data.attributes.log_priorities.should.include('info')
})
})
it('disable log-priority', function() {
return verifyCommand('disable log-priority info', 'maxscale/logs')
.then(function(res) {
res.data.attributes.log_priorities.should.not.include('info')
})
})
it('will not enable log-priority with bad parameter', function() {
return doCommand('enable log-priority bad-stuff')
.should.be.rejected
})
it('will not disable log-priority with bad parameter', function() {
return doCommand('disable log-priority bad-stuff')
.should.be.rejected
})
it('enable account', function() {
return verifyCommand('enable account test', 'users/unix/test')
.should.eventually.have.deep.property('data.attributes.account', 'basic')
})
it('disable account', function() {
return doCommand('disable account test')
.should.be.fulfilled
})
it('enable admin account', function() {
return verifyCommand('enable account test --type=admin', 'users/unix/test')
.should.eventually.have.deep.property('data.attributes.account', 'admin')
})
it('disable admin account', function() {
return doCommand('disable account test')
.should.be.fulfilled
})
after(stopMaxScale)
});