diff --git a/gosnappi/gosnappi.go b/gosnappi/gosnappi.go index ce076f96..e4406df4 100644 --- a/gosnappi/gosnappi.go +++ b/gosnappi/gosnappi.go @@ -1,4 +1,4 @@ -/* Open Traffic Generator API 0.13.1 +/* Open Traffic Generator API 0.13.2 * Open Traffic Generator API defines a model-driven, vendor-neutral and standard * interface for emulating layer 2-7 network devices and generating test traffic. * @@ -309,7 +309,7 @@ func (api *gosnappiApi) NewGetVersionResponse() GetVersionResponse { func (api *gosnappiApi) GetLocalVersion() Version { if api.versionMeta.localVersion == nil { - api.versionMeta.localVersion = NewVersion().SetApiSpecVersion("0.13.1").SetSdkVersion("0.13.1") + api.versionMeta.localVersion = NewVersion().SetApiSpecVersion("0.13.2").SetSdkVersion("0.13.2") } return api.versionMeta.localVersion @@ -1341,6 +1341,8 @@ func (obj *configLagIter) appendHolderSlice(item Lag) ConfigLagIter { } // The layer1 settings that will be configured on the traffic generator. +// Since layer1 settings usually vary across variety of test ports, these +// most likely won't be portable. // Layer1 returns a []Layer1 func (obj *config) Layer1() ConfigLayer1Iter { if len(obj.obj.Layer1) == 0 { @@ -8271,7 +8273,8 @@ func (obj *layer1) Speed() Layer1SpeedEnum { return Layer1SpeedEnum(obj.obj.Speed.Enum().String()) } -// Set the speed if supported. +// Set the speed if supported. When no speed is explicitly set, the current +// speed of underlying test interface shall be assumed. // Speed returns a string func (obj *layer1) HasSpeed() bool { return obj.obj.Speed != nil @@ -8307,7 +8310,9 @@ func (obj *layer1) Media() Layer1MediaEnum { return Layer1MediaEnum(obj.obj.Media.Enum().String()) } -// Set the type of media interface if supported. +// Set the type of media for test interface if supported. When no media +// type is explicitly set, the current media type of underlying test +// interface shall be assumed. // Media returns a string func (obj *layer1) HasMedia() bool { return obj.obj.Media != nil @@ -8326,7 +8331,9 @@ func (obj *layer1) SetMedia(value Layer1MediaEnum) Layer1 { return obj } -// Enable promiscuous mode if supported. +// Enable promiscuous mode on test interface. A warning shall be raised if +// this field is set to `true`, even when it's not supported, ignoring +// the setting altogether. // Promiscuous returns a bool func (obj *layer1) Promiscuous() bool { @@ -8334,13 +8341,17 @@ func (obj *layer1) Promiscuous() bool { } -// Enable promiscuous mode if supported. +// Enable promiscuous mode on test interface. A warning shall be raised if +// this field is set to `true`, even when it's not supported, ignoring +// the setting altogether. // Promiscuous returns a bool func (obj *layer1) HasPromiscuous() bool { return obj.obj.Promiscuous != nil } -// Enable promiscuous mode if supported. +// Enable promiscuous mode on test interface. A warning shall be raised if +// this field is set to `true`, even when it's not supported, ignoring +// the setting altogether. // SetPromiscuous sets the bool value in the Layer1 object func (obj *layer1) SetPromiscuous(value bool) Layer1 { @@ -8348,7 +8359,8 @@ func (obj *layer1) SetPromiscuous(value bool) Layer1 { return obj } -// Set the maximum transmission unit size if supported. +// Set the maximum transmission unit size. A warning shall be raised if +// the specified value is valid but not supported, ignoring the setting altogether. // Mtu returns a uint32 func (obj *layer1) Mtu() uint32 { @@ -8356,13 +8368,15 @@ func (obj *layer1) Mtu() uint32 { } -// Set the maximum transmission unit size if supported. +// Set the maximum transmission unit size. A warning shall be raised if +// the specified value is valid but not supported, ignoring the setting altogether. // Mtu returns a uint32 func (obj *layer1) HasMtu() bool { return obj.obj.Mtu != nil } -// Set the maximum transmission unit size if supported. +// Set the maximum transmission unit size. A warning shall be raised if +// the specified value is valid but not supported, ignoring the setting altogether. // SetMtu sets the uint32 value in the Layer1 object func (obj *layer1) SetMtu(value uint32) Layer1 { @@ -8370,6 +8384,10 @@ func (obj *layer1) SetMtu(value uint32) Layer1 { return obj } +// Under Review: This field is currently under review for pending exploration on use cases +// +// Under Review: This field is currently under review for pending exploration on use cases +// // Set to true to override the auto_negotiate, link_training // and rs_fec settings for gigabit ethernet interfaces. // IeeeMediaDefaults returns a bool @@ -8379,6 +8397,10 @@ func (obj *layer1) IeeeMediaDefaults() bool { } +// Under Review: This field is currently under review for pending exploration on use cases +// +// Under Review: This field is currently under review for pending exploration on use cases +// // Set to true to override the auto_negotiate, link_training // and rs_fec settings for gigabit ethernet interfaces. // IeeeMediaDefaults returns a bool @@ -8386,6 +8408,10 @@ func (obj *layer1) HasIeeeMediaDefaults() bool { return obj.obj.IeeeMediaDefaults != nil } +// Under Review: This field is currently under review for pending exploration on use cases +// +// Under Review: This field is currently under review for pending exploration on use cases +// // Set to true to override the auto_negotiate, link_training // and rs_fec settings for gigabit ethernet interfaces. // SetIeeeMediaDefaults sets the bool value in the Layer1 object @@ -8395,6 +8421,10 @@ func (obj *layer1) SetIeeeMediaDefaults(value bool) Layer1 { return obj } +// Under Review: This field is currently under review for pending exploration on use cases, given that a separate configuration called `AutoNegotiation` already exists. +// +// Under Review: This field is currently under review for pending exploration on use cases, given that a separate configuration called `AutoNegotiation` already exists. +// // Enable/disable auto negotiation. // AutoNegotiate returns a bool func (obj *layer1) AutoNegotiate() bool { @@ -8403,12 +8433,20 @@ func (obj *layer1) AutoNegotiate() bool { } +// Under Review: This field is currently under review for pending exploration on use cases, given that a separate configuration called `AutoNegotiation` already exists. +// +// Under Review: This field is currently under review for pending exploration on use cases, given that a separate configuration called `AutoNegotiation` already exists. +// // Enable/disable auto negotiation. // AutoNegotiate returns a bool func (obj *layer1) HasAutoNegotiate() bool { return obj.obj.AutoNegotiate != nil } +// Under Review: This field is currently under review for pending exploration on use cases, given that a separate configuration called `AutoNegotiation` already exists. +// +// Under Review: This field is currently under review for pending exploration on use cases, given that a separate configuration called `AutoNegotiation` already exists. +// // Enable/disable auto negotiation. // SetAutoNegotiate sets the bool value in the Layer1 object func (obj *layer1) SetAutoNegotiate(value bool) Layer1 { @@ -8521,10 +8559,6 @@ func (obj *layer1) validateObj(vObj *validation, set_default bool) { } func (obj *layer1) setDefault() { - if obj.obj.Speed == nil { - obj.SetSpeed(Layer1Speed.SPEED_10_GBPS) - - } if obj.obj.Promiscuous == nil { obj.SetPromiscuous(true) } diff --git a/gosnappi/otg/otg.pb.go b/gosnappi/otg/otg.pb.go index a741221c..b61bc3d4 100644 --- a/gosnappi/otg/otg.pb.go +++ b/gosnappi/otg/otg.pb.go @@ -1,4 +1,4 @@ -// Open Traffic Generator API 0.13.1 +// Open Traffic Generator API 0.13.2 // Open Traffic Generator API defines a model-driven, vendor-neutral and standard // interface for emulating layer 2-7 network devices and generating test traffic. // @@ -17327,6 +17327,8 @@ type Config struct { // The LAGs that will be configured on the traffic generator. Lags []*Lag `protobuf:"bytes,2,rep,name=lags,proto3" json:"lags,omitempty"` // The layer1 settings that will be configured on the traffic generator. + // Since layer1 settings usually vary across variety of test ports, these + // most likely won't be portable. Layer1 []*Layer1 `protobuf:"bytes,3,rep,name=layer1,proto3" json:"layer1,omitempty"` // The capture settings that will be configured on the traffic generator. Captures []*Capture `protobuf:"bytes,4,rep,name=captures,proto3" json:"captures,omitempty"` @@ -18906,20 +18908,37 @@ type Layer1 struct { // x-constraint: // - /components/schemas/Port/properties/name PortNames []string `protobuf:"bytes,1,rep,name=port_names,json=portNames,proto3" json:"port_names,omitempty"` - // Set the speed if supported. - // default = Speed.Enum.speed_10_gbps + // Set the speed if supported. When no speed is explicitly set, the current + // speed of underlying test interface shall be assumed. Speed *Layer1_Speed_Enum `protobuf:"varint,2,opt,name=speed,proto3,enum=otg.Layer1_Speed_Enum,oneof" json:"speed,omitempty"` - // Set the type of media interface if supported. + // Set the type of media for test interface if supported. When no media + // type is explicitly set, the current media type of underlying test + // interface shall be assumed. Media *Layer1_Media_Enum `protobuf:"varint,3,opt,name=media,proto3,enum=otg.Layer1_Media_Enum,oneof" json:"media,omitempty"` - // Enable promiscuous mode if supported. + // Enable promiscuous mode on test interface. A warning shall be raised if + // this field is set to `true`, even when it's not supported, ignoring + // the setting altogether. // default = True Promiscuous *bool `protobuf:"varint,4,opt,name=promiscuous,proto3,oneof" json:"promiscuous,omitempty"` - // Set the maximum transmission unit size if supported. + // Set the maximum transmission unit size. A warning shall be raised if + // the specified value is valid but not supported, ignoring the setting altogether. // default = 1500 Mtu *uint32 `protobuf:"varint,5,opt,name=mtu,proto3,oneof" json:"mtu,omitempty"` + // Under Review: This field is currently under review for pending exploration on use + // cases + // + // Under Review: This field is currently under review for pending exploration on use + // cases + // // Set to true to override the auto_negotiate, link_training // and rs_fec settings for gigabit ethernet interfaces. IeeeMediaDefaults *bool `protobuf:"varint,6,opt,name=ieee_media_defaults,json=ieeeMediaDefaults,proto3,oneof" json:"ieee_media_defaults,omitempty"` + // Under Review: This field is currently under review for pending exploration on use + // cases, given that a separate configuration called `AutoNegotiation` already exists. + // + // Under Review: This field is currently under review for pending exploration on use + // cases, given that a separate configuration called `AutoNegotiation` already exists. + // // Enable/disable auto negotiation. AutoNegotiate *bool `protobuf:"varint,7,opt,name=auto_negotiate,json=autoNegotiate,proto3,oneof" json:"auto_negotiate,omitempty"` // Description missing in models diff --git a/gosnappi/otg/otg.proto b/gosnappi/otg/otg.proto index 4a6cab5f..8556f163 100644 --- a/gosnappi/otg/otg.proto +++ b/gosnappi/otg/otg.proto @@ -1,4 +1,4 @@ -/* Open Traffic Generator API 0.13.1 +/* Open Traffic Generator API 0.13.2 * Open Traffic Generator API defines a model-driven, vendor-neutral and standard * interface for emulating layer 2-7 network devices and generating test traffic. * @@ -28,6 +28,8 @@ message Config { repeated Lag lags = 2; // The layer1 settings that will be configured on the traffic generator. + // Since layer1 settings usually vary across variety of test ports, these + // most likely won't be portable. repeated Layer1 layer1 = 3; // The capture settings that will be configured on the traffic generator. @@ -509,8 +511,8 @@ message Layer1 { speed_400_gbps = 12; } } - // Set the speed if supported. - // default = Speed.Enum.speed_10_gbps + // Set the speed if supported. When no speed is explicitly set, the current + // speed of underlying test interface shall be assumed. optional Speed.Enum speed = 2; message Media { @@ -521,21 +523,38 @@ message Layer1 { sgmii = 3; } } - // Set the type of media interface if supported. + // Set the type of media for test interface if supported. When no media + // type is explicitly set, the current media type of underlying test + // interface shall be assumed. optional Media.Enum media = 3; - // Enable promiscuous mode if supported. + // Enable promiscuous mode on test interface. A warning shall be raised if + // this field is set to `true`, even when it's not supported, ignoring + // the setting altogether. // default = True optional bool promiscuous = 4; - // Set the maximum transmission unit size if supported. + // Set the maximum transmission unit size. A warning shall be raised if + // the specified value is valid but not supported, ignoring the setting altogether. // default = 1500 optional uint32 mtu = 5; + // Under Review: This field is currently under review for pending exploration on use + // cases + // + // Under Review: This field is currently under review for pending exploration on use + // cases + // // Set to true to override the auto_negotiate, link_training // and rs_fec settings for gigabit ethernet interfaces. optional bool ieee_media_defaults = 6; + // Under Review: This field is currently under review for pending exploration on use + // cases, given that a separate configuration called `AutoNegotiation` already exists. + // + // Under Review: This field is currently under review for pending exploration on use + // cases, given that a separate configuration called `AutoNegotiation` already exists. + // // Enable/disable auto negotiation. optional bool auto_negotiate = 7; diff --git a/requirements.txt b/requirements.txt index 86d986e6..f7bf412f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,11 +1,11 @@ --prefer-binary -grpcio~=1.54.2 ; python_version > '3.6' grpcio-tools~=1.35.0 ; python_version <= '3.6' grpcio-tools~=1.54.2 ; python_version > '3.6' grpcio~=1.35.0 ; python_version <= '3.6' -protobuf~=3.15.0 ; python_version <= '3.6' -protobuf~=4.23.3 ; python_version > '3.6' -PyYAML +grpcio~=1.54.2 ; python_version > '3.6' requests -semantic_version +PyYAML +protobuf~=4.23.3 ; python_version > '3.6' +protobuf~=3.15.0 ; python_version <= '3.6' urllib3 +semantic_version diff --git a/snappi/docs/openapi.yaml b/snappi/docs/openapi.yaml index 1d3a3c44..079b7579 100644 --- a/snappi/docs/openapi.yaml +++ b/snappi/docs/openapi.yaml @@ -7,7 +7,7 @@ info: \ issue](https://github.com/open-traffic-generator/models/issues) in the models\ \ repository\n- [fork the models repository](https://github.com/open-traffic-generator/models)\ \ and submit a PR" - version: 0.13.1 + version: 0.13.2 contact: url: https://github.com/open-traffic-generator/models license: @@ -256,6 +256,8 @@ components: layer1: description: |- The layer1 settings that will be configured on the traffic generator. + Since layer1 settings usually vary across variety of test ports, these + most likely won't be portable. type: array items: $ref: '#/components/schemas/Layer1' @@ -945,9 +947,9 @@ components: x-field-uid: 1 speed: description: |- - Set the speed if supported. + Set the speed if supported. When no speed is explicitly set, the current + speed of underlying test interface shall be assumed. type: string - default: speed_10_gbps x-field-uid: 2 x-enum: speed_10_fd_mbps: @@ -989,7 +991,9 @@ components: - speed_400_gbps media: description: |- - Set the type of media interface if supported. + Set the type of media for test interface if supported. When no media + type is explicitly set, the current media type of underlying test + interface shall be assumed. type: string x-field-uid: 3 x-enum: @@ -1005,13 +1009,16 @@ components: - sgmii promiscuous: description: |- - Enable promiscuous mode if supported. + Enable promiscuous mode on test interface. A warning shall be raised if + this field is set to `true`, even when it's not supported, ignoring + the setting altogether. type: boolean default: true x-field-uid: 4 mtu: description: |- - Set the maximum transmission unit size if supported. + Set the maximum transmission unit size. A warning shall be raised if + the specified value is valid but not supported, ignoring the setting altogether. type: integer format: uint32 minimum: 64 @@ -1020,15 +1027,32 @@ components: x-field-uid: 5 ieee_media_defaults: description: |- + Under Review: This field is currently under review for pending exploration on use cases + + Under Review: This field is currently under review for pending exploration on use cases + Set to true to override the auto_negotiate, link_training and rs_fec settings for gigabit ethernet interfaces. type: boolean x-field-uid: 6 + x-status: + status: under-review + information: This field is currently under review for pending exploration + on use cases auto_negotiate: description: |- + Under Review: This field is currently under review for pending exploration on use cases, given that a separate configuration called `AutoNegotiation` already exists. + + Under Review: This field is currently under review for pending exploration on use cases, given that a separate configuration called `AutoNegotiation` already exists. + Enable/disable auto negotiation. type: boolean x-field-uid: 7 + x-status: + status: under-review + information: This field is currently under review for pending exploration + on use cases, given that a separate configuration called `AutoNegotiation` + already exists. auto_negotiation: $ref: '#/components/schemas/Layer1.AutoNegotiation' x-field-uid: 8 diff --git a/snappi/snappi.py b/snappi/snappi.py index 5f07368d..053c24db 100644 --- a/snappi/snappi.py +++ b/snappi/snappi.py @@ -1,4 +1,4 @@ -# Open Traffic Generator API 0.13.1 +# Open Traffic Generator API 0.13.2 # License: MIT import importlib @@ -1148,7 +1148,7 @@ def layer1(self): # type: () -> Layer1Iter """layer1 getter - The layer1 settings that will be configured on the traffic generator. + The layer1 settings that will be configured on the traffic generator.. Since layer1 settings usually vary across variety of test ports, these. most likely won't be portable. Returns: Layer1Iter """ @@ -2433,7 +2433,6 @@ class Layer1(OpenApiObject): _REQUIRED = ("port_names", "name") # type: tuple(str) _DEFAULTS = { - "speed": "speed_10_gbps", "promiscuous": True, "mtu": 1500, } # type: Dict[str, Union(type)] @@ -2455,13 +2454,16 @@ class Layer1(OpenApiObject): FIBER = "fiber" # type: str SGMII = "sgmii" # type: str - _STATUS = {} # type: Dict[str, Union(type)] + _STATUS = { + "ieee_media_defaults": "ieee_media_defaults property in schema Layer1 is under-review, This field is currently under review for pending exploration on use cases", + "auto_negotiate": "auto_negotiate property in schema Layer1 is under-review, This field is currently under review for pending exploration on use cases, given that a separate configuration called `AutoNegotiation` already exists.", + } # type: Dict[str, Union(type)] def __init__( self, parent=None, port_names=None, - speed="speed_10_gbps", + speed=None, media=None, promiscuous=True, mtu=1500, @@ -2523,7 +2525,7 @@ def speed(self): # type: () -> Union[Literal["speed_100_fd_mbps"], Literal["speed_100_gbps"], Literal["speed_100_hd_mbps"], Literal["speed_10_fd_mbps"], Literal["speed_10_gbps"], Literal["speed_10_hd_mbps"], Literal["speed_1_gbps"], Literal["speed_200_gbps"], Literal["speed_25_gbps"], Literal["speed_400_gbps"], Literal["speed_40_gbps"], Literal["speed_50_gbps"]] """speed getter - Set the speed if supported. + Set the speed if supported. When no speed is explicitly set, the current. speed of underlying test interface shall be assumed. Returns: Union[Literal["speed_100_fd_mbps"], Literal["speed_100_gbps"], Literal["speed_100_hd_mbps"], Literal["speed_10_fd_mbps"], Literal["speed_10_gbps"], Literal["speed_10_hd_mbps"], Literal["speed_1_gbps"], Literal["speed_200_gbps"], Literal["speed_25_gbps"], Literal["speed_400_gbps"], Literal["speed_40_gbps"], Literal["speed_50_gbps"]] """ @@ -2533,7 +2535,7 @@ def speed(self): def speed(self, value): """speed setter - Set the speed if supported. + Set the speed if supported. When no speed is explicitly set, the current. speed of underlying test interface shall be assumed. value: Union[Literal["speed_100_fd_mbps"], Literal["speed_100_gbps"], Literal["speed_100_hd_mbps"], Literal["speed_10_fd_mbps"], Literal["speed_10_gbps"], Literal["speed_10_hd_mbps"], Literal["speed_1_gbps"], Literal["speed_200_gbps"], Literal["speed_25_gbps"], Literal["speed_400_gbps"], Literal["speed_40_gbps"], Literal["speed_50_gbps"]] """ @@ -2544,7 +2546,7 @@ def media(self): # type: () -> Union[Literal["copper"], Literal["fiber"], Literal["sgmii"]] """media getter - Set the type of media interface if supported. + Set the type of media for test interface if supported. When no media. type is explicitly set, the current media type of underlying test. interface shall be assumed. Returns: Union[Literal["copper"], Literal["fiber"], Literal["sgmii"]] """ @@ -2554,7 +2556,7 @@ def media(self): def media(self, value): """media setter - Set the type of media interface if supported. + Set the type of media for test interface if supported. When no media. type is explicitly set, the current media type of underlying test. interface shall be assumed. value: Union[Literal["copper"], Literal["fiber"], Literal["sgmii"]] """ @@ -2565,7 +2567,7 @@ def promiscuous(self): # type: () -> bool """promiscuous getter - Enable promiscuous mode if supported. + Enable promiscuous mode on test interface. warning shall be raised if. this field is set to `true`, even when it's not supported, ignoring. the setting altogether. Returns: bool """ @@ -2575,7 +2577,7 @@ def promiscuous(self): def promiscuous(self, value): """promiscuous setter - Enable promiscuous mode if supported. + Enable promiscuous mode on test interface. warning shall be raised if. this field is set to `true`, even when it's not supported, ignoring. the setting altogether. value: bool """ @@ -2586,7 +2588,7 @@ def mtu(self): # type: () -> int """mtu getter - Set the maximum transmission unit size if supported. + Set the maximum transmission unit size. warning shall be raised if. the specified value is valid but not supported, ignoring the setting altogether. Returns: int """ @@ -2596,7 +2598,7 @@ def mtu(self): def mtu(self, value): """mtu setter - Set the maximum transmission unit size if supported. + Set the maximum transmission unit size. warning shall be raised if. the specified value is valid but not supported, ignoring the setting altogether. value: int """ @@ -2607,7 +2609,7 @@ def ieee_media_defaults(self): # type: () -> bool """ieee_media_defaults getter - Set to true to override the auto_negotiate, link_training. and rs_fec settings for gigabit ethernet interfaces. + Under Review: This field is currently under review for pending exploration on use cases. Under Review: This field is currently under review for pending exploration on use cases. Set to true to override the auto_negotiate, link_training. and rs_fec settings for gigabit ethernet interfaces. Returns: bool """ @@ -2617,7 +2619,7 @@ def ieee_media_defaults(self): def ieee_media_defaults(self, value): """ieee_media_defaults setter - Set to true to override the auto_negotiate, link_training. and rs_fec settings for gigabit ethernet interfaces. + Under Review: This field is currently under review for pending exploration on use cases. Under Review: This field is currently under review for pending exploration on use cases. Set to true to override the auto_negotiate, link_training. and rs_fec settings for gigabit ethernet interfaces. value: bool """ @@ -2628,7 +2630,7 @@ def auto_negotiate(self): # type: () -> bool """auto_negotiate getter - Enable/disable auto negotiation. + Under Review: This field is currently under review for pending exploration on use cases, given that separate configuration called `AutoNegotiation` already exists.. Under Review: This field is currently under review for pending exploration on use cases, given that separate configuration called `AutoNegotiation` already exists.. Enable/disable auto negotiation. Returns: bool """ @@ -2638,7 +2640,7 @@ def auto_negotiate(self): def auto_negotiate(self, value): """auto_negotiate setter - Enable/disable auto negotiation. + Under Review: This field is currently under review for pending exploration on use cases, given that separate configuration called `AutoNegotiation` already exists.. Under Review: This field is currently under review for pending exploration on use cases, given that separate configuration called `AutoNegotiation` already exists.. Enable/disable auto negotiation. value: bool """ @@ -3363,7 +3365,7 @@ def _instanceOf(self, item): def layer1( self, port_names=None, - speed="speed_10_gbps", + speed=None, media=None, promiscuous=True, mtu=1500, @@ -3395,7 +3397,7 @@ def layer1( def add( self, port_names=None, - speed="speed_10_gbps", + speed=None, media=None, promiscuous=True, mtu=1500, @@ -111684,8 +111686,8 @@ class Api(object): def __init__(self, **kwargs): self._version_meta = self.version() - self._version_meta.api_spec_version = "0.13.1" - self._version_meta.sdk_version = "0.13.1" + self._version_meta.api_spec_version = "0.13.2" + self._version_meta.sdk_version = "0.13.2" self._version_check = kwargs.get("version_check") if self._version_check is None: self._version_check = False diff --git a/tests/test_defaults.py b/tests/test_defaults.py index 4413deb3..40d962b8 100644 --- a/tests/test_defaults.py +++ b/tests/test_defaults.py @@ -1,112 +1,106 @@ def test_defaults(api): defaults = { - 'flows': [ + "flows": [ { - 'tx_rx': { - 'choice': 'port', - 'port': { - 'tx_name': 'ptest', - } - }, - 'name': "f1", - 'size': { - 'choice': 'fixed', - 'fixed': 64 - }, - 'rate': { - 'choice': 'pps', # default choice is pps - 'pps': "1000" + "tx_rx": { + "choice": "port", + "port": { + "tx_name": "ptest", + }, }, - 'packet': [ + "name": "f1", + "size": {"choice": "fixed", "fixed": 64}, + "rate": {"choice": "pps", "pps": "1000"}, # default choice is pps + "packet": [ { - 'choice': 'ethernet', - 'ethernet': { - 'dst': { - 'choice': 'auto', - 'auto': '00:00:00:00:00:00', + "choice": "ethernet", + "ethernet": { + "dst": { + "choice": "auto", + "auto": "00:00:00:00:00:00", }, - 'src': { - 'choice': 'values', - 'values': ['00:00:00:00:00:00'], + "src": { + "choice": "values", + "values": ["00:00:00:00:00:00"], + }, + "ether_type": { + "auto": 65535, + "choice": "auto", }, - 'ether_type': { - 'auto': 65535, - 'choice': 'auto', - } }, }, { - 'choice': 'ipv4', - 'ipv4': { - 'src': { - 'choice': 'increment', - 'increment': { - 'count': 1, - 'start': '0.0.0.0', - 'step': '0.0.0.1' + "choice": "ipv4", + "ipv4": { + "src": { + "choice": "increment", + "increment": { + "count": 1, + "start": "0.0.0.0", + "step": "0.0.0.1", }, } - } - - } - ] + }, + }, + ], } ], - 'lags': [ + "lags": [ { - 'name': "abc", - 'protocol': { - 'choice': 'lacp', # default choice is lacp - 'lacp': { - 'actor_key': 0, - 'actor_system_id': '00:00:00:00:00:00', - 'actor_system_priority': 0, - } + "name": "abc", + "protocol": { + "choice": "lacp", # default choice is lacp + "lacp": { + "actor_key": 0, + "actor_system_id": "00:00:00:00:00:00", + "actor_system_priority": 0, + }, }, - 'ports': [ + "ports": [ { - 'port_name': 'lagport', - 'lacp': { - 'actor_activity': 'active', - 'actor_port_number': 0, - 'actor_port_priority': 1, - 'lacpdu_periodic_time_interval': 0, - 'lacpdu_timeout': 0 + "port_name": "lagport", + "lacp": { + "actor_activity": "active", + "actor_port_number": 0, + "actor_port_priority": 1, + "lacpdu_periodic_time_interval": 0, + "lacpdu_timeout": 0, + }, + "ethernet": { + "mac": "00:00:00:00:00:00", + "mtu": 1500, + "name": "test", }, - 'ethernet': { - 'mac': '00:00:00:00:00:00', 'mtu': 1500, 'name': 'test' - } } ], - "min_links": 1 + "min_links": 1, } ], - 'layer1': [ + "layer1": [ { - 'auto_negotiate': True, - 'ieee_media_defaults': True, - 'mtu': 1500, - 'name': "abc", - 'port_names': ["test"], - 'promiscuous': True, - 'speed': 'speed_10_gbps', - 'flow_control': { - 'choice': 'ieee_802_1qbb', - 'directed_address': '01:80:C2:00:00:01', - 'ieee_802_1qbb': { - 'pfc_class_0': 0, - 'pfc_class_1': 1, - 'pfc_class_2': 2, - 'pfc_class_3': 3, - 'pfc_class_4': 4, - 'pfc_class_5': 5, - 'pfc_class_6': 6, - 'pfc_class_7': 7, - 'pfc_delay': 0 - } - } + "auto_negotiate": True, + "ieee_media_defaults": True, + "mtu": 1500, + "name": "abc", + "port_names": ["test"], + "promiscuous": True, + "flow_control": { + "choice": "ieee_802_1qbb", + "directed_address": "01:80:C2:00:00:01", + "ieee_802_1qbb": { + "pfc_class_0": 0, + "pfc_class_1": 1, + "pfc_class_2": 2, + "pfc_class_3": 3, + "pfc_class_4": 4, + "pfc_class_5": 5, + "pfc_class_6": 6, + "pfc_class_7": 7, + "pfc_delay": 0, + }, + }, } - ] + ], } config = api.config() layer1 = config.layer1.layer1()[-1] @@ -138,76 +132,66 @@ def test_defaults(api): def test_defaults_by_deserialize(api): defaults = { - 'flows': [ + "flows": [ { - 'tx_rx': { - 'choice': 'port', - 'port': { - 'tx_name': 'ptest', - 'rx_name': None - } - }, - 'name': "f1", - 'size': { - 'choice': 'fixed', - 'fixed': 64 + "tx_rx": { + "choice": "port", + "port": {"tx_name": "ptest", "rx_name": None}, }, - 'rate': { - 'choice': 'pps', - 'pps': None # defaults to a value - } + "name": "f1", + "size": {"choice": "fixed", "fixed": 64}, + "rate": {"choice": "pps", "pps": None}, # defaults to a value } ], - 'lags': [ + "lags": [ { - 'name': "abc", - 'protocol': { - 'choice': 'lacp', # default choice is lacp - 'lacp': { - 'actor_key': 0, - 'actor_system_id': '00:00:00:00:00:00', - 'actor_system_priority': 0, - } + "name": "abc", + "protocol": { + "choice": "lacp", # default choice is lacp + "lacp": { + "actor_key": 0, + "actor_system_id": "00:00:00:00:00:00", + "actor_system_priority": 0, + }, }, - 'ports': [ + "ports": [ { - 'port_name': 'lagport', - 'lacp': { - 'actor_activity': 'active', - 'actor_port_number': None, #default is 0 - 'actor_port_priority': 1, - 'lacpdu_periodic_time_interval': 0, - 'lacpdu_timeout': 0 + "port_name": "lagport", + "lacp": { + "actor_activity": "active", + "actor_port_number": None, # default is 0 + "actor_port_priority": 1, + "lacpdu_periodic_time_interval": 0, + "lacpdu_timeout": 0, + }, + "ethernet": { + "mac": "00:00:00:00:00:00", + "mtu": 1500, + "name": "test", }, - 'ethernet': { - 'mac': '00:00:00:00:00:00', 'mtu': 1500, 'name': 'test' - } } ], - "min_links": 1 + "min_links": 1, } ], - 'layer1': [ + "layer1": [ { - 'auto_negotiate': True, - 'ieee_media_defaults': True, - 'mtu': 1500, - 'name': "abc", - 'port_names': ["test"], - 'promiscuous': True, - 'speed': 'speed_10_gbps', - 'flow_control': { - 'directed_address': '01:80:C2:00:00:01' - } + "auto_negotiate": True, + "ieee_media_defaults": True, + "mtu": 1500, + "name": "abc", + "port_names": ["test"], + "promiscuous": True, + "flow_control": {"directed_address": "01:80:C2:00:00:01"}, } - ] + ], } config = api.config() config.deserialize(defaults) assert config.layer1[0].mtu == 1500 - assert config.layer1[0].flow_control.directed_address == '01:80:C2:00:00:01' - assert config.lags[0].protocol.choice == 'lacp' + assert config.layer1[0].flow_control.directed_address == "01:80:C2:00:00:01" + assert config.lags[0].protocol.choice == "lacp" assert config.lags[0].ports[0].lacp.actor_port_number == 0 assert config.lags[0].ports[0].lacp.actor_port_priority == 1 - assert config.lags[0].protocol.lacp.actor_system_id == '00:00:00:00:00:00' + assert config.lags[0].protocol.lacp.actor_system_id == "00:00:00:00:00:00" diff --git a/version.py b/version.py index b23d00a9..b1bca49e 100644 --- a/version.py +++ b/version.py @@ -2,8 +2,8 @@ class Version: - models_version = "0.13.1" - version = "0.13.1" + models_version = "0.13.2" + version = "0.13.2" package_name = "snappi" protobuf_name = "otg" go_package_name = "gosnappi"