package control
import (
- "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/teststub"
- "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/teststubdummy"
- "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/teststube2ap"
- "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/xapptweaks"
"os"
"testing"
"time"
+
+ "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/teststub"
+ "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/teststubdummy"
+ "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/teststube2ap"
+ "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
)
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
func CaseBegin(desc string) *teststub.TestWrapper {
tent := teststub.NewTestWrapper(desc)
- tent.Logger.Info(desc)
+ tent.Debug(desc)
return tent
}
defer os.Remove(cfgfilename)
os.Setenv("CFG_FILE", cfgfilename)
*/
- tent.Logger.Info("Using cfg file %s", os.Getenv("CFG_FILE"))
+ tent.Debug("Using cfg file %s", os.Getenv("CFG_FILE"))
//---------------------------------
// Static routetable for rmr
// Entity
// -------------------
- mainsrc := teststub.RmrSrcId{xapptweaks.RmrEndpoint{"localhost", 14560}}
- xapp1src := teststub.RmrSrcId{xapptweaks.RmrEndpoint{"localhost", 13560}}
- xapp2src := teststub.RmrSrcId{xapptweaks.RmrEndpoint{"localhost", 13660}}
- e2term1src := teststub.RmrSrcId{xapptweaks.RmrEndpoint{"localhost", 15560}}
- e2term2src := teststub.RmrSrcId{xapptweaks.RmrEndpoint{"localhost", 15660}}
- dummysrc := teststub.RmrSrcId{xapptweaks.RmrEndpoint{"localhost", 16560}}
+ mainsrc := teststub.RmrSrcId{xapp.RmrEndpoint{"localhost", 14560}}
+ xapp1src := teststub.RmrSrcId{xapp.RmrEndpoint{"localhost", 13560}}
+ xapp2src := teststub.RmrSrcId{xapp.RmrEndpoint{"localhost", 13660}}
+ e2term1src := teststub.RmrSrcId{xapp.RmrEndpoint{"localhost", 15560}}
+ e2term2src := teststub.RmrSrcId{xapp.RmrEndpoint{"localhost", 15660}}
+ dummysrc := teststub.RmrSrcId{xapp.RmrEndpoint{"localhost", 16560}}
//---------------------------------
rt := &teststub.RmrRouteTable{}
rt.AddMeid(e2term2src.String(), []string{"RAN_NAME_11", "RAN_NAME_12"})
rt.Enable()
- tent.Logger.Info("rttable[%s]", rt.Table())
+ tent.Debug("rttable[%s]", rt.Table())
//---------------------------------
//
//---------------------------------
- tent.Logger.Info("### submgr ctrl run ###")
+ tent.Debug("### submgr ctrl run ###")
mainCtrl = createSubmgrControl(mainsrc, teststub.RmrRtgSvc{})
//
//env variables. Re-create rt info.
for i := 0; i < int(10)*2; i++ {
if os.Getenv("RMR_SEED_RT") == rt.FileName() {
- tent.Logger.Info("Waiting that alarm alternates RMR_SEED_RT=%s", os.Getenv("RMR_SEED_RT"))
+ tent.Debug("Waiting that alarm alternates RMR_SEED_RT=%s", os.Getenv("RMR_SEED_RT"))
time.Sleep(500 * time.Millisecond)
} else {
- tent.Logger.Info("Alarm has alternated RMR_SEED_RT=%s, so waiting 0.5 secs before restoring it", os.Getenv("RMR_SEED_RT"))
+ tent.Debug("Alarm has alternated RMR_SEED_RT=%s, so waiting 0.5 secs before restoring it", os.Getenv("RMR_SEED_RT"))
time.Sleep(500 * time.Millisecond)
rt.Enable()
- tent.Logger.Info("rttable[%s]", rt.Table())
+ tent.Debug("rttable[%s]", rt.Table())
break
}
}
if os.Getenv("RMR_SEED_RT") != rt.FileName() {
- tent.Logger.Error("Unittest timing issue with alarm RMR_SEED_RT=%s", os.Getenv("RMR_SEED_RT"))
+ tent.Error("Unittest timing issue with alarm RMR_SEED_RT=%s", os.Getenv("RMR_SEED_RT"))
os.Exit(1)
}
//---------------------------------
//
//---------------------------------
- tent.Logger.Info("### xapp1 stub run ###")
- xappConn1 = teststube2ap.CreateNewE2Stub("xappstub1", xapp1src, teststub.RmrRtgSvc{}, "RMRXAPP1STUB", teststubPortSeed)
+ tent.Debug("### xapp1 stub run ###")
+ xappConn1 = teststube2ap.CreateNewE2Stub("xappstub1", xapp1src, teststub.RmrRtgSvc{}, "RMRXAPP1STUB", teststubPortSeed, "RAN_NAME_1", "localhost", 13560, 8080)
//---------------------------------
//
//---------------------------------
- tent.Logger.Info("### xapp2 stub run ###")
- xappConn2 = teststube2ap.CreateNewE2Stub("xappstub2", xapp2src, teststub.RmrRtgSvc{}, "RMRXAPP2STUB", teststubPortSeed)
+ tent.Debug("### xapp2 stub run ###")
+ xappConn2 = teststube2ap.CreateNewE2Stub("xappstub2", xapp2src, teststub.RmrRtgSvc{}, "RMRXAPP2STUB", teststubPortSeed, "RAN_NAME_2", "localhost", 13660, 8080)
//---------------------------------
//
//---------------------------------
- tent.Logger.Info("### e2term1 stub run ###")
+ tent.Debug("### e2term1 stub run ###")
e2termConn1 = teststube2ap.CreateNewE2termStub("e2termstub1", e2term1src, teststub.RmrRtgSvc{}, "RMRE2TERMSTUB1", teststubPortSeed)
//---------------------------------
//
//---------------------------------
- tent.Logger.Info("### e2term2 stub run ###")
+ tent.Debug("### e2term2 stub run ###")
e2termConn2 = teststube2ap.CreateNewE2termStub("e2termstub2", e2term2src, teststub.RmrRtgSvc{}, "RMRE2TERMSTUB2", teststubPortSeed)
//---------------------------------
// Just to test dummy stub
//---------------------------------
- tent.Logger.Info("### dummy stub run ###")
+ tent.Debug("### dummy stub run ###")
dummystub = teststubdummy.CreateNewRmrDummyStub("dummystub", dummysrc, teststub.RmrRtgSvc{}, "DUMMYSTUB", teststubPortSeed)
//---------------------------------
// Testing message sending
//---------------------------------
- if teststub.RmrStubControlWaitAlive(10, teststubPortSeed, mainCtrl.c) == false {
+ if teststub.RmrStubControlWaitAlive(10, teststubPortSeed, mainCtrl.c.RMRClient, tent) == false {
os.Exit(1)
}
if os.Getenv("RMR_SEED_RT") != rt.FileName() {
- tent.Logger.Error("Unittest timing issue with alarm RMR_SEED_RT=%s", os.Getenv("RMR_SEED_RT"))
+ tent.Error("Unittest timing issue with alarm RMR_SEED_RT=%s", os.Getenv("RMR_SEED_RT"))
os.Exit(1)
}