Skip to content

Commit

Permalink
Updated gocs_it_test for debiting account of au_site only by replication
Browse files Browse the repository at this point in the history
  • Loading branch information
gezimbll authored and danbogos committed Nov 13, 2023
1 parent df7ab84 commit 42892ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 20 deletions.
4 changes: 2 additions & 2 deletions data/tariffplans/gocs/dsp_site/DispatcherProfiles.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Tenant,ID,Subsystems,FilterIDs,ActivationInterval,Strategy,StrategyParameters,ConnID,ConnFilterIDs,ConnWeight,ConnBlocker,ConnParameters,Weight
cgrates.org,BROADCAST,*sessions,,,*broadcast_sync,,AU_SITE,,20,false,,30
cgrates.org,BROADCAST,,,,,,US_SITE,,20,,,
cgrates.org,BROADCAST,*sessions,,,*broadcast_sync,,US_SITE,,20,false,,30
#cgrates.org,BROADCAST,,,,,,US_SITE,,20,,,
cgrates.org,SELF,*any,,,*weight,,SELF,,20,false,,10
21 changes: 3 additions & 18 deletions general_tests/gocs_it_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,17 +284,6 @@ func testGOCSInitSession(t *testing.T) {
time.Sleep(10 * time.Millisecond)

aSessions := make([]*sessions.ExternalSession, 0)
if err := auRPC.Call(context.Background(), utils.SessionSv1GetActiveSessions, new(utils.SessionFilter), &aSessions); err != nil {
t.Error(err)
} else if len(aSessions) != 1 {
t.Errorf("wrong active sessions: %s \n , and len(aSessions) %+v", utils.ToJSON(aSessions), len(aSessions))
} else if aSessions[0].NodeID != "AU_SITE" {
t.Errorf("Expecting : %+v, received: %+v", "AU_SITE", aSessions[0].NodeID)
} else if aSessions[0].Usage != 5*time.Minute {
t.Errorf("Expecting : %+v, received: %+v", 5*time.Minute, aSessions[0].MaxCostSoFar)
}

aSessions = make([]*sessions.ExternalSession, 0)
if err := usRPC.Call(context.Background(), utils.SessionSv1GetActiveSessions, new(utils.SessionFilter), &aSessions); err != nil {
t.Error(err)
} else if len(aSessions) != 1 {
Expand Down Expand Up @@ -363,7 +352,7 @@ func testGOCSUpdateSession(t *testing.T) {
t.Errorf("wrong active sessions: %s", utils.ToJSON(aSessions))
} else if aSessions[0].NodeID != "AU_SITE" {
t.Errorf("Expecting : %+v, received: %+v", "AU_SITE", aSessions[0].NodeID)
} else if aSessions[0].Usage != 10*time.Minute {
} else if aSessions[0].Usage != 5*time.Minute {
t.Errorf("Expecting : %+v, received: %+v", 5*time.Minute, aSessions[0].Usage)
}

Expand Down Expand Up @@ -441,8 +430,8 @@ func testGOCSUpdateSession2(t *testing.T) {
t.Errorf("wrong active sessions: %s", utils.ToJSON(aSessions))
} else if aSessions[0].NodeID != "AU_SITE" {
t.Errorf("Expecting : %+v, received: %+v", "AU_SITE", aSessions[0].NodeID)
} else if aSessions[0].Usage != 15*time.Minute {
t.Errorf("Expecting : %+v, received: %+v", 15*time.Minute, aSessions[0].Usage)
} else if aSessions[0].Usage != 5*time.Minute {
t.Errorf("Expecting : %+v, received: %+v", 5*time.Minute, aSessions[0].Usage)
}

aSessions = make([]*sessions.ExternalSession, 0)
Expand Down Expand Up @@ -507,10 +496,6 @@ func testGOCSTerminateSession(t *testing.T) {
t.Errorf("Unexpected reply: %s", rply)
}
aSessions := make([]*sessions.ExternalSession, 0)
if err := auRPC.Call(context.Background(), utils.SessionSv1GetActiveSessions, new(utils.SessionFilter), &aSessions); err == nil ||
err.Error() != utils.ErrNotFound.Error() {
t.Errorf("Expected error %s received error %v and reply %s", utils.ErrNotFound, err, utils.ToJSON(aSessions))
}
if err := usRPC.Call(context.Background(), utils.SessionSv1GetActiveSessions, new(utils.SessionFilter), &aSessions); err == nil ||
err.Error() != utils.ErrNotFound.Error() {
t.Errorf("Expected error %s received error %v and reply %s", utils.ErrNotFound, err, utils.ToJSON(aSessions))
Expand Down

0 comments on commit 42892ef

Please sign in to comment.