mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-15 21:29:52 +05:00
Added cache dispatcher test
This commit is contained in:
committed by
Dan Christian Bogos
parent
a447590aab
commit
299c659e13
@@ -31,6 +31,7 @@ import (
|
||||
"github.com/cgrates/cgrates/config"
|
||||
"github.com/cgrates/cgrates/engine"
|
||||
"github.com/cgrates/cgrates/utils"
|
||||
"github.com/cgrates/ltcache"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -52,11 +53,13 @@ var sTestsDispatcher = []func(t *testing.T){
|
||||
testDispatcherSSetDispatcherProfile,
|
||||
testDispatcherSGetDispatcherProfileIDs,
|
||||
testDispatcherSUpdateDispatcherProfile,
|
||||
testDispatcherSGetDispatcherProfileCache,
|
||||
testDispatcherSRemDispatcherProfile,
|
||||
|
||||
testDispatcherSSetDispatcherHost,
|
||||
testDispatcherSGetDispatcherHostIDs,
|
||||
testDispatcherSUpdateDispatcherHost,
|
||||
testDispatcherSGetDispatcherHostCache,
|
||||
testDispatcherSRemDispatcherHost,
|
||||
|
||||
testDispatcherSKillEngine,
|
||||
@@ -196,6 +199,15 @@ func testDispatcherSUpdateDispatcherProfile(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func testDispatcherSGetDispatcherProfileCache(t *testing.T) {
|
||||
var rcvStats map[string]*ltcache.CacheStats
|
||||
if err := dispatcherRPC.Call(utils.CacheSv1GetCacheStats, nil, &rcvStats); err != nil {
|
||||
t.Error(err)
|
||||
} else if rcvStats[utils.CacheDispatcherProfiles].Items != 1 {
|
||||
t.Errorf("Expecting: 1 DispatcherProfiles, received: %+v", rcvStats[utils.CacheDispatcherProfiles])
|
||||
}
|
||||
}
|
||||
|
||||
func testDispatcherSRemDispatcherProfile(t *testing.T) {
|
||||
var result string
|
||||
if err := dispatcherRPC.Call(utils.ApierV1RemoveDispatcherProfile,
|
||||
@@ -302,6 +314,15 @@ func testDispatcherSUpdateDispatcherHost(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func testDispatcherSGetDispatcherHostCache(t *testing.T) {
|
||||
var rcvStats map[string]*ltcache.CacheStats
|
||||
if err := dispatcherRPC.Call(utils.CacheSv1GetCacheStats, nil, &rcvStats); err != nil {
|
||||
t.Error(err)
|
||||
} else if rcvStats[utils.CacheDispatcherHosts].Items != 0 {
|
||||
t.Errorf("Expecting: 0 DispatcherProfiles, received: %+v", rcvStats[utils.CacheDispatcherProfiles])
|
||||
}
|
||||
}
|
||||
|
||||
func testDispatcherSRemDispatcherHost(t *testing.T) {
|
||||
var result string
|
||||
if err := dispatcherRPC.Call(utils.ApierV1RemoveDispatcherHost,
|
||||
|
||||
Reference in New Issue
Block a user