X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=pkg%2Fxapp%2Fxapp_test.go;h=9696e6eec4b75e3b928665bbaefe872edfaa7e85;hb=refs%2Ftags%2Fv0.4.7;hp=e52c3eec28ead3513a4f40c5aa458f5cf3d61ce5;hpb=e0948fe8b755b4d752ef9da4a46246cf3951c9dc;p=ric-plt%2Fxapp-frame.git diff --git a/pkg/xapp/xapp_test.go b/pkg/xapp/xapp_test.go index e52c3ee..9696e6e 100755 --- a/pkg/xapp/xapp_test.go +++ b/pkg/xapp/xapp_test.go @@ -190,44 +190,44 @@ func TestMessagesReceivedSuccessfullyUsingWh(t *testing.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) + 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) {