Merge branch '2.3' into develop

This commit is contained in:
Markus Mäkelä
2019-04-12 13:23:49 +03:00
31 changed files with 625 additions and 243 deletions

27
maxctrl/test/classify.js Normal file
View File

@ -0,0 +1,27 @@
require('../test_utils.js')()
describe("Classify Commands", function() {
before(startMaxScale)
it('classifies query', function() {
return doCommand('--tsv classify SELECT\t1')
.should.eventually.match(/QC_QUERY_PARSED/)
})
it('classifies query with function', function() {
return doCommand('--tsv classify SELECT\tspecial_function("hello",5)')
.should.eventually.match(/special_function/)
})
it('classifies invalid query', function() {
return doCommand('--tsv classify This-should-fail')
.should.eventually.match(/QC_QUERY_INVALID/)
})
it('rejects no query', function() {
return doCommand('classify')
.should.be.rejected
})
after(stopMaxScale)
});

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