import (
"fmt"
- "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
- "os"
"testing"
)
//-----------------------------------------------------------------------------
type RmrControl struct {
TestWrapper
+ RmrSrcId
+ RmrRtgSvc
syncChan chan struct{}
}
<-tc.syncChan
}
-func (tc *RmrControl) Init(desc string, rtfile string, port string) {
+func (tc *RmrControl) Init(desc string, srcId RmrSrcId, rtgSvc RmrRtgSvc) {
tc.TestWrapper.Init(desc)
- os.Setenv("RMR_SEED_RT", rtfile)
- os.Setenv("RMR_SRC_ID", "localhost:"+port)
- xapp.Logger.Info("Using rt file %s", os.Getenv("RMR_SEED_RT"))
- xapp.Logger.Info("Using src id %s", os.Getenv("RMR_SRC_ID"))
+
+ tc.RmrSrcId = srcId
+ tc.RmrSrcId.Enable()
+
+ tc.RmrRtgSvc = rtgSvc
+ tc.RmrRtgSvc.Enable()
+
tc.syncChan = make(chan struct{})
}
func (tc *RmrControl) TestError(t *testing.T, pattern string, args ...interface{}) {
- tc.Logger.Error(fmt.Sprintf(pattern, args...))
+ tc.Error(fmt.Sprintf(pattern, args...))
t.Errorf(fmt.Sprintf(pattern, args...))
}
func (tc *RmrControl) TestLog(t *testing.T, pattern string, args ...interface{}) {
- tc.Logger.Info(fmt.Sprintf(pattern, args...))
+ tc.Debug(fmt.Sprintf(pattern, args...))
t.Logf(fmt.Sprintf(pattern, args...))
}