Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • tfs/controller
1 result
Show changes
Commits on Source (3)
  • Lluis Gifre Renom's avatar
    Monitoring component: · d1c72678
    Lluis Gifre Renom authored
    - added wait control while MonitoringDB is starting
    d1c72678
  • Lluis Gifre Renom's avatar
    Service component: · 26169a15
    Lluis Gifre Renom authored
    - Corrected delete config rules in L2NMEmulated/L3NMEmulated/TAPI Service Handlers.
    - Commented unneeded settings in L2NMEmulatedServiceHandler Config Rules
    26169a15
  • Lluis Gifre Renom's avatar
    ECOC'22 functional test: · 61eff2eb
    Lluis Gifre Renom authored
    - Fixed endpoint UUIDs of OLS device, otherwise cleanup crashes due to different endpoint UUIDs randomly generated.
    - Fixed create/delete service tests
    61eff2eb
......@@ -190,7 +190,17 @@ for EXTRA_MANIFEST in $TFS_EXTRA_MANIFESTS; do
printf "\n"
done
# By now, leave this control here. Some component dependencies are not well handled
# By now, leave these controls here. Some component dependencies are not well handled.
if [[ "$TFS_COMPONENTS" == *"monitoring"* ]]; then
echo "Waiting for 'MonitoringDB' component..."
# Kubernetes does not implement --for='condition=available' for statefulsets.
# By now, we assume a single replica of monitoringdb. To be updated in future releases.
kubectl wait --namespace $TFS_K8S_NAMESPACE \
--for=jsonpath='{.status.readyReplicas}'=1 --timeout=300s statefulset/monitoringdb
printf "\n"
fi
for COMPONENT in $TFS_COMPONENTS; do
echo "Waiting for '$COMPONENT' component..."
kubectl wait --namespace $TFS_K8S_NAMESPACE \
......
......@@ -79,10 +79,10 @@ def teardown_config_rules(
service_settings : TreeNode, endpoint_settings : TreeNode
) -> List[Dict]:
json_settings : Dict = {} if service_settings is None else service_settings.value
#json_settings : Dict = {} if service_settings is None else service_settings.value
json_endpoint_settings : Dict = {} if endpoint_settings is None else endpoint_settings.value
mtu = json_settings.get('mtu', 1450 ) # 1512
#mtu = json_settings.get('mtu', 1450 ) # 1512
#address_families = json_settings.get('address_families', [] ) # ['IPV4']
#bgp_as = json_settings.get('bgp_as', 0 ) # 65000
#bgp_route_target = json_settings.get('bgp_route_target', '0:0') # 65000:333
......@@ -90,10 +90,10 @@ def teardown_config_rules(
router_id = json_endpoint_settings.get('router_id', '0.0.0.0') # '10.95.0.10'
#route_distinguisher = json_endpoint_settings.get('route_distinguisher', '0:0' ) # '60001:801'
sub_interface_index = json_endpoint_settings.get('sub_interface_index', 0 ) # 1
vlan_id = json_endpoint_settings.get('vlan_id', 1 ) # 400
#vlan_id = json_endpoint_settings.get('vlan_id', 1 ) # 400
#address_ip = json_endpoint_settings.get('address_ip', '0.0.0.0') # '2.2.2.1'
#address_prefix = json_endpoint_settings.get('address_prefix', 24 ) # 30
remote_router = json_endpoint_settings.get('remote_router', '0.0.0.0') # '5.5.5.5'
#remote_router = json_endpoint_settings.get('remote_router', '0.0.0.0') # '5.5.5.5'
circuit_id = json_endpoint_settings.get('circuit_id', '000' ) # '111'
if_cirid_name = '{:s}.{:s}'.format(endpoint_uuid, str(circuit_id))
......
......@@ -69,6 +69,7 @@ class L2NMEmulatedServiceHandler(_ServiceHandler):
service_uuid, connection_uuid, device_uuid, endpoint_uuid, settings, endpoint_settings)
device = self.__task_executor.get_device(DeviceId(**json_device_id(device_uuid)))
del device.device_config.config_rules[:]
for json_config_rule in json_config_rules:
device.device_config.config_rules.append(ConfigRule(**json_config_rule))
self.__task_executor.configure_device(device)
......@@ -102,6 +103,7 @@ class L2NMEmulatedServiceHandler(_ServiceHandler):
service_uuid, connection_uuid, device_uuid, endpoint_uuid, settings, endpoint_settings)
device = self.__task_executor.get_device(DeviceId(**json_device_id(device_uuid)))
del device.device_config.config_rules[:]
for json_config_rule in json_config_rules:
device.device_config.config_rules.append(ConfigRule(**json_config_rule))
self.__task_executor.configure_device(device)
......
......@@ -69,6 +69,7 @@ class L3NMEmulatedServiceHandler(_ServiceHandler):
service_uuid, connection_uuid, device_uuid, endpoint_uuid, settings, endpoint_settings)
device = self.__task_executor.get_device(DeviceId(**json_device_id(device_uuid)))
del device.device_config.config_rules[:]
for json_config_rule in json_config_rules:
device.device_config.config_rules.append(ConfigRule(**json_config_rule))
self.__task_executor.configure_device(device)
......@@ -102,6 +103,7 @@ class L3NMEmulatedServiceHandler(_ServiceHandler):
service_uuid, connection_uuid, device_uuid, endpoint_uuid, settings, endpoint_settings)
device = self.__task_executor.get_device(DeviceId(**json_device_id(device_uuid)))
del device.device_config.config_rules[:]
for json_config_rule in json_config_rules:
device.device_config.config_rules.append(ConfigRule(**json_config_rule))
self.__task_executor.configure_device(device)
......
......@@ -106,6 +106,7 @@ class TapiServiceHandler(_ServiceHandler):
device_uuid = endpoints[0][0]
device = self.__task_executor.get_device(DeviceId(**json_device_id(device_uuid)))
json_config_rule = json_config_rule_delete('/service[{:s}]'.format(service_uuid), {'uuid': service_uuid})
del device.device_config.config_rules[:]
device.device_config.config_rules.append(ConfigRule(**json_config_rule))
self.__task_executor.configure_device(device)
results.append(True)
......
......@@ -115,7 +115,8 @@ DEV_CS2GW1_ID, DEV_CS2GW1_EPS, DEV_CS2GW1 = compose_router('CS2-GW1', ['10/1', '
DEV_CS2GW2_ID, DEV_CS2GW2_EPS, DEV_CS2GW2 = compose_router('CS2-GW2', ['10/1', '1/1'])
# Transport Network
tols_ep_uuids = [str(uuid.uuid4()).split('-')[-1] for _ in range(4)]
#tols_ep_uuids = [str(uuid.uuid4()).split('-')[-1] for _ in range(4)]
tols_ep_uuids = ['afd8ffbb5403', '04b84e213e83', '3169ae676ac6', '93506f786270']
DEV_TOLS_ID, DEV_TOLS_EPS, DEV_TOLS = compose_ols('TN-OLS', tols_ep_uuids)
......
......@@ -119,7 +119,9 @@ DEV_TNR1_ID, DEV_TNR1_EPS, DEV_TNR1 = compose_router('TN-R1', ['1/1', '1/2', '2/
DEV_TNR2_ID, DEV_TNR2_EPS, DEV_TNR2 = compose_router('TN-R2', ['1/1', '1/2', '2/1'])
DEV_TNR3_ID, DEV_TNR3_EPS, DEV_TNR3 = compose_router('TN-R3', ['1/1', '1/2', '2/1'])
DEV_TNR4_ID, DEV_TNR4_EPS, DEV_TNR4 = compose_router('TN-R4', ['1/1', '1/2', '2/1'])
tols_ep_uuids = [str(uuid.uuid4()).split('-')[-1] for _ in range(4)]
#tols_ep_uuids = [str(uuid.uuid4()).split('-')[-1] for _ in range(4)]
tols_ep_uuids = ['afd8ffbb5403', '04b84e213e83', '3169ae676ac6', '93506f786270']
DEV_TOLS_ID, DEV_TOLS_EPS, DEV_TOLS = compose_ols('TN-OLS', tols_ep_uuids)
......
......@@ -13,7 +13,7 @@
# limitations under the License.
import logging
from common.proto.context_pb2 import ContextId, Empty
from common.proto.context_pb2 import ContextId, Empty, ServiceTypeEnum
from common.tools.grpc.Tools import grpc_message_to_json_string
from compute.tests.mock_osm.MockOSM import MockOSM
from context.client.ContextClient import ContextClient
......@@ -72,10 +72,13 @@ def test_scenario_service_created(context_client : ContextClient): # pylint: di
response = context_client.ListServices(ContextId(**CONTEXT_ID))
LOGGER.info('Services[{:d}] = {:s}'.format(len(response.services), grpc_message_to_json_string(response)))
assert len(response.services) == 1 # L2NM
assert len(response.services) == 3 # 1xL2NM + 2xTAPI
for service in response.services:
service_id = service.service_id
response = context_client.ListConnections(service_id)
LOGGER.info(' ServiceId[{:s}] => Connections[{:d}] = {:s}'.format(
grpc_message_to_json_string(service_id), len(response.connections), grpc_message_to_json_string(response)))
assert len(response.connections) == 2 # 2 connections per service (primary + backup)
if service.service_type == ServiceTypeEnum.SERVICETYPE_L2NM:
assert len(response.connections) == 2 # 2 connections per service (primary + backup)
elif service.service_type == ServiceTypeEnum.SERVICETYPE_TAPI_CONNECTIVITY_SERVICE:
assert len(response.connections) == 1 # 1 connection per service
......@@ -30,7 +30,7 @@ from .Fixtures import context_client, osm_wim
# CONTEXT_ID, CONTEXTS, DEVICES, LINKS, TOPOLOGIES, WIM_SERVICE_CONNECTION_POINTS, WIM_SERVICE_TYPE)
#from .Objects_DC_CSGW_TN_OLS import (
# CONTEXT_ID, CONTEXTS, DEVICES, LINKS, TOPOLOGIES, WIM_SERVICE_CONNECTION_POINTS, WIM_SERVICE_TYPE)
from .Objects_DC_CSGW_TN_OLS import (
from .Objects_DC_CSGW_OLS import (
CONTEXT_ID, CONTEXTS, DEVICES, LINKS, TOPOLOGIES, WIM_SERVICE_CONNECTION_POINTS, WIM_SERVICE_TYPE)
LOGGER = logging.getLogger(__name__)
......@@ -55,13 +55,16 @@ def test_scenario_is_correct(context_client : ContextClient): # pylint: disable
response = context_client.ListServices(ContextId(**CONTEXT_ID))
LOGGER.info('Services[{:d}] = {:s}'.format(len(response.services), grpc_message_to_json_string(response)))
assert len(response.services) == 1 # L2NM
assert len(response.services) == 3 # 1xL2NM + 2xTAPI
for service in response.services:
service_id = service.service_id
response = context_client.ListConnections(service_id)
LOGGER.info(' ServiceId[{:s}] => Connections[{:d}] = {:s}'.format(
grpc_message_to_json_string(service_id), len(response.connections), grpc_message_to_json_string(response)))
assert len(response.connections) == 2 # 2 connections per service
if service.service_type == ServiceTypeEnum.SERVICETYPE_L2NM:
assert len(response.connections) == 2 # 2 connections per service (primary + backup)
elif service.service_type == ServiceTypeEnum.SERVICETYPE_TAPI_CONNECTIVITY_SERVICE:
assert len(response.connections) == 1 # 1 connection per service
def test_service_removal(context_client : ContextClient, osm_wim : MockOSM): # pylint: disable=redefined-outer-name
......@@ -72,7 +75,6 @@ def test_service_removal(context_client : ContextClient, osm_wim : MockOSM): # p
for service in response.services:
if service.service_type != ServiceTypeEnum.SERVICETYPE_L2NM: continue
service_uuid = service.service_id.service_uuid.uuid
if service_uuid.endswith(':optical'): continue
service_uuids.add(service_uuid)
osm_wim.conn_info[service_uuid] = {}
......