MXS-1929: Update unit tests with monitor changes
The user is a mandatory parameter and needs to be passed when a monitor is created.
This commit is contained in:
@ -179,7 +179,7 @@ describe('Cluster Sync', function() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('sync after monitor creation', function() {
|
it('sync after monitor creation', function() {
|
||||||
return doCommand('create monitor my-monitor-2 mysqlmon --hosts ' + secondary_host)
|
return doCommand('create monitor my-monitor-2 mysqlmon user=maxuser password=maxpwd --hosts ' + secondary_host)
|
||||||
.then(() => verifyCommand('cluster sync ' + secondary_host + ' --hosts ' + primary_host,
|
.then(() => verifyCommand('cluster sync ' + secondary_host + ' --hosts ' + primary_host,
|
||||||
'monitors/my-monitor-2'))
|
'monitors/my-monitor-2'))
|
||||||
})
|
})
|
||||||
|
@ -7,7 +7,7 @@ describe("Create/Destroy Commands", function() {
|
|||||||
before(startMaxScale)
|
before(startMaxScale)
|
||||||
|
|
||||||
it('create monitor', function() {
|
it('create monitor', function() {
|
||||||
return verifyCommand('create monitor my-monitor mysqlmon', 'monitors/my-monitor')
|
return verifyCommand('create monitor my-monitor mysqlmon user=maxuser password=maxpwd', 'monitors/my-monitor')
|
||||||
.should.be.fulfilled
|
.should.be.fulfilled
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -1,16 +1,21 @@
|
|||||||
require("../utils.js")()
|
require("../utils.js")()
|
||||||
|
|
||||||
var monitor = {
|
describe("Monitor", function() {
|
||||||
data: {
|
|
||||||
id: "test-monitor",
|
var monitor = {
|
||||||
type: "monitors",
|
data: {
|
||||||
attributes: {
|
id: "test-monitor",
|
||||||
module: "mysqlmon"
|
type: "monitors",
|
||||||
|
attributes: {
|
||||||
|
module: "mysqlmon",
|
||||||
|
parameters: {
|
||||||
|
user: "maxuser",
|
||||||
|
password: "maxpwd"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
describe("Monitor", function() {
|
|
||||||
before(startMaxScale)
|
before(startMaxScale)
|
||||||
|
|
||||||
it("create new monitor", function() {
|
it("create new monitor", function() {
|
||||||
@ -42,6 +47,20 @@ describe("Monitor", function() {
|
|||||||
describe("Monitor Relationships", function() {
|
describe("Monitor Relationships", function() {
|
||||||
before(startMaxScale)
|
before(startMaxScale)
|
||||||
|
|
||||||
|
var monitor = {
|
||||||
|
data: {
|
||||||
|
id: "test-monitor",
|
||||||
|
type: "monitors",
|
||||||
|
attributes: {
|
||||||
|
module: "mysqlmon",
|
||||||
|
parameters: {
|
||||||
|
user: "maxuser",
|
||||||
|
password: "maxpwd"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
it("create new monitor", function() {
|
it("create new monitor", function() {
|
||||||
return request.post(base_url + "/monitors/", {json: monitor})
|
return request.post(base_url + "/monitors/", {json: monitor})
|
||||||
.should.be.fulfilled
|
.should.be.fulfilled
|
||||||
|
Reference in New Issue
Block a user