diff --git a/src/load_generator/load_gen/RequestGenerator.py b/src/load_generator/load_gen/RequestGenerator.py index a98d957a0974aed71e9e3a205d3d034e4e279cc2..56fbf721cdfdc7389d5eaf8237b82d9316775ee3 100644 --- a/src/load_generator/load_gen/RequestGenerator.py +++ b/src/load_generator/load_gen/RequestGenerator.py @@ -245,26 +245,20 @@ class RequestGenerator: dst_device_name = self._device_data[dst_device_uuid]['name'] dst_router_id = ROUTER_ID.get(dst_device_name, '10.0.0.{:d}'.format(int(dst_device_name.replace('R', '')))) - # TODO: Check if it is needed (TID) - remote = VIRTUAL_CIRCUIT.get(src_device_uuid) - config_rules = [ json_config_rule_set('/settings', { 'mtu': 1512 }), json_config_rule_set( '/device[{:s}]/endpoint[{:s}]/settings'.format(src_device_name, src_endpoint_name), { - 'router_id': src_router_id, - 'sub_interface_index': vlan_id, + 'sub_interface_index': 0, 'vlan_id': vlan_id, 'remote_router': dst_router_id, 'circuit_id': circuit_id, - 'remote': remote, }), json_config_rule_set( '/device[{:s}]/endpoint[{:s}]/settings'.format(dst_device_name, dst_endpoint_name), { - 'router_id': dst_router_id, - 'sub_interface_index': vlan_id, + 'sub_interface_index': 0, 'vlan_id': vlan_id, 'remote_router': src_router_id, 'circuit_id': circuit_id, @@ -300,9 +294,8 @@ class RequestGenerator: if dst_router_id is None: dst_router_id = '10.0.0.{:d}'.format(dst_router_num) dst_address_ip = '10.{:d}.{:d}.{:d}'.format(y, x, dst_router_num) - # TODO: RENAME TO POLICY AZ Y ZA (name of variable and name of policy) - policy_R1 = 'srv_{:d}_a'.format(vlan_id) - policy_R2 = 'srv_{:d}_b'.format(vlan_id) + policy_AZ = 'srv_{:d}_a'.format(vlan_id) + policy_ZA = 'srv_{:d}_b'.format(vlan_id) config_rules = [ json_config_rule_set('/settings', { @@ -318,8 +311,8 @@ class RequestGenerator: 'vlan_id' : vlan_id, 'address_ip' : src_address_ip, 'address_prefix' : 16, - 'policy_1' : policy_R1, - 'policy_2' : policy_R2, + 'policy_AZ' : policy_AZ, + 'policy_ZA' : policy_ZA, }), json_config_rule_set( '/device[{:s}]/endpoint[{:s}]/settings'.format(dst_device_name, dst_endpoint_name), { @@ -329,8 +322,8 @@ class RequestGenerator: 'vlan_id' : vlan_id, 'address_ip' : dst_address_ip, 'address_prefix' : 16, - 'policy_1' : policy_R2, - 'policy_2' : policy_R1, + 'policy_AZ' : policy_AZ, + 'policy_ZA' : 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 fffa0fdfcda8764e1602c478e15c3a19e5087a7c..bbd91df93b15c669878dce092d415a678beafa8a 100644 --- a/src/service/service/service_handlers/l2nm_openconfig/ConfigRules.py +++ b/src/service/service/service_handlers/l2nm_openconfig/ConfigRules.py @@ -37,12 +37,13 @@ def setup_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 + sub_interface_index = json_endpoint_settings.get('sub_interface_index', 0 ) # 1 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', '5.5.5.5') # '5.5.5.5' circuit_id = json_endpoint_settings.get('circuit_id', '111' ) # '111' + if_cirid_name = '{:s}.{:s}'.format(endpoint_name, str(circuit_id)) network_instance_name = 'ELAN-AC:{:s}'.format(str(circuit_id)) @@ -59,7 +60,7 @@ def setup_config_rules( '/interface[{:s}]/subinterface[0]'.format(if_cirid_name), {'name': if_cirid_name, 'type': 'l2vlan', - 'index': 0, + 'index': sub_interface_index, 'vlan_id': vlan_id}), json_config_rule_set( diff --git a/src/service/service/service_handlers/l3nm_openconfig/ConfigRules.py b/src/service/service/service_handlers/l3nm_openconfig/ConfigRules.py index 2e6224a67af3077f396fc902113460a7d103bc6b..8862ac8dc8311773e45140edad69b6577940b960 100644 --- a/src/service/service/service_handlers/l3nm_openconfig/ConfigRules.py +++ b/src/service/service/service_handlers/l3nm_openconfig/ConfigRules.py @@ -41,8 +41,8 @@ def setup_config_rules( 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 - policy_import = json_endpoint_settings.get('policy_1', '2' ) # 2 - policy_export = json_endpoint_settings.get('policy_2', '7' ) # 30 + policy_import = json_endpoint_settings.get('policy_AZ', '2' ) # 2 + policy_export = json_endpoint_settings.get('policy_ZA', '7' ) # 30 if_subif_name = '{:s}.{:d}'.format(endpoint_name, vlan_id)