[SEBA-882] add Sadis server
Change-Id: I2c973a940ccf1398b1c122908769e806eaa1dd14
diff --git a/cmd/bbsim/bbsim.go b/cmd/bbsim/bbsim.go
index 52d5772..8ffb941 100644
--- a/cmd/bbsim/bbsim.go
+++ b/cmd/bbsim/bbsim.go
@@ -31,6 +31,7 @@
"github.com/opencord/bbsim/api/legacy"
"github.com/opencord/bbsim/internal/bbsim/api"
"github.com/opencord/bbsim/internal/bbsim/devices"
+ "github.com/opencord/bbsim/internal/bbsim/responders/sadis"
"github.com/opencord/bbsim/internal/common"
log "github.com/sirupsen/logrus"
"google.golang.org/grpc"
@@ -39,7 +40,7 @@
func startApiServer(apiDoneChannel chan bool, group *sync.WaitGroup) {
address := common.Options.BBSim.ApiAddress
- log.Debugf("APIServer listening on: %v", address)
+ log.Debugf("APIServer listening on %v", address)
lis, err := net.Listen("tcp", address)
if err != nil {
log.Fatalf("APIServer failed to listen: %v", err)
@@ -81,7 +82,7 @@
s := &http.Server{Addr: address, Handler: mux}
go func() {
- log.Infof("REST API server listening on %s ...", address)
+ log.Infof("REST API server listening on %s", address)
if err := s.ListenAndServe(); err != nil && err != http.ErrServerClosed {
log.Errorf("Could not start API server: %v", err)
return
@@ -102,7 +103,7 @@
grpcAddress := common.Options.BBSim.LegacyApiAddress
restAddress := common.Options.BBSim.LegacyRestApiAddress
- log.Debugf("Legacy APIServer listening on: %v", grpcAddress)
+ log.Debugf("Legacy APIServer listening on %v", grpcAddress)
listener, err := net.Listen("tcp", grpcAddress)
if err != nil {
log.Fatalf("Legacy APIServer failed to listen: %v", err)
@@ -158,7 +159,7 @@
// control channels, they are only closed when the goroutine needs to be terminated
apiDoneChannel := make(chan bool)
- devices.CreateOLT(
+ olt := devices.CreateOLT(
options.Olt.ID,
int(options.Olt.NniPorts),
int(options.Olt.PonPorts),
@@ -188,6 +189,10 @@
go startApiServer(apiDoneChannel, &wg)
go startLegacyApiServer(apiDoneChannel, &wg)
log.Debugf("Started APIService")
+ if common.Options.BBSim.SadisServer != false {
+ wg.Add(1)
+ go sadis.StartRestServer(olt, &wg)
+ }
wg.Wait()