[VOL-4678] BBSIM: OMCI extended message set - make OMCC version configurable
Change-Id: I6a6bdde944612621dd8e5696075fe09b3c341709
diff --git a/Makefile b/Makefile
index 7e7c90e..390b43b 100644
--- a/Makefile
+++ b/Makefile
@@ -98,7 +98,6 @@
docker-build: local-omci-lib-go local-protos# @HELP Build the BBSim docker container (contains BBSimCtl too)
docker build \
- --platform linux/x86_64 \
-t ${DOCKER_REGISTRY}${DOCKER_REPOSITORY}bbsim:${DOCKER_TAG} \
-f build/package/Dockerfile .
diff --git a/VERSION b/VERSION
index ff3d4cc..f61e315 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.12.8-dev
+1.12.8
diff --git a/cmd/bbsim/bbsim.go b/cmd/bbsim/bbsim.go
index 294e055..1571d48 100644
--- a/cmd/bbsim/bbsim.go
+++ b/cmd/bbsim/bbsim.go
@@ -164,6 +164,7 @@
"OmciResponseRate": common.Config.Olt.OmciResponseRate,
"injectOmciUnknownMe": common.Config.BBSim.InjectOmciUnknownMe,
"injectOmciUnknownAttributes": common.Config.BBSim.InjectOmciUnknownAttributes,
+ "omccVersion": common.Config.BBSim.OmccVersion,
}).Info("BroadBand Simulator is on")
// control channels, they are only closed when the goroutine needs to be terminated
diff --git a/docs/source/bbsim_config.rst b/docs/source/bbsim_config.rst
index 279e606..5998714 100644
--- a/docs/source/bbsim_config.rst
+++ b/docs/source/bbsim_config.rst
@@ -13,8 +13,8 @@
Usage of ./bbsim:
-api_address string
IP address:port (default ":50070")
- -authRetry
- Set this flag if BBSim should retry EAPOL (Authentication) upon failure until success
+ -authRetry bool
+ Set this flag if BBSim should retry EAPOL (Authentication) upon failure until success (default false)
-bp_format string
Bandwidth profile format, 'mef' or 'ietf' (default "mef")
-ca string
@@ -22,25 +22,29 @@
-config string
Configuration file path (default "configs/bbsim.yaml")
-cpuprofile string
- write cpu profile to file
+ write cpu profile to file (default "")
-delay int
The delay between ONU DISCOVERY batches in milliseconds (1 ONU per each PON PORT at a time (default 200)
- -dhcpRetry
- Set this flag if BBSim should retry DHCP upon failure until success
+ -dhcpRetry bool
+ Set this flag if BBSim should retry DHCP upon failure until success (default false)
-dmi_server_address string
IP address:port (default ":50075")
- -enableEvents
- Enable sending BBSim events on configured kafka server
- -enableperf
- Setting this flag will cause BBSim to not store data like traffic schedulers, flows of ONUs etc..
- -injectOmciUnknownAttributes
- Generate a MibDB packet with Unknown Attributes
+ -enableEvents bool
+ Enable sending BBSim events on configured kafka server (default false)
+ -enableperf bool
+ Setting this flag will cause BBSim to not store data like traffic schedulers, flows of ONUs etc.. (default false)
+ -injectOmciUnknownAttributes bool
+ Generate a MibDB packet with Unknown Attributes (default false)
+ -injectOmciUnknownMe bool
+ Generate a MibDB packet with Unknown Me (default false)
+ -omccVersion int
+ Set OMCC version to be returned in OMCI response of ME Onu2G (default 163 (0xA3))
-kafkaAddress string
IP:Port for kafka (default ":9092")
-kafkaEventTopic string
- Ability to configure the topic on which BBSim publishes events on Kafka
- -logCaller
- Whether to print the caller filename or not
+ Ability to configure the topic on which BBSim publishes events on Kafka (default "")
+ -logCaller bool
+ Whether to print the caller filename or not (default false)
-logLevel string
Set the log level (trace, debug, info, warn, error) (default "debug")
-nni int
@@ -50,7 +54,7 @@
-oltRebootDelay int
Time that BBSim should before restarting after a reboot (default 60)
-olt_id int
- OLT device ID
+ OLT device ID (default 0)
-omci_response_rate int
Amount of OMCI messages to respond to (default 10)
-onu int
@@ -60,7 +64,7 @@
-pon int
Number of PON ports per OLT device to be emulated (default 1)
-pon_port_config_file string
- Pon Interfaces Configuration file path
+ Pon Interfaces Configuration file path (default "")
-pots int
Number of POTS UNI Ports per ONU device to be emulated (default 0)
-rest_api_address string
diff --git a/internal/common/omci/get.go b/internal/common/omci/get.go
index 71d7d87..b450b87 100644
--- a/internal/common/omci/get.go
+++ b/internal/common/omci/get.go
@@ -24,6 +24,7 @@
"strconv"
"github.com/google/gopacket"
+ "github.com/opencord/bbsim/internal/common"
"github.com/opencord/omci-lib-go/v2"
me "github.com/opencord/omci-lib-go/v2/generated"
"github.com/opencord/voltha-protos/v5/go/openolt"
@@ -143,7 +144,7 @@
Attributes: me.AttributeValueMap{
me.ManagedEntityID: entityID,
me.Onu2G_EquipmentId: ToOctets("12345123451234512345", 20),
- me.Onu2G_OpticalNetworkUnitManagementAndControlChannelOmccVersion: 180,
+ me.Onu2G_OpticalNetworkUnitManagementAndControlChannelOmccVersion: common.Config.BBSim.OmccVersion,
me.Onu2G_VendorProductCode: 0,
me.Onu2G_SecurityCapability: 1,
me.Onu2G_SecurityMode: 1,
diff --git a/internal/common/omci/get_test.go b/internal/common/omci/get_test.go
index 82bbe7a..94422c1 100644
--- a/internal/common/omci/get_test.go
+++ b/internal/common/omci/get_test.go
@@ -23,6 +23,7 @@
"testing"
"github.com/google/gopacket"
+ "github.com/opencord/bbsim/internal/common"
"github.com/opencord/omci-lib-go/v2"
me "github.com/opencord/omci-lib-go/v2/generated"
"github.com/opencord/voltha-protos/v5/go/openolt"
@@ -69,6 +70,8 @@
func TestGetResponse(t *testing.T) {
+ common.Config = common.GetDefaultOps()
+
// NOTE that we're not testing the SerialNumber attribute part of the ONU-G
// response here as it is a special case and it requires transformation.
// we specifically test that in TestCreateOnugResponse
@@ -83,7 +86,7 @@
}{
{"getOnu2gResponse",
getArgs{createOnu2gResponse(false, 57344, 10), 1},
- getWant{1, map[string]interface{}{"OpticalNetworkUnitManagementAndControlChannelOmccVersion": uint8(180)}},
+ getWant{1, map[string]interface{}{"OpticalNetworkUnitManagementAndControlChannelOmccVersion": uint8(163)}},
},
{"getOnugResponse",
getArgs{createOnugResponse(false, 40960, 10, sn), 1},
diff --git a/internal/common/option_test.go b/internal/common/option_test.go
index bf8d139..01a97f5 100644
--- a/internal/common/option_test.go
+++ b/internal/common/option_test.go
@@ -41,7 +41,7 @@
}
func TestLoadPonsConfigDefaults(t *testing.T) {
- Config = getDefaultOps()
+ Config = GetDefaultOps()
// The default options define 1 PON per OLT
// and 1 ONU per PON
@@ -72,7 +72,7 @@
func TestLoadPonsConfigFile(t *testing.T) {
- Config = getDefaultOps()
+ Config = GetDefaultOps()
Services = []ServiceYaml{
{
diff --git a/internal/common/options.go b/internal/common/options.go
index 318e29f..3f16058 100644
--- a/internal/common/options.go
+++ b/internal/common/options.go
@@ -190,6 +190,7 @@
BandwidthProfileFormat string `yaml:"bp_format"`
InjectOmciUnknownMe bool `yaml:"inject_omci_unknown_me"`
InjectOmciUnknownAttributes bool `yaml:"inject_omci_unknown_attributes"`
+ OmccVersion int `yaml:"omcc_version"`
}
type BBRConfig struct {
@@ -254,7 +255,7 @@
// - we merge the configuration (CLI has priority over yaml files)
func LoadConfig() {
- Config = getDefaultOps()
+ Config = GetDefaultOps()
cliConf := readCliParams()
@@ -321,7 +322,7 @@
func readCliParams() *GlobalConfig {
- conf := getDefaultOps()
+ conf := GetDefaultOps()
configFile := flag.String("config", conf.BBSim.ConfigFile, "Configuration file path")
servicesFile := flag.String("services", conf.BBSim.ServiceConfigFile, "Service Configuration file path")
@@ -361,6 +362,7 @@
authRetry := flag.Bool("authRetry", conf.BBSim.AuthRetry, "Set this flag if BBSim should retry EAPOL (Authentication) upon failure until success")
injectOmciUnknownMe := flag.Bool("injectOmciUnknownMe", conf.BBSim.InjectOmciUnknownMe, "Generate an extra MibDB packet with ClassID 37 (Intentionally left blank)")
injectOmciUnknownAttributes := flag.Bool("injectOmciUnknownAttributes", conf.BBSim.InjectOmciUnknownAttributes, "Modifies the ONU2-G MibDB packet to add Unknown Attributes")
+ omccVersion := flag.Int("omccVersion", conf.BBSim.OmccVersion, "Set OMCC version to be returned in OMCI response of ME Onu2G")
flag.Parse()
@@ -394,6 +396,7 @@
conf.BBSim.DmiServerAddress = *dmi_server_address
conf.BBSim.InjectOmciUnknownMe = *injectOmciUnknownMe
conf.BBSim.InjectOmciUnknownAttributes = *injectOmciUnknownAttributes
+ conf.BBSim.OmccVersion = *omccVersion
// update device id if not set
if conf.Olt.DeviceId == "" {
@@ -409,7 +412,7 @@
return conf
}
-func getDefaultOps() *GlobalConfig {
+func GetDefaultOps() *GlobalConfig {
c := &GlobalConfig{
BBSimConfig{
@@ -440,6 +443,7 @@
BandwidthProfileFormat: BP_FORMAT_MEF,
InjectOmciUnknownMe: false,
InjectOmciUnknownAttributes: false,
+ OmccVersion: 0xA3,
},
OltConfig{
Vendor: "BBSim",
@@ -498,7 +502,7 @@
// LoadBBSimConf loads the BBSim configuration from a YAML file
func loadBBSimConf(filename string) (*GlobalConfig, error) {
- yamlConfig := getDefaultOps()
+ yamlConfig := GetDefaultOps()
yamlFile, err := ioutil.ReadFile(filename)
if err != nil {