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

@ -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) {