mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-21 07:08:45 +05:00
Added thresholds properly to reload test
This commit is contained in:
committed by
Dan Christian Bogos
parent
1f810aaa11
commit
20c6a48e5b
@@ -599,10 +599,10 @@
|
||||
},
|
||||
|
||||
"thresholds": {
|
||||
"enabled": true,
|
||||
"enabled": false,
|
||||
"store_interval": "",
|
||||
"indexed_selects": true,
|
||||
//"string_indexed_fields": [],
|
||||
"indexed_selects": false,
|
||||
"string_indexed_fields": [],
|
||||
"prefix_indexed_fields": [],
|
||||
"suffix_indexed_fields": [],
|
||||
"nested_fields": false,
|
||||
|
||||
@@ -48,6 +48,7 @@ var (
|
||||
//testSectConfigSReloadDataDB,
|
||||
//testSectConfigSReloadStorDB,
|
||||
testSectConfigSReloadListen,
|
||||
testSectConfigSReloadThresholds,
|
||||
testSectConfigSReloadRALS,
|
||||
|
||||
testSectConfigSReloadAttributes,
|
||||
@@ -78,7 +79,7 @@ var (
|
||||
testSectConfigSReloadChargers,
|
||||
testSectConfigSReloadResources,
|
||||
testSectConfigSReloadStats,
|
||||
testSectConfigSReloadThresholds,
|
||||
|
||||
testSectConfigSReloadLoaders,
|
||||
testSectConfigSReloadMailer,
|
||||
|
||||
@@ -858,21 +859,27 @@ func testSectConfigSReloadStats(t *testing.T) {
|
||||
func testSectConfigSReloadThresholds(t *testing.T) {
|
||||
|
||||
var replyPingBf string
|
||||
if err := testSectRPC.Call(utils.ThresholdSv1Ping, &utils.CGREvent{}, &replyPingBf); err != nil {
|
||||
if err := testSectRPC.Call(utils.ThresholdSv1Ping, &utils.CGREvent{}, &replyPingBf); err == nil || err.Error() != "rpc: can't find service ThresholdSv1.Ping" {
|
||||
t.Error(err)
|
||||
} else if replyPingBf != utils.Pong {
|
||||
t.Errorf("Expected OK received: %s", replyPingBf)
|
||||
}
|
||||
var reply string
|
||||
if err := testSectRPC.Call(utils.ConfigSv1SetConfigFromJSON, &config.SetConfigFromJSONArgs{
|
||||
Tenant: "cgrates.org",
|
||||
Config: "{\"thresholds\":{\"enabled\":true,\"indexed_selects\":true,\"nested_fields\":false,\"prefix_indexed_fields\":[],\"store_interval\":\"-1ns\",\"suffix_indexed_fields\":[]}}",
|
||||
Config: `{"thresholds": {
|
||||
"enabled": true,
|
||||
"store_interval": "0ns",
|
||||
"indexed_selects": true,
|
||||
"string_indexed_fields": ["string_indexed_fields"],
|
||||
"prefix_indexed_fields": ["prefix_indexed_fields"],
|
||||
"suffix_indexed_fields": ["suffix_indexed_fields"],
|
||||
"nested_fields": true,
|
||||
},}}`,
|
||||
}, &reply); err != nil {
|
||||
t.Error(err)
|
||||
} else if reply != utils.OK {
|
||||
t.Errorf("Expected OK received: %+v", reply)
|
||||
}
|
||||
cfgStr := "{\"thresholds\":{\"enabled\":true,\"indexed_selects\":true,\"nested_fields\":false,\"prefix_indexed_fields\":[],\"store_interval\":\"-1ns\",\"suffix_indexed_fields\":[]}}"
|
||||
cfgStr := "{\"thresholds\":{\"enabled\":true,\"indexed_selects\":true,\"nested_fields\":true,\"prefix_indexed_fields\":[\"prefix_indexed_fields\"],\"store_interval\":\"\",\"string_indexed_fields\":[\"string_indexed_fields\"],\"suffix_indexed_fields\":[\"suffix_indexed_fields\"]}}"
|
||||
var rpl string
|
||||
if err := testSectRPC.Call(utils.ConfigSv1GetConfigAsJSON, &config.SectionWithAPIOpts{
|
||||
Tenant: "cgrates.org",
|
||||
|
||||
Reference in New Issue
Block a user