Loading proto/context.proto +1 −0 Original line number Diff line number Diff line Loading @@ -202,6 +202,7 @@ enum DeviceDriverEnum { DEVICEDRIVER_IETF_L2VPN = 7; DEVICEDRIVER_GNMI_OPENCONFIG = 8; DEVICEDRIVER_FLEXSCALE = 9; DEVICEDRIVER_IETF_ACTN = 10; } enum DeviceOperationalStatusEnum { Loading scripts/run_tests_locally-device-ietf-actn.sh 0 → 100755 +25 −0 Original line number Diff line number Diff line #!/bin/bash # Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. PROJECTDIR=`pwd` cd $PROJECTDIR/src RCFILE=$PROJECTDIR/coverage/.coveragerc # Run unitary tests and analyze coverage of code at same time # helpful pytest flags: --log-level=INFO -o log_cli=true --verbose --maxfail=1 --durations=0 coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ device/tests/test_unitary_ietf_actn.py src/common/tools/object_factory/Device.py +12 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,10 @@ DEVICE_P4_DRIVERS = [DeviceDriverEnum.DEVICEDRIVER_P4] DEVICE_TFS_TYPE = DeviceTypeEnum.TERAFLOWSDN_CONTROLLER.value DEVICE_TFS_DRIVERS = [DeviceDriverEnum.DEVICEDRIVER_IETF_L2VPN] DEVICE_IETF_ACTN_TYPE = DeviceTypeEnum.OPEN_LINE_SYSTEM.value DEVICE_IETF_ACTN_DRIVERS = [DeviceDriverEnum.DEVICEDRIVER_IETF_ACTN] def json_device_id(device_uuid : str): return {'device_uuid': {'uuid': device_uuid}} Loading Loading @@ -136,6 +140,14 @@ def json_device_tfs_disabled( device_uuid, DEVICE_TFS_TYPE, DEVICE_DISABLED, name=name, endpoints=endpoints, config_rules=config_rules, drivers=drivers) def json_device_ietf_actn_disabled( device_uuid : str, name : Optional[str] = None, endpoints : List[Dict] = [], config_rules : List[Dict] = [], drivers : List[Dict] = DEVICE_IETF_ACTN_DRIVERS ): return json_device( device_uuid, DEVICE_IETF_ACTN_TYPE, DEVICE_DISABLED, name=name, endpoints=endpoints, config_rules=config_rules, drivers=drivers) def json_device_connect_rules(address : str, port : int, settings : Dict = {}) -> List[Dict]: return [ json_config_rule_set('_connect/address', address), Loading src/common/type_checkers/Assertions.py +1 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ def validate_device_driver_enum(message): 'DEVICEDRIVER_IETF_L2VPN', 'DEVICEDRIVER_GNMI_OPENCONFIG', 'DEVICEDRIVER_FLEXSCALE', 'DEVICEDRIVER_IETF_ACTN', ] def validate_device_operational_status_enum(message): Loading src/context/service/database/models/enums/DeviceDriver.py +1 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ class ORM_DeviceDriverEnum(enum.Enum): IETF_L2VPN = DeviceDriverEnum.DEVICEDRIVER_IETF_L2VPN GNMI_OPENCONFIG = DeviceDriverEnum.DEVICEDRIVER_GNMI_OPENCONFIG FLEXSCALE = DeviceDriverEnum.DEVICEDRIVER_FLEXSCALE IETF_ACTN = DeviceDriverEnum.DEVICEDRIVER_IETF_ACTN grpc_to_enum__device_driver = functools.partial( grpc_to_enum, DeviceDriverEnum, ORM_DeviceDriverEnum) Loading
proto/context.proto +1 −0 Original line number Diff line number Diff line Loading @@ -202,6 +202,7 @@ enum DeviceDriverEnum { DEVICEDRIVER_IETF_L2VPN = 7; DEVICEDRIVER_GNMI_OPENCONFIG = 8; DEVICEDRIVER_FLEXSCALE = 9; DEVICEDRIVER_IETF_ACTN = 10; } enum DeviceOperationalStatusEnum { Loading
scripts/run_tests_locally-device-ietf-actn.sh 0 → 100755 +25 −0 Original line number Diff line number Diff line #!/bin/bash # Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. PROJECTDIR=`pwd` cd $PROJECTDIR/src RCFILE=$PROJECTDIR/coverage/.coveragerc # Run unitary tests and analyze coverage of code at same time # helpful pytest flags: --log-level=INFO -o log_cli=true --verbose --maxfail=1 --durations=0 coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \ device/tests/test_unitary_ietf_actn.py
src/common/tools/object_factory/Device.py +12 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,10 @@ DEVICE_P4_DRIVERS = [DeviceDriverEnum.DEVICEDRIVER_P4] DEVICE_TFS_TYPE = DeviceTypeEnum.TERAFLOWSDN_CONTROLLER.value DEVICE_TFS_DRIVERS = [DeviceDriverEnum.DEVICEDRIVER_IETF_L2VPN] DEVICE_IETF_ACTN_TYPE = DeviceTypeEnum.OPEN_LINE_SYSTEM.value DEVICE_IETF_ACTN_DRIVERS = [DeviceDriverEnum.DEVICEDRIVER_IETF_ACTN] def json_device_id(device_uuid : str): return {'device_uuid': {'uuid': device_uuid}} Loading Loading @@ -136,6 +140,14 @@ def json_device_tfs_disabled( device_uuid, DEVICE_TFS_TYPE, DEVICE_DISABLED, name=name, endpoints=endpoints, config_rules=config_rules, drivers=drivers) def json_device_ietf_actn_disabled( device_uuid : str, name : Optional[str] = None, endpoints : List[Dict] = [], config_rules : List[Dict] = [], drivers : List[Dict] = DEVICE_IETF_ACTN_DRIVERS ): return json_device( device_uuid, DEVICE_IETF_ACTN_TYPE, DEVICE_DISABLED, name=name, endpoints=endpoints, config_rules=config_rules, drivers=drivers) def json_device_connect_rules(address : str, port : int, settings : Dict = {}) -> List[Dict]: return [ json_config_rule_set('_connect/address', address), Loading
src/common/type_checkers/Assertions.py +1 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ def validate_device_driver_enum(message): 'DEVICEDRIVER_IETF_L2VPN', 'DEVICEDRIVER_GNMI_OPENCONFIG', 'DEVICEDRIVER_FLEXSCALE', 'DEVICEDRIVER_IETF_ACTN', ] def validate_device_operational_status_enum(message): Loading
src/context/service/database/models/enums/DeviceDriver.py +1 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ class ORM_DeviceDriverEnum(enum.Enum): IETF_L2VPN = DeviceDriverEnum.DEVICEDRIVER_IETF_L2VPN GNMI_OPENCONFIG = DeviceDriverEnum.DEVICEDRIVER_GNMI_OPENCONFIG FLEXSCALE = DeviceDriverEnum.DEVICEDRIVER_FLEXSCALE IETF_ACTN = DeviceDriverEnum.DEVICEDRIVER_IETF_ACTN grpc_to_enum__device_driver = functools.partial( grpc_to_enum, DeviceDriverEnum, ORM_DeviceDriverEnum)