X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Fteststub%2Frmrenv.go;h=4b1f1b70832b65f708581529eff54f33031a1aff;hb=ac8bde486e4453d613db6ae05f6839661068a4ab;hp=5a57b5649469beddf3a2acd29c23196587e2f1a1;hpb=cd78aeeae3212fa722be4ba9768cac711305badf;p=ric-plt%2Fsubmgr.git diff --git a/pkg/teststub/rmrenv.go b/pkg/teststub/rmrenv.go index 5a57b56..4b1f1b7 100644 --- a/pkg/teststub/rmrenv.go +++ b/pkg/teststub/rmrenv.go @@ -20,7 +20,6 @@ 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" "os" "strconv" @@ -53,9 +52,9 @@ func (rrt *RmrRouteTable) AddRoute(mtype int, src string, subid int, trg string) func (rrt *RmrRouteTable) AddMeid(trg string, meids []string) { line := "mme_ar" - line += "|" + line += " | " line += trg - line += "|" + line += " | " for _, str := range meids { line += " " + str } @@ -65,7 +64,7 @@ func (rrt *RmrRouteTable) AddMeid(trg string, meids []string) { func (rrt *RmrRouteTable) DelMeid(meids []string) { line := "mme_del" - line += "|" + line += " | " for _, str := range meids { line += " " + str } @@ -82,6 +81,7 @@ func (rrt *RmrRouteTable) Table() string { allrt += val + "\n" } allrt += "newrt|end\n" + allrt += "\n" allrt += "meid_map | start\n" for _, val := range rrt.meids { allrt += val + "\n" @@ -91,11 +91,11 @@ func (rrt *RmrRouteTable) Table() string { } func (rrt *RmrRouteTable) Enable() { - if len(rrt.tmpfile) > 0 { - os.Remove(rrt.tmpfile) + if len(rrt.tmpfile) == 0 { + rrt.tmpfile, _ = CreateTmpFile(rrt.Table()) } - rrt.tmpfile, _ = CreateTmpFile(rrt.Table()) os.Setenv("RMR_SEED_RT", rrt.tmpfile) + os.Setenv("RMR_RTG_SVC", "-1") xapp.Logger.Info("Using rt file %s", os.Getenv("RMR_SEED_RT")) } @@ -103,6 +103,7 @@ func (rrt *RmrRouteTable) Disable() { if len(rrt.tmpfile) > 0 { os.Remove(rrt.tmpfile) os.Unsetenv("RMR_SEED_RT") + os.Unsetenv("RMR_RTG_SVC") rrt.tmpfile = "" xapp.Logger.Info("Not using rt file ") } @@ -113,7 +114,7 @@ func (rrt *RmrRouteTable) Disable() { //----------------------------------------------------------------------------- type RmrSrcId struct { - xapptweaks.RmrEndpoint + xapp.RmrEndpoint } func (rsi *RmrSrcId) Enable() { @@ -132,7 +133,7 @@ func (rsi *RmrSrcId) Disable() { // //----------------------------------------------------------------------------- type RmrRtgSvc struct { - xapptweaks.RmrEndpoint + xapp.RmrEndpoint } func (rrs *RmrRtgSvc) Enable() {