Cleaning the ONU state when the ONU is disabled
Change-Id: I28cf9b11dd086bef73835de4c8fa4c6bcd7a92e7
diff --git a/VERSION b/VERSION
index 3a4036f..aebc71f 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.2.5
+0.2.6-dev
diff --git a/internal/bbsim/devices/onu.go b/internal/bbsim/devices/onu.go
index 1acb063..a21d96a 100644
--- a/internal/bbsim/devices/onu.go
+++ b/internal/bbsim/devices/onu.go
@@ -221,6 +221,8 @@
// clean the ONU state
o.DhcpFlowReceived = false
+ o.EapolFlowReceived = false
+ o.GemPortAdded = false
o.PortNo = 0
o.Flows = []FlowKey{}
diff --git a/internal/bbsim/devices/onu_state_machine_test.go b/internal/bbsim/devices/onu_state_machine_test.go
index 81bf330..b2b292b 100644
--- a/internal/bbsim/devices/onu_state_machine_test.go
+++ b/internal/bbsim/devices/onu_state_machine_test.go
@@ -38,6 +38,8 @@
onu.PortNo = 16
onu.DhcpFlowReceived = true
+ onu.EapolFlowReceived = true
+ onu.GemPortAdded = true
onu.Flows = []FlowKey{
FlowKey{ID: 1, Direction: "upstream"},
FlowKey{ID: 2, Direction: "downstream"},
@@ -47,6 +49,8 @@
assert.Equal(t, onu.InternalState.Current(), "disabled")
assert.Equal(t, onu.DhcpFlowReceived, false)
+ assert.Equal(t, onu.EapolFlowReceived, false)
+ assert.Equal(t, onu.GemPortAdded, false)
assert.Equal(t, onu.PortNo, uint32(0))
assert.Equal(t, len(onu.Flows), 0)
}