Merge "Fixing alarms in poweron/shutdown and added events for flow"
diff --git a/internal/bbsim/api/onus_handler.go b/internal/bbsim/api/onus_handler.go
index 330621a..116199a 100644
--- a/internal/bbsim/api/onus_handler.go
+++ b/internal/bbsim/api/onus_handler.go
@@ -19,6 +19,7 @@
import (
"context"
"fmt"
+
"github.com/opencord/bbsim/api/bbsim"
"github.com/opencord/bbsim/internal/bbsim/alarmsim"
"github.com/opencord/bbsim/internal/bbsim/devices"
@@ -404,7 +405,7 @@
}
losReq := bbsim.ONUAlarmRequest{
- AlarmType: "LossOfSignal",
+ AlarmType: "ONU_ALARM_LOS",
SerialNumber: onu.Sn(),
Status: "off",
}
@@ -457,7 +458,7 @@
olt := devices.GetOLT()
dyingGasp := bbsim.ONUAlarmRequest{
- AlarmType: "DyingGasp",
+ AlarmType: "DYING_GASP",
SerialNumber: onu.Sn(),
Status: "on",
}
@@ -474,7 +475,7 @@
}
losReq := bbsim.ONUAlarmRequest{
- AlarmType: "LossOfSignal",
+ AlarmType: "ONU_ALARM_LOS",
SerialNumber: onu.Sn(),
Status: "on",
}
diff --git a/internal/bbsim/devices/olt.go b/internal/bbsim/devices/olt.go
index 0209b88..572507e 100644
--- a/internal/bbsim/devices/olt.go
+++ b/internal/bbsim/devices/olt.go
@@ -963,6 +963,10 @@
}
if !o.enablePerf {
onu.Flows = append(onu.Flows, flowKey)
+ // Generate event on first flow for ONU
+ if len(onu.Flows) == 1 {
+ publishEvent("Flow-add-received", int32(onu.PonPortID), int32(onu.ID), onuSnToString(onu.SerialNumber))
+ }
}
msg := Message{
@@ -1012,6 +1016,7 @@
return new(openolt.Empty), nil
}
onu.DeleteFlow(flowKey)
+ publishEvent("Flow-remove-received", int32(onu.PonPortID), int32(onu.ID), onuSnToString(onu.SerialNumber))
}
// delete from olt flows