}
func TestGetHealthCheckRetursServiceUnavailableError(t *testing.T) {
+ Logger.Info("CASE: TestGetHealthCheckRetursServiceUnavailableError")
req, _ := http.NewRequest("GET", "/ric/v1/health/ready", nil)
/*response :=*/ executeRequest(req)
}
func TestGetHealthCheckReturnsSuccess(t *testing.T) {
+ Logger.Info("CASE: TestGetHealthCheckReturnsSuccess")
for Rmr.IsReady() == false {
time.Sleep(time.Duration(2) * time.Second)
}
}
func TestInjectQuerySinglePath(t *testing.T) {
+ Logger.Info("CASE: TestInjectQuerySinglePath")
var handler = func(w http.ResponseWriter, r *http.Request) {
}
}
func TestInjectQueryMultiplePaths(t *testing.T) {
+ Logger.Info("CASE: TestInjectQueryMultiplePaths")
var handler = func(w http.ResponseWriter, r *http.Request) {
}
}
func TestInjectQueryFailures(t *testing.T) {
+ Logger.Info("CASE: TestInjectQueryFailures")
var handler = func(w http.ResponseWriter, r *http.Request) {
}
}
func TestMessagesReceivedSuccessfully(t *testing.T) {
+ Logger.Info("CASE: TestMessagesReceivedSuccessfully")
time.Sleep(time.Duration(5) * time.Second)
for i := 0; i < 100; i++ {
params := &RMRParams{}
}
// Allow time to process the messages
- time.Sleep(time.Duration(2) * time.Second)
+ time.Sleep(time.Duration(5) * time.Second)
waitForSdl := viper.GetBool("db.waitForSdl")
stats := getMetrics(t)
}
func TestMessagesReceivedSuccessfullyUsingWh(t *testing.T) {
+ Logger.Info("CASE: TestMessagesReceivedSuccessfullyUsingWh")
time.Sleep(time.Duration(5) * time.Second)
whid := Rmr.Openwh("localhost:4560")
time.Sleep(time.Duration(1) * time.Second)
}
// Allow time to process the messages
- time.Sleep(time.Duration(2) * time.Second)
+ time.Sleep(time.Duration(5) * time.Second)
waitForSdl := viper.GetBool("db.waitForSdl")
stats := getMetrics(t)
}
func TestMessagesReceivedSuccessfullyUsingWhCall(t *testing.T) {
- time.Sleep(time.Duration(5) * time.Second)
- whid := Rmr.Openwh("localhost:4560")
- params := &RMRParams{}
- params.Payload = []byte("newrt|start\nnewrt|end\n")
- params.Whid = int(whid)
- params.Callid = 4
- params.Timeout = 1000
- Rmr.SendCallMsg(params)
+ Logger.Info("CASE: TestMessagesReceivedSuccessfullyUsingWhCall")
+ time.Sleep(time.Duration(5) * time.Second)
+ whid := Rmr.Openwh("localhost:4560")
+ params := &RMRParams{}
+ params.Payload = []byte("newrt|start\nnewrt|end\n")
+ params.Whid = int(whid)
+ params.Callid = 4
+ params.Timeout = 1000
+ Rmr.SendCallMsg(params)
// Allow time to process the messages
time.Sleep(time.Duration(2) * time.Second)
- waitForSdl := viper.GetBool("db.waitForSdl")
- stats := getMetrics(t)
- if !strings.Contains(stats, "ricxapp_RMR_Transmitted 200") {
- t.Errorf("Error: ricxapp_RMR_Transmitted value incorrect: %v", stats)
- }
+ waitForSdl := viper.GetBool("db.waitForSdl")
+ stats := getMetrics(t)
+ if !strings.Contains(stats, "ricxapp_RMR_Transmitted 200") {
+ t.Errorf("Error: ricxapp_RMR_Transmitted value incorrect: %v", stats)
+ }
- if !strings.Contains(stats, "ricxapp_RMR_Received 201") {
- t.Errorf("Error: ricxapp_RMR_Received value incorrect: %v", stats)
- }
+ if !strings.Contains(stats, "ricxapp_RMR_Received 201") {
+ t.Errorf("Error: ricxapp_RMR_Received value incorrect: %v", stats)
+ }
- if !strings.Contains(stats, "ricxapp_RMR_TransmitError 1") {
- t.Errorf("Error: ricxapp_RMR_TransmitError value incorrect")
- }
+ if !strings.Contains(stats, "ricxapp_RMR_TransmitError 1") {
+ t.Errorf("Error: ricxapp_RMR_TransmitError value incorrect")
+ }
- if !strings.Contains(stats, "ricxapp_RMR_ReceiveError 0") {
- t.Errorf("Error: ricxapp_RMR_ReceiveError value incorrect")
- }
+ if !strings.Contains(stats, "ricxapp_RMR_ReceiveError 0") {
+ t.Errorf("Error: ricxapp_RMR_ReceiveError value incorrect")
+ }
- if waitForSdl && !strings.Contains(stats, "ricxapp_SDL_Stored 201") {
- t.Errorf("Error: ricxapp_SDL_Stored value incorrect")
- }
+ if waitForSdl && !strings.Contains(stats, "ricxapp_SDL_Stored 201") {
+ t.Errorf("Error: ricxapp_SDL_Stored value incorrect")
+ }
- if waitForSdl && !strings.Contains(stats, "ricxapp_SDL_StoreError 0") {
- t.Errorf("Error: ricxapp_SDL_StoreError value incorrect")
- }
- Rmr.Closewh(int(whid))
+ if waitForSdl && !strings.Contains(stats, "ricxapp_SDL_StoreError 0") {
+ t.Errorf("Error: ricxapp_SDL_StoreError value incorrect")
+ }
+ Rmr.Closewh(int(whid))
}
func TestSubscribeChannels(t *testing.T) {
+ Logger.Info("CASE: TestSubscribeChannels")
if !viper.GetBool("db.waitForSdl") {
return
}
}
func TestGetRicMessageSuccess(t *testing.T) {
+ Logger.Info("CASE: TestGetRicMessageSuccess")
id, ok := Rmr.GetRicMessageId("RIC_SUB_REQ")
if !ok || id != 12010 {
t.Errorf("Error: GetRicMessageId failed: id=%d", id)
}
func TestGetRicMessageFails(t *testing.T) {
+ Logger.Info("CASE: TestGetRicMessageFails")
ok := Rmr.IsRetryError(&RMRParams{status: 0})
if ok {
t.Errorf("Error: IsRetryError returned wrong value")
}
func TestIsErrorFunctions(t *testing.T) {
+ Logger.Info("CASE: TestIsErrorFunctions")
id, ok := Rmr.GetRicMessageId("RIC_SUB_REQ")
if !ok || id != 12010 {
t.Errorf("Error: GetRicMessageId failed: id=%d", id)
}
func TestTeardown(t *testing.T) {
+ Logger.Info("CASE: TestTeardown")
Sdl.Clear()
}