From 5e4cdc8e4ba09e4ef634a98e0320f31727ccfa14 Mon Sep 17 00:00:00 2001 From: armingol Date: Mon, 27 Feb 2023 09:48:03 +0100 Subject: [PATCH 1/3] L2VPN bugs fixed --- src/common/method_wrappers/tests/deploy_specs.sh | 4 ++-- src/device/service/drivers/openconfig/OpenConfigDriver.py | 7 ++++--- .../templates/interface/subinterface/edit_config.xml | 4 +++- src/load_generator/load_gen/RequestGenerator.py | 8 ++++++-- .../service_handlers/l2nm_openconfig/ConfigRules.py | 8 +++----- 5 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/common/method_wrappers/tests/deploy_specs.sh b/src/common/method_wrappers/tests/deploy_specs.sh index 1f41d2348..41537a26c 100755 --- a/src/common/method_wrappers/tests/deploy_specs.sh +++ b/src/common/method_wrappers/tests/deploy_specs.sh @@ -57,7 +57,7 @@ export CRDB_DATABASE="tfs" export CRDB_DEPLOY_MODE="single" # Disable flag for dropping database, if it exists. -export CRDB_DROP_DATABASE_IF_EXISTS="" +export CRDB_DROP_DATABASE_IF_EXISTS="YES" # Disable flag for re-deploying CockroachDB from scratch. export CRDB_REDEPLOY="" @@ -90,7 +90,7 @@ export QDB_TABLE_MONITORING_KPIS="tfs_monitoring_kpis" export QDB_TABLE_SLICE_GROUPS="tfs_slice_groups" # Disable flag for dropping tables if they exist. -export QDB_DROP_TABLES_IF_EXIST="" +export QDB_DROP_TABLES_IF_EXIST="YES" # Disable flag for re-deploying QuestDB from scratch. export QDB_REDEPLOY="" diff --git a/src/device/service/drivers/openconfig/OpenConfigDriver.py b/src/device/service/drivers/openconfig/OpenConfigDriver.py index a0c335193..ac0352752 100644 --- a/src/device/service/drivers/openconfig/OpenConfigDriver.py +++ b/src/device/service/drivers/openconfig/OpenConfigDriver.py @@ -201,7 +201,7 @@ def edit_config( for i,resource in enumerate(resources): str_resource_name = 'resources[#{:d}]'.format(i) try: - #logger.debug('[{:s}] resource = {:s}'.format(str_method, str(resource))) + logger.debug('[{:s}] resource = {:s}'.format(str_method, str(resource))) chk_type(str_resource_name, resource, (list, tuple)) chk_length(str_resource_name, resource, min_length=2, max_length=2) resource_key,resource_value = resource @@ -209,8 +209,8 @@ def edit_config( str_config_message = compose_config( resource_key, resource_value, delete=delete, vendor=netconf_handler.vendor) if str_config_message is None: raise UnsupportedResourceKeyException(resource_key) - #logger.debug('[{:s}] str_config_message[{:d}] = {:s}'.format( - # str_method, len(str_config_message), str(str_config_message))) + logger.debug('[{:s}] str_config_message[{:d}] = {:s}'.format( + str_method, len(str_config_message), str(str_config_message))) netconf_handler.edit_config( config=str_config_message, target=target, default_operation=default_operation, test_option=test_option, error_option=error_option, format=format) @@ -228,6 +228,7 @@ def edit_config( netconf_handler.commit() except Exception as e: # pylint: disable=broad-except msg = '[{:s}] Exception committing: {:s}' + str_operation = 'preparing' if target == 'candidate' else ('deleting' if delete else 'setting') logger.exception(msg.format(str_method, str_operation, str(resources))) results = [e for _ in resources] # if commit fails, set exception in each resource return results diff --git a/src/device/service/drivers/openconfig/templates/interface/subinterface/edit_config.xml b/src/device/service/drivers/openconfig/templates/interface/subinterface/edit_config.xml index 1bdb8efbf..e44100400 100644 --- a/src/device/service/drivers/openconfig/templates/interface/subinterface/edit_config.xml +++ b/src/device/service/drivers/openconfig/templates/interface/subinterface/edit_config.xml @@ -1,7 +1,8 @@ - + {{name}} + {% if operation is defined and operation != 'delete' %} {{name}} ianaift:{{type}} @@ -44,5 +45,6 @@ {% endif %} + {% endif %} diff --git a/src/load_generator/load_gen/RequestGenerator.py b/src/load_generator/load_gen/RequestGenerator.py index 29ec6a90b..5e420c2f4 100644 --- a/src/load_generator/load_gen/RequestGenerator.py +++ b/src/load_generator/load_gen/RequestGenerator.py @@ -37,11 +37,15 @@ LOGGER = logging.getLogger(__name__) ROUTER_ID = { 'R149': '5.5.5.5', 'R155': '5.5.5.1', + 'R199': '5.5.5.6', + } VIRTUAL_CIRCUIT = { 'R149': '5.5.5.5', 'R155': '5.5.5.1', + 'R199': '5.5.5.6', + } class RequestGenerator: @@ -333,7 +337,7 @@ class RequestGenerator: '/device[{:s}]/endpoint[{:s}]/settings'.format(src_device_name, src_endpoint_name), { 'router_id' : src_router_id, 'route_distinguisher': route_distinguisher, - 'sub_interface_index': vlan_id, + 'sub_interface_index': 0, 'vlan_id' : vlan_id, 'address_ip' : src_address_ip, 'address_prefix' : 16, @@ -344,7 +348,7 @@ class RequestGenerator: '/device[{:s}]/endpoint[{:s}]/settings'.format(dst_device_name, dst_endpoint_name), { 'router_id' : dst_router_id, 'route_distinguisher': route_distinguisher, - 'sub_interface_index': vlan_id, + 'sub_interface_index': 0, 'vlan_id' : vlan_id, 'address_ip' : dst_address_ip, 'address_prefix' : 16, diff --git a/src/service/service/service_handlers/l2nm_openconfig/ConfigRules.py b/src/service/service/service_handlers/l2nm_openconfig/ConfigRules.py index bbd91df93..07e78d736 100644 --- a/src/service/service/service_handlers/l2nm_openconfig/ConfigRules.py +++ b/src/service/service/service_handlers/l2nm_openconfig/ConfigRules.py @@ -105,19 +105,17 @@ def teardown_config_rules( if_cirid_name = '{:s}.{:s}'.format(endpoint_name, str(circuit_id)) network_instance_name = 'ELAN-AC:{:s}'.format(str(circuit_id)) - connection_point_id = 'VC-1' + #connection_point_id = 'VC-1' json_config_rules = [ - - - json_config_rule_delete( '/network_instance[{:s}]'.format(network_instance_name), {'name': network_instance_name}), json_config_rule_delete( - '/interface[{:s}]'.format(if_cirid_name), { + '/interface[{:s}]/subinterface[0]'.format(if_cirid_name),{ 'name': if_cirid_name, }), + ] return json_config_rules -- GitLab From 3c69f6304ecf10da7c078909e7bff70851bba10f Mon Sep 17 00:00:00 2001 From: armingol Date: Mon, 27 Feb 2023 11:06:10 +0100 Subject: [PATCH 2/3] L3VPN bugs fixed --- src/load_generator/load_gen/RequestGenerator.py | 4 ++-- .../service/service_handlers/l3nm_openconfig/ConfigRules.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/load_generator/load_gen/RequestGenerator.py b/src/load_generator/load_gen/RequestGenerator.py index 5e420c2f4..5c56ea6ec 100644 --- a/src/load_generator/load_gen/RequestGenerator.py +++ b/src/load_generator/load_gen/RequestGenerator.py @@ -352,8 +352,8 @@ class RequestGenerator: 'vlan_id' : vlan_id, 'address_ip' : dst_address_ip, 'address_prefix' : 16, - 'policy_AZ' : policy_AZ, - 'policy_ZA' : policy_ZA, + 'policy_ZA' : policy_AZ, + 'policy_AZ' : policy_ZA, }), ] return json_service_l3nm_planned( diff --git a/src/service/service/service_handlers/l3nm_openconfig/ConfigRules.py b/src/service/service/service_handlers/l3nm_openconfig/ConfigRules.py index 351efe5a5..ef93dcdda 100644 --- a/src/service/service/service_handlers/l3nm_openconfig/ConfigRules.py +++ b/src/service/service/service_handlers/l3nm_openconfig/ConfigRules.py @@ -252,7 +252,7 @@ def teardown_config_rules( #Delete interface; automatically deletes: # - /interface[]/subinterface[] - json_config_rule_delete('/interface[{:s}]'.format(if_subif_name), + json_config_rule_delete('/interface[{:s}]/subinterface[0]'.format(if_subif_name), { 'name': if_subif_name, }), -- GitLab From db17e18b981f86295832cdd4ce8820d6a67ee8b2 Mon Sep 17 00:00:00 2001 From: armingol Date: Tue, 28 Feb 2023 17:28:57 +0100 Subject: [PATCH 3/3] deploy_specs changes --- src/common/method_wrappers/tests/deploy_specs.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/method_wrappers/tests/deploy_specs.sh b/src/common/method_wrappers/tests/deploy_specs.sh index 41537a26c..1f41d2348 100755 --- a/src/common/method_wrappers/tests/deploy_specs.sh +++ b/src/common/method_wrappers/tests/deploy_specs.sh @@ -57,7 +57,7 @@ export CRDB_DATABASE="tfs" export CRDB_DEPLOY_MODE="single" # Disable flag for dropping database, if it exists. -export CRDB_DROP_DATABASE_IF_EXISTS="YES" +export CRDB_DROP_DATABASE_IF_EXISTS="" # Disable flag for re-deploying CockroachDB from scratch. export CRDB_REDEPLOY="" @@ -90,7 +90,7 @@ export QDB_TABLE_MONITORING_KPIS="tfs_monitoring_kpis" export QDB_TABLE_SLICE_GROUPS="tfs_slice_groups" # Disable flag for dropping tables if they exist. -export QDB_DROP_TABLES_IF_EXIST="YES" +export QDB_DROP_TABLES_IF_EXIST="" # Disable flag for re-deploying QuestDB from scratch. export QDB_REDEPLOY="" -- GitLab