代码拉取完成,页面将自动刷新
// replication-manager - Replication Manager Monitoring and CLI for MariaDB
// Authors: Guillaume Lefranc <[email protected]>
// Stephane Varoqui <[email protected]>
// This source code is licensed under the GNU General Public License, version 3.
// Redistribution/Reuse of this code is permitted under the GNU v3 license, as
// an additional term, ALL code must carry the original Author(s) credit in comment form.
// See LICENSE in this directory for the integral text.
package main
import "testing"
var Tservers serverList
func TestMain(m *testing.M) {
Tservers = make(serverList, 3)
Tservers[0] = &ServerMonitor{URL: "192.168.0.0", MasterServerID: 1}
Tservers[1] = &ServerMonitor{URL: "192.168.0.1", MasterServerID: 1}
Tservers[2] = &ServerMonitor{URL: "192.168.0.2", MasterServerID: 1}
m.Run()
}
func TestHasSiblings(t *testing.T) {
if !Tservers[0].hasSiblings(Tservers) {
t.Fatal("Returned false, expected true")
}
}
func TestCheckAllSlavesRunning(t *testing.T) {
Tservers[0].IOThread = "Yes"
Tservers[0].SQLThread = "Yes"
Tservers[1].IOThread = "Yes"
Tservers[1].SQLThread = "Yes"
Tservers[2].IOThread = "Yes"
Tservers[2].SQLThread = "Yes"
if !Tservers.checkAllSlavesRunning() {
t.Fatal("Returned false, expected true")
}
Tservers[0].IOThread = "No"
if Tservers.checkAllSlavesRunning() {
t.Fatal("Returned true, expected false")
}
}
func TestDelete(t *testing.T) {
Tservers[1].delete(&Tservers)
if len(Tservers) != 2 {
t.Fatalf("List length was %d, expected 2", len(servers))
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。