mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Updated test for docker
This commit is contained in:
committed by
Dan Christian Bogos
parent
0b372aab6e
commit
621cfb39ab
@@ -1,4 +1,4 @@
|
||||
// +build integration
|
||||
// +build nodocker
|
||||
|
||||
/*
|
||||
Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments
|
||||
@@ -330,6 +330,32 @@ func testCDRsExpKafka(t *testing.T) {
|
||||
cancel()
|
||||
}
|
||||
|
||||
func checkContent(ev *engine.ExportEvents, content []interface{}) error {
|
||||
match := false
|
||||
for _, bev := range ev.Events {
|
||||
for _, con := range content {
|
||||
if reflect.DeepEqual(bev, con) {
|
||||
match = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if match {
|
||||
break
|
||||
}
|
||||
}
|
||||
if !match {
|
||||
exp := make([]string, len(content))
|
||||
for i, con := range content {
|
||||
exp[i] = utils.IfaceAsString(con)
|
||||
}
|
||||
recv := make([]string, len(ev.Events))
|
||||
for i, con := range ev.Events {
|
||||
recv[i] = utils.IfaceAsString(con)
|
||||
}
|
||||
return fmt.Errorf("Expecting: one of %s, received: %s", utils.ToJSON(exp), utils.ToJSON(recv))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func testCDRsExpFileFailover(t *testing.T) {
|
||||
time.Sleep(time.Second)
|
||||
filesInDir, _ := ioutil.ReadDir(cdrsExpCfg.GeneralCfg().FailedPostsDir)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// +build integration
|
||||
// +build nodocker
|
||||
|
||||
/*
|
||||
Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments
|
||||
@@ -445,33 +445,6 @@ func testCDRsOnExpAMQPReplication(t *testing.T) {
|
||||
|
||||
}
|
||||
|
||||
func checkContent(ev *engine.ExportEvents, content []interface{}) error {
|
||||
match := false
|
||||
for _, bev := range ev.Events {
|
||||
for _, con := range content {
|
||||
if reflect.DeepEqual(bev, con) {
|
||||
match = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if match {
|
||||
break
|
||||
}
|
||||
}
|
||||
if !match {
|
||||
exp := make([]string, len(content))
|
||||
for i, con := range content {
|
||||
exp[i] = utils.IfaceAsString(con)
|
||||
}
|
||||
recv := make([]string, len(ev.Events))
|
||||
for i, con := range ev.Events {
|
||||
recv[i] = utils.IfaceAsString(con)
|
||||
}
|
||||
return fmt.Errorf("Expecting: one of %s, received: %s", utils.ToJSON(exp), utils.ToJSON(recv))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func testCDRsOnExpFileFailover(t *testing.T) {
|
||||
v1 := url.Values{}
|
||||
v2 := url.Values{}
|
||||
|
||||
Reference in New Issue
Block a user