Add forced maintenance mode tests

Tested that the force option works and is accepted.
This commit is contained in:
Markus Mäkelä
2019-04-09 10:00:50 +03:00
parent 0932d10169
commit 9a5b60a071
2 changed files with 26 additions and 0 deletions

View File

@ -22,6 +22,20 @@ describe("Set/Clear Commands", function() {
})
})
it('force maintenance mode', function() {
return verifyCommand('set server server1 maintenance --force', 'servers/server1')
.then(function(res) {
res.data.attributes.state.should.match(/Maintenance/)
})
})
it('clear maintenance mode', function() {
return verifyCommand('clear server server1 maintenance', 'servers/server1')
.then(function(res) {
res.data.attributes.state.should.not.match(/Maintenance/)
})
})
it('reject set incorrect state', function() {
return doCommand('set server server2 something')
.should.be.rejected