func TestInitTopo3MSbSl(t *testing.T) { log.SetLevel(log.DebugLevel) users := users() dataNode := datanode() mgmPost := structs.MgmPost{ DbaasType: consts.Type_M_SB_SL, Users: users, DataNode: dataNode, } swarm, err := swarm.TestSwarm() if err != nil { t.Fatal(err) } topology, err, steps := InitTopo(mgmPost, swarm) if err != nil { t.Fatal(err) } fmt.Println(steps) btopology, _ := json.MarshalIndent(topology, "", " ") fmt.Println(string(btopology)) }
func TestIsolate1(t *testing.T) { swarm, err := swarm.TestSwarm() if err != nil { t.Fatal(err) } rwMutex := new(sync.RWMutex) isolate_test(swarm, rwMutex, consts.Type_M, consts.Master, t) }
func TestIsolate3Sl(t *testing.T) { swarm, err := swarm.TestSwarm() if err != nil { t.Fatal(err) } rwMutex := new(sync.RWMutex) isolate_test(swarm, rwMutex, consts.Type_M_SB_SL, consts.Slave, t) }
func TestIsolate2Sb(t *testing.T) { swarm, err := swarm.TestSwarm() if err != nil { t.Fatal(err) } rwMutex := new(sync.RWMutex) isolate_test(swarm, rwMutex, consts.Type_M_SB, consts.StandBy, t) }
func TestRecover1(t *testing.T) { swarm, err := swarm.TestSwarm() if err != nil { t.Fatal(err) } rwMutex := new(sync.RWMutex) topology := isolate_test(swarm, rwMutex, consts.Type_M, consts.Master, t) recover_test(swarm, rwMutex, topology, t) }
func TestRecover3Sl(t *testing.T) { log.SetLevel(log.DebugLevel) swarm, err := swarm.TestSwarm() if err != nil { t.Fatal(err) } rwMutex := new(sync.RWMutex) topology := isolate_test(swarm, rwMutex, consts.Type_M_SB_SL, consts.Slave, t) recover_test(swarm, rwMutex, topology, t) }
func TestResetDb(t *testing.T) { swarm, err := swarm.TestSwarm() if err != nil { t.Fatal(err) } dataNode := datanode() for k, _ := range dataNode { err := resetDb(k, swarm) if err != nil { t.Fatal(err) } } }
func TestChangeMaster34100(t *testing.T) { swarm, err := swarm.TestSwarm() if err != nil { t.Fatal(err) } mDbInfo := &structs.DatabaseInfo{ Ip: "146.240.104.24", Port: 34100, } err = changeMaster(swarm, "03bd33a3f818", mDbInfo.Ip, mDbInfo.Port) if err != nil { t.Fatal(err) } }