Add forced maintenance mode tests
Tested that the force option works and is accepted.
This commit is contained in:
parent
0932d10169
commit
9a5b60a071
@ -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
|
||||
|
@ -156,6 +156,18 @@ describe("Server State", function() {
|
||||
})
|
||||
});
|
||||
|
||||
it("force server into maintenance", function() {
|
||||
return request.put(base_url + "/servers/" + server.data.id + "/set?state=maintenance&force=yes")
|
||||
.then(function(resp) {
|
||||
return request.get(base_url + "/servers/" + server.data.id)
|
||||
})
|
||||
.then(function(resp) {
|
||||
var srv = JSON.parse(resp)
|
||||
srv.data.attributes.state.should.match(/Maintenance/)
|
||||
srv.data.attributes.statistics.connections.should.be.equal(0)
|
||||
})
|
||||
});
|
||||
|
||||
it("clear maintenance", function() {
|
||||
return request.put(base_url + "/servers/" + server.data.id + "/clear?state=maintenance")
|
||||
.then(function(resp) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user