diff --git a/src/device/service/drivers/openconfig/OpenConfigDriver.py b/src/device/service/drivers/openconfig/OpenConfigDriver.py index a0c335193bdf91c71b2f24584f200361b0218310..ac03527529b603089c4f8233cb185f6427e0c360 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 1bdb8efbff495f04ee90dadaffaa7412332531b7..e441004006e4cdd445f1d0244a9582b57956af40 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 @@ <interfaces xmlns="http://openconfig.net/yang/interfaces" xmlns:oc-ip="http://openconfig.net/yang/interfaces/ip" > - <interface> + <interface{% if operation is defined %} xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" nc:operation="{{operation}}"{% endif %}> <name>{{name}}</name> + {% if operation is defined and operation != 'delete' %} <config> <name>{{name}}</name> <type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:{{type}}</type> @@ -44,5 +45,6 @@ {% endif %} </subinterface> </subinterfaces> + {% endif %} </interface> </interfaces> diff --git a/src/load_generator/load_gen/RequestGenerator.py b/src/load_generator/load_gen/RequestGenerator.py index 29ec6a90b207a8c079f8977e9f0ac90253451cc3..5c56ea6ec603f4e9bb3fc72d5baa47f05ea0c991 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,12 +348,12 @@ 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, - '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/l2nm_openconfig/ConfigRules.py b/src/service/service/service_handlers/l2nm_openconfig/ConfigRules.py index bbd91df93b15c669878dce092d415a678beafa8a..07e78d73631342d101d77697098e83961c7dcf26 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 diff --git a/src/service/service/service_handlers/l3nm_openconfig/ConfigRules.py b/src/service/service/service_handlers/l3nm_openconfig/ConfigRules.py index 351efe5a5f32db99c36846ad2fd96e2c8567148e..ef93dcdda8145cab15ff21c24b6318e9eb00e098 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, }),