Code Review
/
ric-plt
/
submgr.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge newe2 into master
[ric-plt/submgr.git]
/
pkg
/
teststub
/
controlRmrStub.go
diff --git
a/pkg/teststub/controlRmrStub.go
b/pkg/teststub/controlRmrStub.go
index
a8c861f
..
f14bd1f
100644
(file)
--- a/
pkg/teststub/controlRmrStub.go
+++ b/
pkg/teststub/controlRmrStub.go
@@
-21,6
+21,7
@@
package teststub
import (
"gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/xapptweaks"
"gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
import (
"gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/xapptweaks"
"gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
+ "strconv"
"strings"
"testing"
"time"
"strings"
"testing"
"time"
@@
-67,14
+68,14
@@
func (tc *RmrStubControl) TestMsgChanEmpty(t *testing.T) {
}
}
}
}
-func (tc *RmrStubControl) Init(desc string, rtfile string, port
string
, stat string, initMsg int) {
+func (tc *RmrStubControl) Init(desc string, rtfile string, port
uint16, rtport uint16
, stat string, initMsg int) {
tc.InitMsg = initMsg
tc.Active = false
tc.RecvChan = make(chan *xapptweaks.RMRParams)
tc.InitMsg = initMsg
tc.Active = false
tc.RecvChan = make(chan *xapptweaks.RMRParams)
- tc.RmrControl.Init(desc, rtfile, port)
+ tc.RmrControl.Init(desc, rtfile, port
, rtport
)
tc.RmrWrapper.Init()
tc.RmrWrapper.Init()
- tc.Rmr = xapp.NewRMRClientWithParams("tcp:"+
port, 4096, 1
, stat)
+ tc.Rmr = xapp.NewRMRClientWithParams("tcp:"+
strconv.FormatUint(uint64(port), 10), 65534, 1, 0
, stat)
tc.Rmr.SetReadyCB(tc.ReadyCB, nil)
go tc.Rmr.Start(tc)
tc.Rmr.SetReadyCB(tc.ReadyCB, nil)
go tc.Rmr.Start(tc)
@@
-147,12
+148,16
@@
func RmrStubControlWaitAlive(seconds int, mtype int, rmr xapptweaks.XAppWrapperI
params.Xid = "TESTPING"
params.Mbuf = nil
params.Xid = "TESTPING"
params.Mbuf = nil
+ if len(allRmrStubs) == 0 {
+ rmr.GetLogger().Info("No rmr stubs so no need to wait those to be alive")
+ return true
+ }
status := false
i := 1
for ; i <= seconds*2 && status == false; i++ {
rmr.GetLogger().Info("SEND TESTPING: %s", params.String())
status := false
i := 1
for ; i <= seconds*2 && status == false; i++ {
rmr.GetLogger().Info("SEND TESTPING: %s", params.String())
- rmr.RmrSend(params)
+ rmr.RmrSend(params
, 0
)
status = true
for _, val := range allRmrStubs {
status = true
for _, val := range allRmrStubs {