From 42892eff01f599860b0188b37d601eda4d4ed64b Mon Sep 17 00:00:00 2001 From: gezimbll Date: Thu, 9 Nov 2023 05:27:26 -0500 Subject: [PATCH] Updated gocs_it_test for debiting account of au_site only by replication --- .../gocs/dsp_site/DispatcherProfiles.csv | 4 ++-- general_tests/gocs_it_test.go | 21 +++---------------- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/data/tariffplans/gocs/dsp_site/DispatcherProfiles.csv b/data/tariffplans/gocs/dsp_site/DispatcherProfiles.csv index 5dc084040..99e66959e 100644 --- a/data/tariffplans/gocs/dsp_site/DispatcherProfiles.csv +++ b/data/tariffplans/gocs/dsp_site/DispatcherProfiles.csv @@ -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 \ No newline at end of file diff --git a/general_tests/gocs_it_test.go b/general_tests/gocs_it_test.go index eff37da39..6ebe02e31 100644 --- a/general_tests/gocs_it_test.go +++ b/general_tests/gocs_it_test.go @@ -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 { @@ -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) } @@ -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) @@ -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))