Commit b20b6dc3 authored by Konstantinos Poulakakis's avatar Konstantinos Poulakakis
Browse files

Merge branch 'develop' into feat/112-ubi-refactor-policy

# Conflicts:
#	src/policy/target/generated-sources/grpc/context/ContextOuterClass.java
#	src/policy/target/kubernetes/kubernetes.yml
parents bb834403 c4288010
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -202,6 +202,7 @@ enum DeviceDriverEnum {
  DEVICEDRIVER_IETF_L2VPN = 7;
  DEVICEDRIVER_GNMI_OPENCONFIG = 8;
  DEVICEDRIVER_FLEXSCALE = 9;
  DEVICEDRIVER_IETF_ACTN = 10;
}

enum DeviceOperationalStatusEnum {
+32 −0
Original line number Diff line number Diff line
#!/bin/bash -eu    
# 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.
    
    
export JAVA_COMPONENTS="ztp policy"

export TFS_ROOT_DIR=$(dirname $(dirname $(realpath $0)))
    
for COMPONENT in $JAVA_COMPONENTS; do
  echo "\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/"
  echo
  echo "[TFS] Now building" $COMPONENT
  echo
  echo "\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/"
  cd $TFS_ROOT_DIR/src/$COMPONENT
    
  ./mvnw spotless:apply
  ./mvnw install -DskipUTs
done
+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
+2 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ class DeviceTypeEnum(Enum):
    # Emulated device types
    EMULATED_CLIENT                 = 'emu-client'
    EMULATED_DATACENTER             = 'emu-datacenter'
    EMULATED_IP_SDN_CONTROLLER      = 'emu-ip-sdn-controller'
    EMULATED_MICROWAVE_RADIO_SYSTEM = 'emu-microwave-radio-system'
    EMULATED_OPEN_LINE_SYSTEM       = 'emu-open-line-system'
    EMULATED_OPTICAL_ROADM          = 'emu-optical-roadm'
@@ -36,6 +37,7 @@ class DeviceTypeEnum(Enum):
    # Real device types
    CLIENT                          = 'client'
    DATACENTER                      = 'datacenter'
    IP_SDN_CONTROLLER               = 'ip-sdn-controller'
    MICROWAVE_RADIO_SYSTEM          = 'microwave-radio-system'
    OPEN_LINE_SYSTEM                = 'open-line-system'
    OPTICAL_ROADM                   = 'optical-roadm'
+20 −14
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ from slice.client.SliceClient import SliceClient
from .Tools import (
    format_device_custom_config_rules, format_service_custom_config_rules, format_slice_custom_config_rules,
    get_descriptors_add_contexts, get_descriptors_add_services, get_descriptors_add_slices,
    get_descriptors_add_topologies, split_devices_by_rules)
    get_descriptors_add_topologies, split_controllers_and_network_devices, split_devices_by_rules)

LOGGER = logging.getLogger(__name__)
LOGGERS = {
@@ -59,6 +59,7 @@ ENTITY_TO_TEXT = {
    # name      => singular,     plural
    'context'   : ('Context',    'Contexts'   ),
    'topology'  : ('Topology',   'Topologies' ),
    'controller': ('Controller', 'Controllers'),
    'device'    : ('Device',     'Devices'    ),
    'link'      : ('Link',       'Links'      ),
    'service'   : ('Service',    'Services'   ),
@@ -231,10 +232,12 @@ class DescriptorLoader:

    def _load_dummy_mode(self) -> None:
        # Dummy Mode: used to pre-load databases (WebUI debugging purposes) with no smart or automated tasks.
        controllers, network_devices = split_controllers_and_network_devices(self.__devices)
        self.__ctx_cli.connect()
        self._process_descr('context',    'add',    self.__ctx_cli.SetContext,    Context,    self.__contexts_add  )
        self._process_descr('topology',   'add',    self.__ctx_cli.SetTopology,   Topology,   self.__topologies_add)
        self._process_descr('device',     'add',    self.__ctx_cli.SetDevice,     Device,     self.__devices       )
        self._process_descr('controller', 'add',    self.__ctx_cli.SetDevice,     Device,     controllers          )
        self._process_descr('device',     'add',    self.__ctx_cli.SetDevice,     Device,     network_devices      )
        self._process_descr('link',       'add',    self.__ctx_cli.SetLink,       Link,       self.__links         )
        self._process_descr('service',    'add',    self.__ctx_cli.SetService,    Service,    self.__services      )
        self._process_descr('slice',      'add',    self.__ctx_cli.SetSlice,      Slice,      self.__slices        )
@@ -262,6 +265,8 @@ class DescriptorLoader:
        self.__services_add = get_descriptors_add_services(self.__services)
        self.__slices_add = get_descriptors_add_slices(self.__slices)

        controllers_add, network_devices_add = split_controllers_and_network_devices(self.__devices_add)

        self.__ctx_cli.connect()
        self.__dev_cli.connect()
        self.__svc_cli.connect()
@@ -269,7 +274,8 @@ class DescriptorLoader:

        self._process_descr('context',    'add',    self.__ctx_cli.SetContext,      Context,  self.__contexts_add  )
        self._process_descr('topology',   'add',    self.__ctx_cli.SetTopology,     Topology, self.__topologies_add)
        self._process_descr('device',   'add',    self.__dev_cli.AddDevice,       Device,   self.__devices_add   )
        self._process_descr('controller', 'add',    self.__dev_cli.AddDevice,       Device,   controllers_add      )
        self._process_descr('device',     'add',    self.__dev_cli.AddDevice,       Device,   network_devices_add  )
        self._process_descr('device',     'config', self.__dev_cli.ConfigureDevice, Device,   self.__devices_config)
        self._process_descr('link',       'add',    self.__ctx_cli.SetLink,         Link,     self.__links         )
        self._process_descr('service',    'add',    self.__svc_cli.CreateService,   Service,  self.__services_add  )
Loading