[VOL-4519] Add bbsimctl command to invalidate MDS count of an ONU

Change-Id: I8cdb6c0d5381b952a87e1d24d87cab81de0ddaf9
diff --git a/internal/bbsim/devices/onu_omci_test.go b/internal/bbsim/devices/onu_omci_test.go
index 2c2b489..751bf08 100644
--- a/internal/bbsim/devices/onu_omci_test.go
+++ b/internal/bbsim/devices/onu_omci_test.go
@@ -17,6 +17,9 @@
 package devices
 
 import (
+	"strconv"
+	"testing"
+
 	"github.com/google/gopacket"
 	bbsim "github.com/opencord/bbsim/internal/bbsim/types"
 	omcilib "github.com/opencord/bbsim/internal/common/omci"
@@ -24,8 +27,6 @@
 	me "github.com/opencord/omci-lib-go/v2/generated"
 	"github.com/opencord/voltha-protos/v5/go/openolt"
 	"gotest.tools/assert"
-	"strconv"
-	"testing"
 )
 
 var mockAttr = me.AttributeValueMap{
@@ -312,6 +313,21 @@
 	assert.Equal(t, onu.MibDataSync, uint8(0))
 }
 
+func Test_MibDataSyncInvalidation(t *testing.T) {
+	onu := createMockOnu(1, 1)
+	onu.MibDataSync = 250
+	assert.Equal(t, onu.MibDataSync, uint8(250))
+
+	onu.InvalidateMibDataSync()
+
+	// check if the MDS has been changed
+	assert.Assert(t, onu.MibDataSync != uint8(250))
+
+	// the MDS has to be between 1 and 255, since 0 is valid for a reset
+	assert.Assert(t, onu.MibDataSync > 0)
+	assert.Assert(t, onu.MibDataSync <= 255)
+}
+
 func Test_GemPortValidation(t *testing.T) {
 
 	// setup