mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
SMGeneric API changes to include verb in get APIs - ActiveSessions -> GetActiveSessions, PassiveSessions -> GetPassiveSessions, MaxDuration -> GetMaxDuration, LCRSupplier -> GetLCRSuppliers
This commit is contained in:
@@ -33,8 +33,8 @@ type SMGenericBiRpcV1 struct {
|
||||
// Publishes methods exported by SMGenericBiRpcV1 as SMGenericV1 (so we can handle standard RPC methods via birpc socket)
|
||||
func (self *SMGenericBiRpcV1) Handlers() map[string]interface{} {
|
||||
return map[string]interface{}{
|
||||
"SMGenericV1.MaxUsage": self.MaxUsage,
|
||||
"SMGenericV1.LCRSuppliers": self.LCRSuppliers,
|
||||
"SMGenericV1.GetMaxUsage": self.GetMaxUsage,
|
||||
"SMGenericV1.GetLCRSuppliers": self.GetLCRSuppliers,
|
||||
"SMGenericV1.InitiateSession": self.InitiateSession,
|
||||
"SMGenericV1.UpdateSession": self.UpdateSession,
|
||||
"SMGenericV1.TerminateSession": self.TerminateSession,
|
||||
@@ -43,13 +43,13 @@ func (self *SMGenericBiRpcV1) Handlers() map[string]interface{} {
|
||||
}
|
||||
|
||||
/// Returns MaxUsage (for calls in seconds), -1 for no limit
|
||||
func (self *SMGenericBiRpcV1) MaxUsage(clnt *rpc2.Client, ev sessionmanager.SMGenericEvent, maxUsage *float64) error {
|
||||
return self.sm.BiRPCV1MaxUsage(clnt, ev, maxUsage)
|
||||
func (self *SMGenericBiRpcV1) GetMaxUsage(clnt *rpc2.Client, ev sessionmanager.SMGenericEvent, maxUsage *float64) error {
|
||||
return self.sm.BiRPCV1GetMaxUsage(clnt, ev, maxUsage)
|
||||
}
|
||||
|
||||
/// Returns list of suppliers which can be used for the request
|
||||
func (self *SMGenericBiRpcV1) LCRSuppliers(clnt *rpc2.Client, ev sessionmanager.SMGenericEvent, suppliers *[]string) error {
|
||||
return self.sm.BiRPCV1LCRSuppliers(clnt, ev, suppliers)
|
||||
func (self *SMGenericBiRpcV1) GetLCRSuppliers(clnt *rpc2.Client, ev sessionmanager.SMGenericEvent, suppliers *[]string) error {
|
||||
return self.sm.BiRPCV1GetLCRSuppliers(clnt, ev, suppliers)
|
||||
}
|
||||
|
||||
// Called on session start, returns the maximum number of seconds the session can last
|
||||
@@ -77,20 +77,20 @@ func (self *SMGenericBiRpcV1) ProcessCDR(clnt *rpc2.Client, ev sessionmanager.SM
|
||||
return self.sm.BiRPCV1ProcessCDR(clnt, ev, reply)
|
||||
}
|
||||
|
||||
func (self *SMGenericBiRpcV1) ActiveSessions(clnt *rpc2.Client, attrs map[string]string, reply *[]*sessionmanager.ActiveSession) error {
|
||||
return self.sm.BiRPCV1ActiveSessions(clnt, attrs, reply)
|
||||
func (self *SMGenericBiRpcV1) GetActiveSessions(clnt *rpc2.Client, attrs map[string]string, reply *[]*sessionmanager.ActiveSession) error {
|
||||
return self.sm.BiRPCV1GetActiveSessions(clnt, attrs, reply)
|
||||
}
|
||||
|
||||
func (self *SMGenericBiRpcV1) ActiveSessionsCount(clnt *rpc2.Client, attrs map[string]string, reply *int) error {
|
||||
return self.sm.BiRPCV1ActiveSessionsCount(clnt, attrs, reply)
|
||||
func (self *SMGenericBiRpcV1) GetActiveSessionsCount(clnt *rpc2.Client, attrs map[string]string, reply *int) error {
|
||||
return self.sm.BiRPCV1GetActiveSessionsCount(clnt, attrs, reply)
|
||||
}
|
||||
|
||||
func (self *SMGenericBiRpcV1) ṔassiveSessions(clnt *rpc2.Client, attrs map[string]string, reply *[]*sessionmanager.ActiveSession) error {
|
||||
return self.sm.BiRPCV1ActiveSessions(clnt, attrs, reply)
|
||||
func (self *SMGenericBiRpcV1) GetṔassiveSessions(clnt *rpc2.Client, attrs map[string]string, reply *[]*sessionmanager.ActiveSession) error {
|
||||
return self.sm.BiRPCV1GetActiveSessions(clnt, attrs, reply)
|
||||
}
|
||||
|
||||
func (self *SMGenericBiRpcV1) PassiveSessionsCount(clnt *rpc2.Client, attrs map[string]string, reply *int) error {
|
||||
return self.sm.BiRPCV1ActiveSessionsCount(clnt, attrs, reply)
|
||||
func (self *SMGenericBiRpcV1) GetPassiveSessionsCount(clnt *rpc2.Client, attrs map[string]string, reply *int) error {
|
||||
return self.sm.BiRPCV1GetPassiveSessionsCount(clnt, attrs, reply)
|
||||
}
|
||||
|
||||
func (self *SMGenericBiRpcV1) ReplicateActiveSessions(clnt *rpc2.Client, args sessionmanager.ArgsReplicateActiveSessions, reply *string) error {
|
||||
|
||||
@@ -36,13 +36,13 @@ type SMGenericV1 struct {
|
||||
}
|
||||
|
||||
// Returns MaxUsage (for calls in seconds), -1 for no limit
|
||||
func (self *SMGenericV1) MaxUsage(ev sessionmanager.SMGenericEvent, maxUsage *float64) error {
|
||||
return self.sm.BiRPCV1MaxUsage(nil, ev, maxUsage)
|
||||
func (self *SMGenericV1) GetMaxUsage(ev sessionmanager.SMGenericEvent, maxUsage *float64) error {
|
||||
return self.sm.BiRPCV1GetMaxUsage(nil, ev, maxUsage)
|
||||
}
|
||||
|
||||
// Returns list of suppliers which can be used for the request
|
||||
func (self *SMGenericV1) LCRSuppliers(ev sessionmanager.SMGenericEvent, suppliers *[]string) error {
|
||||
return self.sm.BiRPCV1LCRSuppliers(nil, ev, suppliers)
|
||||
func (self *SMGenericV1) GetLCRSuppliers(ev sessionmanager.SMGenericEvent, suppliers *[]string) error {
|
||||
return self.sm.BiRPCV1GetLCRSuppliers(nil, ev, suppliers)
|
||||
}
|
||||
|
||||
// Called on session start, returns the maximum number of seconds the session can last
|
||||
@@ -70,20 +70,20 @@ func (self *SMGenericV1) ProcessCDR(ev sessionmanager.SMGenericEvent, reply *str
|
||||
return self.sm.BiRPCV1ProcessCDR(nil, ev, reply)
|
||||
}
|
||||
|
||||
func (self *SMGenericV1) ActiveSessions(attrs map[string]string, reply *[]*sessionmanager.ActiveSession) error {
|
||||
return self.sm.BiRPCV1ActiveSessions(nil, attrs, reply)
|
||||
func (self *SMGenericV1) GetActiveSessions(attrs map[string]string, reply *[]*sessionmanager.ActiveSession) error {
|
||||
return self.sm.BiRPCV1GetActiveSessions(nil, attrs, reply)
|
||||
}
|
||||
|
||||
func (self *SMGenericV1) ActiveSessionsCount(attrs map[string]string, reply *int) error {
|
||||
return self.sm.BiRPCV1ActiveSessionsCount(nil, attrs, reply)
|
||||
func (self *SMGenericV1) GetActiveSessionsCount(attrs map[string]string, reply *int) error {
|
||||
return self.sm.BiRPCV1GetActiveSessionsCount(nil, attrs, reply)
|
||||
}
|
||||
|
||||
func (self *SMGenericV1) PassiveSessions(attrs map[string]string, reply *[]*sessionmanager.ActiveSession) error {
|
||||
return self.sm.BiRPCV1PassiveSessions(nil, attrs, reply)
|
||||
func (self *SMGenericV1) GetPassiveSessions(attrs map[string]string, reply *[]*sessionmanager.ActiveSession) error {
|
||||
return self.sm.BiRPCV1GetPassiveSessions(nil, attrs, reply)
|
||||
}
|
||||
|
||||
func (self *SMGenericV1) PassiveSessionsCount(attrs map[string]string, reply *int) error {
|
||||
return self.sm.BiRPCV1PassiveSessionsCount(nil, attrs, reply)
|
||||
func (self *SMGenericV1) GetPassiveSessionsCount(attrs map[string]string, reply *int) error {
|
||||
return self.sm.BiRPCV1GetPassiveSessionsCount(nil, attrs, reply)
|
||||
}
|
||||
|
||||
func (self *SMGenericV1) SetPassiveSessions(args sessionmanager.ArgsSetPassiveSessions, reply *string) error {
|
||||
|
||||
@@ -128,10 +128,10 @@ func TestSMGV1GetMaxUsage(t *testing.T) {
|
||||
setupReq := &sessionmanager.SMGenericEvent{utils.REQTYPE: utils.META_PREPAID, utils.TENANT: "cgrates.org",
|
||||
utils.ACCOUNT: "1003", utils.DESTINATION: "1002", utils.SETUP_TIME: "2015-11-10T15:20:00Z"}
|
||||
var maxTime float64
|
||||
if err := smgV1Rpc.Call("SMGenericV1.MaxUsage", setupReq, &maxTime); err != nil {
|
||||
if err := smgV1Rpc.Call("SMGenericV1.GetMaxUsage", setupReq, &maxTime); err != nil {
|
||||
t.Error(err)
|
||||
} else if maxTime != 2700 {
|
||||
t.Errorf("Calling ApierV1.MaxUsage got maxTime: %f", maxTime)
|
||||
t.Errorf("Calling ApierV1.GetMaxUsage got maxTime: %f", maxTime)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@ func TestRPCITLclStatusFirstFailback(t *testing.T) {
|
||||
// Make sure it executes on the first node supporting the command
|
||||
func TestRPCITLclTDirectedRPC(t *testing.T) {
|
||||
var sessions []*sessionmanager.ActiveSession
|
||||
if err := rpcPoolFirst.Call("SMGenericV1.ActiveSessions", map[string]string{}, &sessions); err == nil || err.Error() != utils.ErrNotFound.Error() {
|
||||
if err := rpcPoolFirst.Call("SMGenericV1.GetActiveSessions", map[string]string{}, &sessions); err == nil || err.Error() != utils.ErrNotFound.Error() {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@ func TestSMGDataLastUsedMultipleData(t *testing.T) {
|
||||
t.Errorf("Expected: %f, received: %f", eAcntVal, acnt.BalanceMap[utils.DATA].GetTotalValue())
|
||||
}
|
||||
aSessions := make([]*ActiveSession, 0)
|
||||
if err := smgRPC.Call("SMGenericV1.ActiveSessions", nil, &aSessions); err != nil {
|
||||
if err := smgRPC.Call("SMGenericV1.GetActiveSessions", nil, &aSessions); err != nil {
|
||||
t.Error(err)
|
||||
} else if len(aSessions) != 1 || aSessions[0].Usage.Seconds() != 1048576 {
|
||||
t.Errorf("wrong active sessions: %f", aSessions[0].Usage.Seconds())
|
||||
@@ -244,7 +244,7 @@ func TestSMGDataLastUsedMultipleData(t *testing.T) {
|
||||
} else if acnt.BalanceMap[utils.DATA].GetTotalValue() != eAcntVal {
|
||||
t.Errorf("Expected: %f, received: %f", eAcntVal, acnt.BalanceMap[utils.DATA].GetTotalValue())
|
||||
}
|
||||
if err := smgRPC.Call("SMGenericV1.ActiveSessions", nil, &aSessions); err != nil {
|
||||
if err := smgRPC.Call("SMGenericV1.GetActiveSessions", nil, &aSessions); err != nil {
|
||||
t.Error(err)
|
||||
} else if len(aSessions) != 1 || aSessions[0].Usage.Seconds() != 1068576 {
|
||||
t.Errorf("wrong active sessions: %f", aSessions[0].Usage.Seconds())
|
||||
@@ -275,7 +275,7 @@ func TestSMGDataLastUsedMultipleData(t *testing.T) {
|
||||
} else if acnt.BalanceMap[utils.DATA].GetTotalValue() != eAcntVal {
|
||||
t.Errorf("Expected: %f, received: %f", eAcntVal, acnt.BalanceMap[utils.DATA].GetTotalValue())
|
||||
}
|
||||
if err := smgRPC.Call("SMGenericV1.ActiveSessions", nil, &aSessions); err != nil {
|
||||
if err := smgRPC.Call("SMGenericV1.GetActiveSessions", nil, &aSessions); err != nil {
|
||||
t.Error(err)
|
||||
} else if len(aSessions) != 1 || aSessions[0].Usage.Seconds() != 1088576 {
|
||||
t.Errorf("wrong active sessions: %f", aSessions[0].Usage.Seconds())
|
||||
@@ -306,7 +306,7 @@ func TestSMGDataLastUsedMultipleData(t *testing.T) {
|
||||
} else if acnt.BalanceMap[utils.DATA].GetTotalValue() != eAcntVal {
|
||||
t.Errorf("Expected: %f, received: %f", eAcntVal, acnt.BalanceMap[utils.DATA].GetTotalValue())
|
||||
}
|
||||
if err := smgRPC.Call("SMGenericV1.ActiveSessions", nil, &aSessions); err != nil {
|
||||
if err := smgRPC.Call("SMGenericV1.GetActiveSessions", nil, &aSessions); err != nil {
|
||||
t.Error(err)
|
||||
} else if len(aSessions) != 1 || aSessions[0].Usage.Seconds() != 1108576 {
|
||||
t.Errorf("wrong active sessions: %f", aSessions[0].Usage.Seconds())
|
||||
@@ -337,7 +337,7 @@ func TestSMGDataLastUsedMultipleData(t *testing.T) {
|
||||
} else if acnt.BalanceMap[utils.DATA].GetTotalValue() != eAcntVal {
|
||||
t.Errorf("Expected: %f, received: %f", eAcntVal, acnt.BalanceMap[utils.DATA].GetTotalValue())
|
||||
}
|
||||
if err := smgRPC.Call("SMGenericV1.ActiveSessions", nil, &aSessions); err != nil {
|
||||
if err := smgRPC.Call("SMGenericV1.GetActiveSessions", nil, &aSessions); err != nil {
|
||||
t.Error(err)
|
||||
} else if len(aSessions) != 1 || aSessions[0].Usage.Seconds() != 1128576 {
|
||||
t.Errorf("wrong active sessions: %f", aSessions[0].Usage.Seconds())
|
||||
@@ -365,7 +365,7 @@ func TestSMGDataLastUsedMultipleData(t *testing.T) {
|
||||
} else if acnt.BalanceMap[utils.DATA].GetTotalValue() != eAcntVal {
|
||||
t.Errorf("Expected: %f, received: %f", eAcntVal, acnt.BalanceMap[utils.DATA].GetTotalValue())
|
||||
}
|
||||
if err := smgRPC.Call("SMGenericV1.ActiveSessions", nil, &aSessions); err == nil || err.Error() != utils.ErrNotFound.Error() {
|
||||
if err := smgRPC.Call("SMGenericV1.GetActiveSessions", nil, &aSessions); err == nil || err.Error() != utils.ErrNotFound.Error() {
|
||||
t.Error(err, aSessions)
|
||||
}
|
||||
}
|
||||
@@ -495,7 +495,7 @@ func TestSMGDataTTLExpiredMultiUpdates(t *testing.T) {
|
||||
t.Errorf("Expected: %f, received: %f", eAcntVal, acnt.BalanceMap[utils.DATA].GetTotalValue())
|
||||
}
|
||||
aSessions := make([]*ActiveSession, 0)
|
||||
if err := smgRPC.Call("SMGenericV1.ActiveSessions", nil, &aSessions); err != nil {
|
||||
if err := smgRPC.Call("SMGenericV1.GetActiveSessions", nil, &aSessions); err != nil {
|
||||
t.Error(err)
|
||||
} else if len(aSessions) != 1 || aSessions[0].Usage.Seconds() != 1048576 {
|
||||
t.Errorf("wrong active sessions: %f", aSessions[0].Usage.Seconds())
|
||||
@@ -535,7 +535,7 @@ func TestSMGDataTTLExpiredMultiUpdates(t *testing.T) {
|
||||
} else if acnt.BalanceMap[utils.DATA].GetTotalValue() != eAcntVal {
|
||||
t.Errorf("Expected: %f, received: %f", eAcntVal, acnt.BalanceMap[utils.DATA].GetTotalValue())
|
||||
}
|
||||
if err := smgRPC.Call("SMGenericV1.ActiveSessions", nil, &aSessions); err == nil || err.Error() != utils.ErrNotFound.Error() {
|
||||
if err := smgRPC.Call("SMGenericV1.GetActiveSessions", nil, &aSessions); err == nil || err.Error() != utils.ErrNotFound.Error() {
|
||||
t.Error(err, aSessions)
|
||||
}
|
||||
}
|
||||
@@ -578,7 +578,7 @@ func TestSMGDataMultipleDataNoUsage(t *testing.T) {
|
||||
t.Errorf("Expected: %f, received: %f", eAcntVal, acnt.BalanceMap[utils.DATA].GetTotalValue())
|
||||
}
|
||||
aSessions := make([]*ActiveSession, 0)
|
||||
if err := smgRPC.Call("SMGenericV1.ActiveSessions", nil, &aSessions); err != nil {
|
||||
if err := smgRPC.Call("SMGenericV1.GetActiveSessions", nil, &aSessions); err != nil {
|
||||
t.Error(err)
|
||||
} else if len(aSessions) != 1 || aSessions[0].Usage.Seconds() != 1048576 {
|
||||
t.Errorf("wrong active sessions: %f", aSessions[0].Usage.Seconds())
|
||||
@@ -609,7 +609,7 @@ func TestSMGDataMultipleDataNoUsage(t *testing.T) {
|
||||
} else if acnt.BalanceMap[utils.DATA].GetTotalValue() != eAcntVal {
|
||||
t.Errorf("Expected: %f, received: %f", eAcntVal, acnt.BalanceMap[utils.DATA].GetTotalValue())
|
||||
}
|
||||
if err := smgRPC.Call("SMGenericV1.ActiveSessions", nil, &aSessions); err != nil {
|
||||
if err := smgRPC.Call("SMGenericV1.GetActiveSessions", nil, &aSessions); err != nil {
|
||||
t.Error(err)
|
||||
} else if len(aSessions) != 1 || aSessions[0].Usage.Seconds() != 1048576 {
|
||||
t.Errorf("wrong active sessions: %f", aSessions[0].Usage.Seconds())
|
||||
@@ -640,7 +640,7 @@ func TestSMGDataMultipleDataNoUsage(t *testing.T) {
|
||||
} else if acnt.BalanceMap[utils.DATA].GetTotalValue() != eAcntVal {
|
||||
t.Errorf("Expected: %f, received: %f", eAcntVal, acnt.BalanceMap[utils.DATA].GetTotalValue())
|
||||
}
|
||||
if err := smgRPC.Call("SMGenericV1.ActiveSessions", nil, &aSessions); err != nil {
|
||||
if err := smgRPC.Call("SMGenericV1.GetActiveSessions", nil, &aSessions); err != nil {
|
||||
t.Error(err)
|
||||
} else if len(aSessions) != 1 || aSessions[0].Usage.Seconds() != 1048576 {
|
||||
t.Errorf("wrong active sessions: %f", aSessions[0].Usage.Seconds())
|
||||
@@ -671,7 +671,7 @@ func TestSMGDataMultipleDataNoUsage(t *testing.T) {
|
||||
} else if acnt.BalanceMap[utils.DATA].GetTotalValue() != eAcntVal {
|
||||
t.Errorf("Expected: %f, received: %f", eAcntVal, acnt.BalanceMap[utils.DATA].GetTotalValue())
|
||||
}
|
||||
if err := smgRPC.Call("SMGenericV1.ActiveSessions", nil, &aSessions); err != nil {
|
||||
if err := smgRPC.Call("SMGenericV1.GetActiveSessions", nil, &aSessions); err != nil {
|
||||
t.Error(err)
|
||||
} else if len(aSessions) != 1 || aSessions[0].Usage.Seconds() != 1048576 {
|
||||
t.Errorf("wrong active sessions: %f", aSessions[0].Usage.Seconds())
|
||||
@@ -702,7 +702,7 @@ func TestSMGDataMultipleDataNoUsage(t *testing.T) {
|
||||
} else if acnt.BalanceMap[utils.DATA].GetTotalValue() != eAcntVal {
|
||||
t.Errorf("Expected: %f, received: %f", eAcntVal, acnt.BalanceMap[utils.DATA].GetTotalValue())
|
||||
}
|
||||
if err := smgRPC.Call("SMGenericV1.ActiveSessions", nil, &aSessions); err != nil {
|
||||
if err := smgRPC.Call("SMGenericV1.GetActiveSessions", nil, &aSessions); err != nil {
|
||||
t.Error(err)
|
||||
} else if len(aSessions) != 1 || aSessions[0].Usage.Seconds() != 1048576 {
|
||||
t.Errorf("wrong active sessions: %f", aSessions[0].Usage.Seconds())
|
||||
@@ -730,7 +730,7 @@ func TestSMGDataMultipleDataNoUsage(t *testing.T) {
|
||||
} else if acnt.BalanceMap[utils.DATA].GetTotalValue() != eAcntVal {
|
||||
t.Errorf("Expected: %f, received: %f", eAcntVal, acnt.BalanceMap[utils.DATA].GetTotalValue())
|
||||
}
|
||||
if err := smgRPC.Call("SMGenericV1.ActiveSessions", nil, &aSessions); err == nil || err.Error() != utils.ErrNotFound.Error() {
|
||||
if err := smgRPC.Call("SMGenericV1.GetActiveSessions", nil, &aSessions); err == nil || err.Error() != utils.ErrNotFound.Error() {
|
||||
t.Error(err, aSessions)
|
||||
}
|
||||
}
|
||||
@@ -773,7 +773,7 @@ func TestSMGDataMultipleDataConstantUsage(t *testing.T) {
|
||||
t.Errorf("Expected: %f, received: %f", eAcntVal, acnt.BalanceMap[utils.DATA].GetTotalValue())
|
||||
}
|
||||
aSessions := make([]*ActiveSession, 0)
|
||||
if err := smgRPC.Call("SMGenericV1.ActiveSessions", nil, &aSessions); err != nil {
|
||||
if err := smgRPC.Call("SMGenericV1.GetActiveSessions", nil, &aSessions); err != nil {
|
||||
t.Error(err)
|
||||
} else if len(aSessions) != 1 || aSessions[0].Usage.Seconds() != 1048576 {
|
||||
t.Errorf("wrong active sessions: %f", aSessions[0].Usage.Seconds())
|
||||
@@ -805,7 +805,7 @@ func TestSMGDataMultipleDataConstantUsage(t *testing.T) {
|
||||
} else if acnt.BalanceMap[utils.DATA].GetTotalValue() != eAcntVal {
|
||||
t.Errorf("Expected: %f, received: %f", eAcntVal, acnt.BalanceMap[utils.DATA].GetTotalValue())
|
||||
}
|
||||
if err := smgRPC.Call("SMGenericV1.ActiveSessions", nil, &aSessions); err != nil {
|
||||
if err := smgRPC.Call("SMGenericV1.GetActiveSessions", nil, &aSessions); err != nil {
|
||||
t.Error(err)
|
||||
} else if len(aSessions) != 1 || aSessions[0].Usage.Seconds() != 1049176 {
|
||||
t.Errorf("wrong active sessions: %f", aSessions[0].Usage.Seconds())
|
||||
@@ -836,7 +836,7 @@ func TestSMGDataMultipleDataConstantUsage(t *testing.T) {
|
||||
} else if acnt.BalanceMap[utils.DATA].GetTotalValue() != eAcntVal {
|
||||
t.Errorf("Expected: %f, received: %f", eAcntVal, acnt.BalanceMap[utils.DATA].GetTotalValue())
|
||||
}
|
||||
if err := smgRPC.Call("SMGenericV1.ActiveSessions", nil, &aSessions); err != nil {
|
||||
if err := smgRPC.Call("SMGenericV1.GetActiveSessions", nil, &aSessions); err != nil {
|
||||
t.Error(err)
|
||||
} else if len(aSessions) != 1 || aSessions[0].Usage.Seconds() != 1049776 {
|
||||
t.Errorf("wrong active sessions: %f", aSessions[0].Usage.Seconds())
|
||||
@@ -867,7 +867,7 @@ func TestSMGDataMultipleDataConstantUsage(t *testing.T) {
|
||||
} else if acnt.BalanceMap[utils.DATA].GetTotalValue() != eAcntVal {
|
||||
t.Errorf("Expected: %f, received: %f", eAcntVal, acnt.BalanceMap[utils.DATA].GetTotalValue())
|
||||
}
|
||||
if err := smgRPC.Call("SMGenericV1.ActiveSessions", nil, &aSessions); err != nil {
|
||||
if err := smgRPC.Call("SMGenericV1.GetActiveSessions", nil, &aSessions); err != nil {
|
||||
t.Error(err)
|
||||
} else if len(aSessions) != 1 || aSessions[0].Usage.Seconds() != 1050376 {
|
||||
t.Errorf("wrong active sessions: %f", aSessions[0].Usage.Seconds())
|
||||
@@ -898,7 +898,7 @@ func TestSMGDataMultipleDataConstantUsage(t *testing.T) {
|
||||
} else if acnt.BalanceMap[utils.DATA].GetTotalValue() != eAcntVal {
|
||||
t.Errorf("Expected: %f, received: %f", eAcntVal, acnt.BalanceMap[utils.DATA].GetTotalValue())
|
||||
}
|
||||
if err := smgRPC.Call("SMGenericV1.ActiveSessions", nil, &aSessions); err != nil {
|
||||
if err := smgRPC.Call("SMGenericV1.GetActiveSessions", nil, &aSessions); err != nil {
|
||||
t.Error(err)
|
||||
} else if len(aSessions) != 1 || aSessions[0].Usage.Seconds() != 1050976 {
|
||||
t.Errorf("wrong active sessions: %f", aSessions[0].Usage.Seconds())
|
||||
@@ -926,7 +926,7 @@ func TestSMGDataMultipleDataConstantUsage(t *testing.T) {
|
||||
} else if acnt.BalanceMap[utils.DATA].GetTotalValue() != eAcntVal {
|
||||
t.Errorf("Expected: %f, received: %f", eAcntVal, acnt.BalanceMap[utils.DATA].GetTotalValue())
|
||||
}
|
||||
if err := smgRPC.Call("SMGenericV1.ActiveSessions", nil, &aSessions); err == nil || err.Error() != utils.ErrNotFound.Error() {
|
||||
if err := smgRPC.Call("SMGenericV1.GetActiveSessions", nil, &aSessions); err == nil || err.Error() != utils.ErrNotFound.Error() {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ func (sma *SMAsterisk) handleStasisStart(ev *SMAsteriskEvent) {
|
||||
// Query the SMG via RPC for maxUsage
|
||||
var maxUsage float64
|
||||
smgEv := ev.AsSMGenericEvent()
|
||||
if err := sma.smg.Call("SMGenericV1.MaxUsage", *smgEv, &maxUsage); err != nil {
|
||||
if err := sma.smg.Call("SMGenericV1.GetMaxUsage", *smgEv, &maxUsage); err != nil {
|
||||
utils.Logger.Err(fmt.Sprintf("<SMAsterisk> Error: %s when attempting to authorize session for channelID: %s", err.Error(), ev.ChannelID()))
|
||||
if err := sma.hangupChannel(ev.ChannelID()); err != nil {
|
||||
utils.Logger.Err(fmt.Sprintf("<SMAsterisk> Error: %s when attempting to disconnect channelID: %s", err.Error(), ev.ChannelID()))
|
||||
|
||||
@@ -601,7 +601,7 @@ func TestSMGVoiceSessionTTL(t *testing.T) {
|
||||
t.Error("Bad max usage: ", maxUsage)
|
||||
}
|
||||
var aSessions []*ActiveSession
|
||||
if err := smgRPC.Call("SMGenericV1.ActiveSessions", map[string]string{utils.MEDI_RUNID: utils.META_DEFAULT, utils.ACCID: "12360"}, &aSessions); err != nil {
|
||||
if err := smgRPC.Call("SMGenericV1.GetActiveSessions", map[string]string{utils.MEDI_RUNID: utils.META_DEFAULT, utils.ACCID: "12360"}, &aSessions); err != nil {
|
||||
t.Error(err)
|
||||
} else if len(aSessions) != 1 {
|
||||
t.Errorf("Unexpected number of sessions received: %+v", aSessions)
|
||||
@@ -635,7 +635,7 @@ func TestSMGVoiceSessionTTL(t *testing.T) {
|
||||
if maxUsage != 120 {
|
||||
t.Error("Bad max usage: ", maxUsage)
|
||||
}
|
||||
if err := smgRPC.Call("SMGenericV1.ActiveSessions", map[string]string{utils.MEDI_RUNID: utils.META_DEFAULT, utils.ACCID: "12360"}, &aSessions); err != nil {
|
||||
if err := smgRPC.Call("SMGenericV1.GetActiveSessions", map[string]string{utils.MEDI_RUNID: utils.META_DEFAULT, utils.ACCID: "12360"}, &aSessions); err != nil {
|
||||
t.Error(err)
|
||||
} else if len(aSessions) != 1 {
|
||||
t.Errorf("Unexpected number of sessions received: %+v", aSessions)
|
||||
@@ -712,7 +712,7 @@ func TestSMGVoiceSessionTTLWithRelocate(t *testing.T) {
|
||||
t.Error("Bad max usage: ", maxUsage)
|
||||
}
|
||||
var aSessions []*ActiveSession
|
||||
if err := smgRPC.Call("SMGenericV1.ActiveSessions", map[string]string{utils.MEDI_RUNID: utils.META_DEFAULT,
|
||||
if err := smgRPC.Call("SMGenericV1.GetActiveSessions", map[string]string{utils.MEDI_RUNID: utils.META_DEFAULT,
|
||||
utils.ACCID: smgEv.GetOriginID(utils.META_DEFAULT)}, &aSessions); err != nil {
|
||||
t.Error(err)
|
||||
} else if len(aSessions) != 1 {
|
||||
@@ -748,7 +748,7 @@ func TestSMGVoiceSessionTTLWithRelocate(t *testing.T) {
|
||||
t.Error("Bad max usage: ", maxUsage)
|
||||
}
|
||||
time.Sleep(time.Duration(20) * time.Millisecond)
|
||||
if err := smgRPC.Call("SMGenericV1.ActiveSessions", map[string]string{utils.MEDI_RUNID: utils.META_DEFAULT,
|
||||
if err := smgRPC.Call("SMGenericV1.GetActiveSessions", map[string]string{utils.MEDI_RUNID: utils.META_DEFAULT,
|
||||
utils.ACCID: smgEv.GetOriginID(utils.META_DEFAULT)}, &aSessions); err != nil {
|
||||
t.Error(err)
|
||||
} else if len(aSessions) != 1 {
|
||||
@@ -770,7 +770,7 @@ func TestSMGVoiceSessionTTLWithRelocate(t *testing.T) {
|
||||
} else if acnt.BalanceMap[utils.VOICE].GetTotalValue() != eAcntVal {
|
||||
t.Errorf("Expecting: %f, received: %f", eAcntVal, acnt.BalanceMap[utils.VOICE].GetTotalValue())
|
||||
}
|
||||
if err := smgRPC.Call("SMGenericV1.ActiveSessions", map[string]string{utils.MEDI_RUNID: utils.META_DEFAULT,
|
||||
if err := smgRPC.Call("SMGenericV1.GetActiveSessions", map[string]string{utils.MEDI_RUNID: utils.META_DEFAULT,
|
||||
utils.ACCID: smgEv.GetOriginID(utils.META_DEFAULT)}, &aSessions); err == nil || err.Error() != utils.ErrNotFound.Error() {
|
||||
t.Error(err, aSessions)
|
||||
}
|
||||
@@ -830,7 +830,7 @@ func TestSMGVoiceRelocateWithOriginIDPrefix(t *testing.T) {
|
||||
t.Error("Bad max usage: ", maxUsage)
|
||||
}
|
||||
var aSessions []*ActiveSession
|
||||
if err := smgRPC.Call("SMGenericV1.ActiveSessions", map[string]string{utils.MEDI_RUNID: utils.META_DEFAULT,
|
||||
if err := smgRPC.Call("SMGenericV1.GetActiveSessions", map[string]string{utils.MEDI_RUNID: utils.META_DEFAULT,
|
||||
utils.ACCID: smgEv.GetOriginID(utils.META_DEFAULT)}, &aSessions); err != nil {
|
||||
t.Error(err)
|
||||
} else if len(aSessions) != 1 {
|
||||
@@ -866,7 +866,7 @@ func TestSMGVoiceRelocateWithOriginIDPrefix(t *testing.T) {
|
||||
t.Error("Bad max usage: ", maxUsage)
|
||||
}
|
||||
time.Sleep(time.Duration(20) * time.Millisecond)
|
||||
if err := smgRPC.Call("SMGenericV1.ActiveSessions", map[string]string{utils.MEDI_RUNID: utils.META_DEFAULT,
|
||||
if err := smgRPC.Call("SMGenericV1.GetActiveSessions", map[string]string{utils.MEDI_RUNID: utils.META_DEFAULT,
|
||||
utils.ACCID: "12372-1"}, &aSessions); err != nil {
|
||||
t.Error(err)
|
||||
} else if len(aSessions) != 1 {
|
||||
@@ -898,7 +898,7 @@ func TestSMGVoiceRelocateWithOriginIDPrefix(t *testing.T) {
|
||||
t.Error(err)
|
||||
}
|
||||
time.Sleep(time.Duration(10) * time.Millisecond)
|
||||
if err := smgRPC.Call("SMGenericV1.ActiveSessions", map[string]string{utils.MEDI_RUNID: utils.META_DEFAULT,
|
||||
if err := smgRPC.Call("SMGenericV1.GetActiveSessions", map[string]string{utils.MEDI_RUNID: utils.META_DEFAULT,
|
||||
utils.ACCID: "12372-1"}, &aSessions); err == nil || err.Error() != utils.ErrNotFound.Error() {
|
||||
t.Error(err, aSessions)
|
||||
}
|
||||
|
||||
@@ -620,7 +620,7 @@ func (smg *SMGeneric) asActiveSessions(fltrs map[string]string, count, passiveSe
|
||||
// Methods to apply on sessions, mostly exported through RPC/Bi-RPC
|
||||
|
||||
// MaxUsage calculates maximum usage allowed for given gevent
|
||||
func (smg *SMGeneric) MaxUsage(gev SMGenericEvent) (maxUsage time.Duration, err error) {
|
||||
func (smg *SMGeneric) GetMaxUsage(gev SMGenericEvent) (maxUsage time.Duration, err error) {
|
||||
cacheKey := "MaxUsage" + gev.GetCGRID(utils.META_DEFAULT)
|
||||
if item, err := smg.responseCache.Get(cacheKey); err == nil && item != nil {
|
||||
return (item.Value.(time.Duration)), item.Err
|
||||
@@ -636,7 +636,7 @@ func (smg *SMGeneric) MaxUsage(gev SMGenericEvent) (maxUsage time.Duration, err
|
||||
return
|
||||
}
|
||||
|
||||
func (smg *SMGeneric) LCRSuppliers(gev SMGenericEvent) (suppls []string, err error) {
|
||||
func (smg *SMGeneric) GetLCRSuppliers(gev SMGenericEvent) (suppls []string, err error) {
|
||||
cacheKey := "LCRSuppliers" + gev.GetCGRID(utils.META_DEFAULT) + gev.GetAccount(utils.META_DEFAULT) + gev.GetDestination(utils.META_DEFAULT)
|
||||
if item, err := smg.responseCache.Get(cacheKey); err == nil && item != nil {
|
||||
if item.Value != nil {
|
||||
@@ -987,8 +987,8 @@ func (smg *SMGeneric) CallBiRPC(clnt rpcclient.RpcClientConnection, serviceMetho
|
||||
return err
|
||||
}
|
||||
|
||||
func (smg *SMGeneric) BiRPCV1MaxUsage(clnt rpcclient.RpcClientConnection, ev SMGenericEvent, maxUsage *float64) error {
|
||||
maxUsageDur, err := smg.MaxUsage(ev)
|
||||
func (smg *SMGeneric) BiRPCV1GetMaxUsage(clnt rpcclient.RpcClientConnection, ev SMGenericEvent, maxUsage *float64) error {
|
||||
maxUsageDur, err := smg.GetMaxUsage(ev)
|
||||
if err != nil {
|
||||
return utils.NewErrServerError(err)
|
||||
}
|
||||
@@ -1001,8 +1001,8 @@ func (smg *SMGeneric) BiRPCV1MaxUsage(clnt rpcclient.RpcClientConnection, ev SMG
|
||||
}
|
||||
|
||||
/// Returns list of suppliers which can be used for the request
|
||||
func (smg *SMGeneric) BiRPCV1LCRSuppliers(clnt rpcclient.RpcClientConnection, ev SMGenericEvent, suppliers *[]string) error {
|
||||
if supls, err := smg.LCRSuppliers(ev); err != nil {
|
||||
func (smg *SMGeneric) BiRPCV1GetLCRSuppliers(clnt rpcclient.RpcClientConnection, ev SMGenericEvent, suppliers *[]string) error {
|
||||
if supls, err := smg.GetLCRSuppliers(ev); err != nil {
|
||||
return utils.NewErrServerError(err)
|
||||
} else {
|
||||
*suppliers = supls
|
||||
@@ -1064,7 +1064,7 @@ func (smg *SMGeneric) BiRPCV1ProcessCDR(clnt rpcclient.RpcClientConnection, ev S
|
||||
return nil
|
||||
}
|
||||
|
||||
func (smg *SMGeneric) BiRPCV1ActiveSessions(clnt rpcclient.RpcClientConnection, fltr map[string]string, reply *[]*ActiveSession) error {
|
||||
func (smg *SMGeneric) BiRPCV1GetActiveSessions(clnt rpcclient.RpcClientConnection, fltr map[string]string, reply *[]*ActiveSession) error {
|
||||
for fldName, fldVal := range fltr {
|
||||
if fldVal == "" {
|
||||
fltr[fldName] = utils.META_NONE
|
||||
@@ -1080,7 +1080,7 @@ func (smg *SMGeneric) BiRPCV1ActiveSessions(clnt rpcclient.RpcClientConnection,
|
||||
return nil
|
||||
}
|
||||
|
||||
func (smg *SMGeneric) BiRPCV1ActiveSessionsCount(clnt rpcclient.RpcClientConnection, fltr map[string]string, reply *int) error {
|
||||
func (smg *SMGeneric) BiRPCV1GetActiveSessionsCount(clnt rpcclient.RpcClientConnection, fltr map[string]string, reply *int) error {
|
||||
for fldName, fldVal := range fltr {
|
||||
if fldVal == "" {
|
||||
fltr[fldName] = utils.META_NONE
|
||||
@@ -1094,7 +1094,7 @@ func (smg *SMGeneric) BiRPCV1ActiveSessionsCount(clnt rpcclient.RpcClientConnect
|
||||
return nil
|
||||
}
|
||||
|
||||
func (smg *SMGeneric) BiRPCV1PassiveSessions(clnt rpcclient.RpcClientConnection, fltr map[string]string, reply *[]*ActiveSession) error {
|
||||
func (smg *SMGeneric) BiRPCV1GetPassiveSessions(clnt rpcclient.RpcClientConnection, fltr map[string]string, reply *[]*ActiveSession) error {
|
||||
for fldName, fldVal := range fltr {
|
||||
if fldVal == "" {
|
||||
fltr[fldName] = utils.META_NONE
|
||||
@@ -1110,7 +1110,7 @@ func (smg *SMGeneric) BiRPCV1PassiveSessions(clnt rpcclient.RpcClientConnection,
|
||||
return nil
|
||||
}
|
||||
|
||||
func (smg *SMGeneric) BiRPCV1PassiveSessionsCount(clnt rpcclient.RpcClientConnection, fltr map[string]string, reply *int) error {
|
||||
func (smg *SMGeneric) BiRPCV1GetPassiveSessionsCount(clnt rpcclient.RpcClientConnection, fltr map[string]string, reply *int) error {
|
||||
for fldName, fldVal := range fltr {
|
||||
if fldVal == "" {
|
||||
fltr[fldName] = utils.META_NONE
|
||||
|
||||
@@ -92,7 +92,7 @@ func TestSMGRplcTPFromFolder(t *testing.T) {
|
||||
|
||||
func TestSMGRplcInitiate(t *testing.T) {
|
||||
var pSessions []*ActiveSession
|
||||
if err := smgRplcSlvRPC.Call("SMGenericV1.PassiveSessions", nil, &pSessions); err == nil || err.Error() != utils.ErrNotFound.Error() {
|
||||
if err := smgRplcSlvRPC.Call("SMGenericV1.GetPassiveSessions", nil, &pSessions); err == nil || err.Error() != utils.ErrNotFound.Error() {
|
||||
t.Error(err)
|
||||
}
|
||||
smgEv := SMGenericEvent{
|
||||
@@ -126,14 +126,14 @@ func TestSMGRplcInitiate(t *testing.T) {
|
||||
}
|
||||
time.Sleep(time.Duration(*waitRater) * time.Millisecond) // Wait for the sessions to be populated
|
||||
var aSessions []*ActiveSession
|
||||
if err := smgRplcMstrRPC.Call("SMGenericV1.ActiveSessions", map[string]string{utils.ACCID: "123451"}, &aSessions); err != nil {
|
||||
if err := smgRplcMstrRPC.Call("SMGenericV1.GetActiveSessions", map[string]string{utils.ACCID: "123451"}, &aSessions); err != nil {
|
||||
t.Error(err)
|
||||
} else if len(aSessions) != 1 {
|
||||
t.Errorf("Unexpected number of sessions received: %+v", aSessions)
|
||||
} else if aSessions[0].Usage != time.Duration(90)*time.Second {
|
||||
t.Errorf("Received usage: %v", aSessions[0].Usage)
|
||||
}
|
||||
if err := smgRplcSlvRPC.Call("SMGenericV1.PassiveSessions", map[string]string{utils.ACCID: "123451"}, &pSessions); err != nil {
|
||||
if err := smgRplcSlvRPC.Call("SMGenericV1.GetPassiveSessions", map[string]string{utils.ACCID: "123451"}, &pSessions); err != nil {
|
||||
t.Error(err)
|
||||
} else if len(pSessions) != 1 {
|
||||
t.Errorf("PassiveSessions: %+v", pSessions)
|
||||
@@ -157,7 +157,7 @@ func TestSMGRplcUpdate(t *testing.T) {
|
||||
}
|
||||
time.Sleep(time.Duration(*waitRater) * time.Millisecond) // Wait for the sessions to be populated
|
||||
var aSessions []*ActiveSession
|
||||
if err := smgRplcSlvRPC.Call("SMGenericV1.ActiveSessions", map[string]string{utils.ACCID: "123451"}, &aSessions); err != nil {
|
||||
if err := smgRplcSlvRPC.Call("SMGenericV1.GetActiveSessions", map[string]string{utils.ACCID: "123451"}, &aSessions); err != nil {
|
||||
t.Error(err)
|
||||
} else if len(aSessions) != 1 {
|
||||
t.Errorf("Unexpected number of sessions received: %+v", aSessions)
|
||||
@@ -166,16 +166,16 @@ func TestSMGRplcUpdate(t *testing.T) {
|
||||
}
|
||||
var pSessions []*ActiveSession
|
||||
// Make sure we don't have passive session on active host
|
||||
if err := smgRplcSlvRPC.Call("SMGenericV1.PassiveSessions", nil, &pSessions); err == nil || err.Error() != utils.ErrNotFound.Error() {
|
||||
if err := smgRplcSlvRPC.Call("SMGenericV1.GetPassiveSessions", nil, &pSessions); err == nil || err.Error() != utils.ErrNotFound.Error() {
|
||||
t.Error(err)
|
||||
}
|
||||
// Master should not longer have activeSession
|
||||
if err := smgRplcMstrRPC.Call("SMGenericV1.ActiveSessions", map[string]string{utils.ACCID: "123451"}, &aSessions); err == nil || err.Error() != utils.ErrNotFound.Error() {
|
||||
if err := smgRplcMstrRPC.Call("SMGenericV1.GetActiveSessions", map[string]string{utils.ACCID: "123451"}, &aSessions); err == nil || err.Error() != utils.ErrNotFound.Error() {
|
||||
t.Error(err)
|
||||
}
|
||||
cgrID := smgEv.GetCGRID(utils.META_DEFAULT)
|
||||
// Make sure session was replicated
|
||||
if err := smgRplcMstrRPC.Call("SMGenericV1.PassiveSessions", nil, &pSessions); err != nil {
|
||||
if err := smgRplcMstrRPC.Call("SMGenericV1.GetPassiveSessions", nil, &pSessions); err != nil {
|
||||
t.Error(err)
|
||||
} else if len(pSessions) != 1 {
|
||||
t.Errorf("PassiveSessions: %+v", pSessions)
|
||||
@@ -199,17 +199,17 @@ func TestSMGRplcTerminate(t *testing.T) {
|
||||
}
|
||||
time.Sleep(time.Duration(*waitRater) * time.Millisecond) // Wait for the sessions to be populated
|
||||
var aSessions []*ActiveSession
|
||||
if err := smgRplcMstrRPC.Call("SMGenericV1.ActiveSessions", map[string]string{utils.ACCID: "123451"}, &aSessions); err == nil || err.Error() != utils.ErrNotFound.Error() {
|
||||
if err := smgRplcMstrRPC.Call("SMGenericV1.GetActiveSessions", map[string]string{utils.ACCID: "123451"}, &aSessions); err == nil || err.Error() != utils.ErrNotFound.Error() {
|
||||
t.Error(err, aSessions)
|
||||
}
|
||||
if err := smgRplcSlvRPC.Call("SMGenericV1.ActiveSessions", map[string]string{utils.ACCID: "123451"}, &aSessions); err == nil || err.Error() != utils.ErrNotFound.Error() {
|
||||
if err := smgRplcSlvRPC.Call("SMGenericV1.GetActiveSessions", map[string]string{utils.ACCID: "123451"}, &aSessions); err == nil || err.Error() != utils.ErrNotFound.Error() {
|
||||
t.Error(err, aSessions)
|
||||
}
|
||||
var pSessions map[string][]*SMGSession
|
||||
if err := smgRplcMstrRPC.Call("SMGenericV1.PassiveSessions", nil, &pSessions); err == nil || err.Error() != utils.ErrNotFound.Error() {
|
||||
if err := smgRplcMstrRPC.Call("SMGenericV1.GetPassiveSessions", nil, &pSessions); err == nil || err.Error() != utils.ErrNotFound.Error() {
|
||||
t.Error(err)
|
||||
}
|
||||
if err := smgRplcSlvRPC.Call("SMGenericV1.PassiveSessions", nil, &pSessions); err == nil || err.Error() != utils.ErrNotFound.Error() {
|
||||
if err := smgRplcSlvRPC.Call("SMGenericV1.GetPassiveSessions", nil, &pSessions); err == nil || err.Error() != utils.ErrNotFound.Error() {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
@@ -262,7 +262,7 @@ func TestSMGRplcManualReplicate(t *testing.T) {
|
||||
}
|
||||
time.Sleep(time.Duration(*waitRater) * time.Millisecond) // Wait for the sessions to be populated
|
||||
var aSessions []*ActiveSession
|
||||
if err := smgRplcMstrRPC.Call("SMGenericV1.ActiveSessions", nil, &aSessions); err != nil {
|
||||
if err := smgRplcMstrRPC.Call("SMGenericV1.GetActiveSessions", nil, &aSessions); err != nil {
|
||||
t.Error(err)
|
||||
} else if len(aSessions) != 2 {
|
||||
t.Errorf("Unexpected number of sessions received: %+v", aSessions)
|
||||
@@ -277,7 +277,7 @@ func TestSMGRplcManualReplicate(t *testing.T) {
|
||||
if smgRplcSlvRPC, err = jsonrpc.Dial("tcp", smgRplcSlaveCfg.RPCJSONListen); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := smgRplcSlvRPC.Call("SMGenericV1.PassiveSessions", nil, &aSessions); err == nil || err.Error() != utils.ErrNotFound.Error() {
|
||||
if err := smgRplcSlvRPC.Call("SMGenericV1.GetPassiveSessions", nil, &aSessions); err == nil || err.Error() != utils.ErrNotFound.Error() {
|
||||
t.Error(err, aSessions)
|
||||
}
|
||||
argsRepl := ArgsReplicateActiveSessions{Connections: []*config.HaPoolConfig{
|
||||
@@ -291,7 +291,7 @@ func TestSMGRplcManualReplicate(t *testing.T) {
|
||||
t.Error(err)
|
||||
}
|
||||
time.Sleep(time.Duration(*waitRater) * time.Millisecond) // Wait for the sessions to be populated
|
||||
if err := smgRplcSlvRPC.Call("SMGenericV1.PassiveSessions", nil, &aSessions); err != nil {
|
||||
if err := smgRplcSlvRPC.Call("SMGenericV1.GetPassiveSessions", nil, &aSessions); err != nil {
|
||||
t.Error(err)
|
||||
} else if len(aSessions) != 2 {
|
||||
t.Errorf("Unexpected number of sessions received: %+v", aSessions)
|
||||
|
||||
Reference in New Issue
Block a user