Fixing BBR
As part of SEBA-927 BBSim expect VOLTHA to send back the OnuId and thus
BBR should behave the same way
Change-Id: I364c665c37385885310d8cfa1639b0f5037ed473
diff --git a/internal/bbr/devices/olt.go b/internal/bbr/devices/olt.go
index a12d8c6..bd35f68 100644
--- a/internal/bbr/devices/olt.go
+++ b/internal/bbr/devices/olt.go
@@ -34,10 +34,11 @@
)
type OltMock struct {
- Olt *devices.OltDevice
- BBSimIp string
- BBSimPort string
- BBSimApiPort string
+ LastUsedOnuId map[uint32]uint32
+ Olt *devices.OltDevice
+ BBSimIp string
+ BBSimPort string
+ BBSimApiPort string
conn *grpc.ClientConn
@@ -55,7 +56,7 @@
if err := onu.InternalState.Event("initialize"); err != nil {
log.Fatalf("Error initializing ONU: %v", err)
}
- log.Tracef("Created ONU: %s (%d:%d)", onu.Sn(), onu.STag, onu.CTag)
+ log.Debugf("Created ONU: %s (%d:%d)", onu.Sn(), onu.STag, onu.CTag)
}
}
@@ -180,13 +181,19 @@
log.WithFields(log.Fields{
"IntfId": onuDiscInd.IntfId,
"SerialNumber": common.OnuSnToString(onuDiscInd.SerialNumber),
+ "Err": err,
}).Fatal("Cannot find ONU")
}
+ // creating and storing ONU IDs
+ id := o.LastUsedOnuId[onuDiscInd.IntfId] + 1
+ o.LastUsedOnuId[onuDiscInd.IntfId] = o.LastUsedOnuId[onuDiscInd.IntfId] + 1
+ onu.SetID(id)
+
var pir uint32 = 1000000
Onu := openolt.Onu{
IntfId: onu.PonPortID,
- OnuId: onu.ID,
+ OnuId: id,
SerialNumber: onu.SerialNumber,
Pir: pir,
}