diff --git a/changelog/undistributed/changelog_show_l2vpn_bridge_domaine_20240326131652.rst b/changelog/undistributed/changelog_show_l2vpn_bridge_domaine_20240326131652.rst new file mode 100644 index 0000000000..bd8dd11210 --- /dev/null +++ b/changelog/undistributed/changelog_show_l2vpn_bridge_domaine_20240326131652.rst @@ -0,0 +1,8 @@ +-------------------------------------------------------------------------------- + Fix +-------------------------------------------------------------------------------- +* IOSXR + * Modified ShowL2vpnBridgeDomain: + * Added enter_vfi to detect enter the VFI + * Added new folder based test pw + * Added rename state to evpn_state in the section evpn \ No newline at end of file diff --git a/sdk_generator/outputs/github_parser.json b/sdk_generator/outputs/github_parser.json index 8986b023a6..cd73b6f2bc 100644 --- a/sdk_generator/outputs/github_parser.json +++ b/sdk_generator/outputs/github_parser.json @@ -33916,7 +33916,7 @@ "package": "genie.libs.parser", "schema": "{\n'bridge_group': {\n Any (str) *: {\n 'bridge_domain': {\n Any (str) *: {\n 'id': ,\n 'state': ,\n 'ac': {\n 'num_ac': ,\n 'num_ac_up': ,\n },\n 'pw': {\n 'num_pw': ,\n 'num_pw_up': ,\n },\n Optional (str) pbb: {\n 'num_pbb': ,\n 'num_pbb_up': ,\n },\n Optional (str) vni: {\n 'num_vni': ,\n 'num_vni_up': ,\n },\n },\n },\n },\n },\n}", "uid": "show_l2vpn_bridge-domain_brief", - "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_l2vpn.py#L733" + "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_l2vpn.py#L735" } }, "show l2vpn bridge-domain detail": { @@ -33927,7 +33927,7 @@ "package": "genie.libs.parser", "schema": "{\nOptional (str) legend: ,\n'bridge_group': {\n Any (str) *: {\n 'bridge_domain': {\n Any (str) *: {\n 'id': ,\n 'state': ,\n 'shg_id': ,\n Optional (str) mode: ,\n Optional (str) mst_i: ,\n Optional (str) mac_learning: ,\n Optional (str) mac_withdraw: ,\n Optional (str) flooding: {\n 'broadcast_multicast': ,\n 'unknown_unicast': ,\n },\n Optional (str) multicast_source: ,\n Optional (str) mac_aging_time: ,\n Optional (str) mac_aging_type: ,\n Optional (str) mac_limit: ,\n Optional (str) mac_limit_action: ,\n Optional (str) mac_limit_notification: ,\n Optional (str) mac_limit_reached: ,\n Optional (str) mac_port_down_flush: ,\n Optional (str) mac_withdraw_sent_on: ,\n Optional (str) mac_secure: ,\n Optional (str) mac_withdraw_relaying: ,\n Optional (str) mac_withdraw_for_access_pw: ,\n Optional (str) mac_secure_logging: ,\n Optional (str) dynamic_arp_inspection: ,\n Optional (str) dynamic_arp_logging: ,\n Optional (str) ip_source_logging: ,\n Optional (str) coupled_state: ,\n Optional (str) security: ,\n Optional (str) dhcp_v4_snooping: ,\n Optional (str) dhcp_v4_snooping_profile: ,\n Optional (str) igmp_snooping: ,\n Optional (str) igmp_snooping_profile: ,\n Optional (str) mld_snooping_profile: ,\n Optional (str) mac_limit_threshold: ,\n Optional (str) mid_cvpls_config_index: ,\n Optional (str) p2mp_pw: ,\n Optional (str) mtu: ,\n Optional (str) bridge_mtu: ,\n Optional (str) filter_mac_address: ,\n Optional (str) storm_control: ,\n Optional (str) ip_source_guard: ,\n Optional (str) create_time: ,\n Optional (str) split_horizon_group: ,\n Optional (str) vine_state: ,\n Optional (str) status_changed_since_creation: ,\n 'ac': {\n 'num_ac': ,\n 'num_ac_up': ,\n Optional (str) interfaces: {\n Any (str) *: {\n 'state': ,\n 'type': ,\n Optional (str) vlan_num_ranges: ,\n Optional (str) mac_aging_type: ,\n Optional (str) mtu: ,\n 'xc_id': ,\n Optional (str) interworking: ,\n Optional (str) mst_i: ,\n Optional (str) mst_i_state: ,\n Optional (str) mac_learning: ,\n Optional (str) flooding: {\n 'broadcast_multicast': ,\n 'unknown_unicast': ,\n },\n Optional (str) error: ,\n Optional (str) bvi_mac_address: ,\n Optional (str) virtual_mac_address: ,\n Optional (str) mac_aging_time: ,\n Optional (str) mac_limit: ,\n Optional (str) mac_limit_action: ,\n Optional (str) mac_limit_notification: ,\n Optional (str) mac_limit_reached: ,\n Optional (str) security: ,\n Optional (str) dhcp_v4_snooping: ,\n Optional (str) dhcp_v4_snooping_profile: ,\n Optional (str) igmp_snooping: ,\n Optional (str) igmp_snooping_profile: ,\n Optional (str) mld_snooping_profile: ,\n Optional (str) mac_limit_threshold: ,\n Optional (str) static_mac_address: ,\n Optional (str) split_horizon_group: ,\n Optional (str) statistics: {\n 'packet_totals': {\n 'receive': ,\n 'send': ,\n },\n 'byte_totals': {\n 'receive': ,\n 'send': ,\n },\n Optional (str) mac_move: ,\n },\n Optional (str) vlan_ranges: ,\n Optional (str) rewrite_tags: ,\n Optional (str) storm_control_drop_counters: {\n 'packets': {\n 'broadcast': ,\n 'multicast': ,\n 'unknown_unicast': ,\n },\n 'bytes': {\n 'broadcast': ,\n 'multicast': ,\n 'unknown_unicast': ,\n },\n },\n Optional (str) dynamic_arp_inspection_drop_counters: {\n 'packets': ,\n 'bytes': ,\n },\n Optional (str) ip_source_guard_drop_counters: {\n 'packets': ,\n 'bytes': ,\n },\n Optional (str) pd_system_data: {\n Any (str) *: Any (str) *,\n },\n },\n },\n },\n Optional (str) vfi: {\n 'num_vfi': ,\n Any (str) *: {\n Optional (str) state: ,\n 'neighbor': {\n Any (str) *: {\n 'pw_id': {\n Any (str) *: {\n 'state': ,\n 'pw_class': ,\n Optional (str) xc_id: ,\n 'encapsulation': ,\n 'protocol': ,\n 'pw_type': ,\n 'control_word': ,\n 'interworking': ,\n Optional (str) pw_backup_disable_delay: ,\n 'sequencing': ,\n Optional (str) mpls: {\n Any (str) *: {\n 'local': ,\n 'remote': ,\n Optional (str) remote_type: ,\n Optional (str) local_type: ,\n },\n },\n Optional (str) lsp: {\n 'state': ,\n Optional (str) pw: {\n 'load_balance': {\n 'local': ,\n 'remote': ,\n },\n 'pw_status_tlv': {\n 'local': ,\n 'remote': ,\n },\n },\n Optional (str) mpls: {\n Any (str) *: {\n 'local': ,\n 'remote': ,\n Optional (str) remote_type: ,\n Optional (str) local_type: ,\n },\n },\n },\n Optional (str) flow_label_flags: {\n 'configured': ,\n 'negotiated': ,\n },\n Optional (str) status_code: ,\n 'create_time': ,\n 'last_time_status_changed': ,\n Optional (str) mac_withdraw_message: {\n 'send': ,\n 'receive': ,\n },\n Optional (str) static_mac_address: ,\n Optional (str) statistics: {\n 'packet_totals': {\n 'receive': ,\n 'send': ,\n },\n 'byte_totals': {\n 'receive': ,\n 'send': ,\n },\n Optional (str) mac_move: ,\n },\n Optional (str) dhcp_v4_snooping: ,\n Optional (str) dhcp_v4_snooping_profile: ,\n Optional (str) igmp_snooping: ,\n Optional (str) igmp_snooping_profile: ,\n Optional (str) mld_snooping_profile: ,\n Optional (str) source_address: ,\n Optional (str) forward_class: ,\n Optional (str) storm_control: ,\n Optional (str) storm_control_drop_counters: {\n 'packets': {\n 'broadcast': ,\n 'multicast': ,\n 'unknown_unicast': ,\n },\n 'bytes': {\n 'broadcast': ,\n 'multicast': ,\n 'unknown_unicast': ,\n },\n },\n Optional (str) flooding: {\n 'broadcast_multicast': ,\n 'unknown_unicast': ,\n },\n Optional (str) mac_aging_time: ,\n Optional (str) mac_aging_type: ,\n Optional (str) mac_limit: ,\n Optional (str) mac_limit_action: ,\n Optional (str) mac_limit_notification: ,\n Optional (str) mac_secure: ,\n Optional (str) mac_learning: ,\n Optional (str) mac_limit_reached: ,\n Optional (str) mac_secure_logging: ,\n Optional (str) mac_port_down_flush: ,\n Optional (str) mac_limit_threshold: ,\n Optional (str) split_horizon_group: ,\n },\n },\n },\n },\n Optional (str) statistics: {\n 'drop': {\n 'illegal_vlan': ,\n 'illegal_length': ,\n },\n },\n },\n },\n Optional (str) access_pw: {\n Any (str) *: {\n 'neighbor': {\n Any (str) *: {\n 'pw_id': {\n Any (str) *: {\n Optional (str) ac_id: ,\n 'state': ,\n Optional (str) pw_class: ,\n 'xc_id': ,\n 'encapsulation': ,\n Optional (str) protocol: ,\n 'source_address': ,\n Optional (str) encap_type: ,\n 'control_word': ,\n 'sequencing': ,\n Optional (str) pw_type: ,\n Optional (str) interworking: ,\n Optional (str) pw_backup_disable_delay: ,\n Optional (str) lsp: {\n 'state': ,\n Optional (str) evpn: {\n Any (str) *: {\n 'local': ,\n 'remote': ,\n Optional (str) remote_type: ,\n Optional (str) local_type: ,\n },\n },\n Optional (str) pw: {\n 'load_balance': {\n 'local': ,\n 'remote': ,\n },\n 'pw_status_tlv': {\n 'local': ,\n 'remote': ,\n },\n },\n Optional (str) mpls: {\n Any (str) *: {\n 'local': ,\n 'remote': ,\n Optional (str) remote_type: ,\n Optional (str) local_type: ,\n },\n },\n },\n Optional (str) flow_label_flags: {\n 'configured': ,\n 'negotiated': ,\n },\n Optional (str) status_code: ,\n 'create_time': ,\n 'last_time_status_changed': ,\n Optional (str) mac_withdraw_message: {\n 'send': ,\n 'receive': ,\n },\n Optional (str) mac_learning: ,\n Optional (str) flooding: {\n 'broadcast_multicast': ,\n 'unknown_unicast': ,\n },\n Optional (str) error: ,\n Optional (str) bvi_mac_address: ,\n Optional (str) mac_aging_type: ,\n Optional (str) mac_aging_time: ,\n Optional (str) mac_limit: ,\n Optional (str) mac_limit_action: ,\n Optional (str) mac_limit_notification: ,\n Optional (str) mac_limit_reached: ,\n Optional (str) mac_secure_logging: ,\n Optional (str) mac_secure: ,\n Optional (str) mac_port_down_flush: ,\n Optional (str) dhcp_v4_snooping: ,\n Optional (str) dhcp_v4_snooping_profile: ,\n Optional (str) igmp_snooping: ,\n Optional (str) igmp_snooping_profile: ,\n Optional (str) mld_snooping_profile: ,\n Optional (str) mac_limit_threshold: ,\n Optional (str) static_mac_address: ,\n Optional (str) statistics: {\n 'packet_totals': {\n 'receive': ,\n 'send': ,\n },\n 'byte_totals': {\n 'receive': ,\n 'send': ,\n },\n Optional (str) mac_move: ,\n },\n Optional (str) dhcp_v4_snooping: ,\n Optional (str) dhcp_v4_snooping_profile: ,\n Optional (str) igmp_snooping: ,\n Optional (str) igmp_snooping_profile: ,\n Optional (str) mld_snooping_profile: ,\n Optional (str) storm_control: ,\n Optional (str) split_horizon_group: ,\n Optional (str) forward_class: ,\n },\n },\n },\n },\n },\n },\n 'pw': {\n 'num_pw': ,\n 'num_pw_up': ,\n },\n Optional (str) pbb: {\n 'num_pbb': ,\n 'num_pbb_up': ,\n },\n Optional (str) vni: {\n 'num_vni': ,\n 'num_vni_up': ,\n },\n Optional (str) evpn: {\n Any (str) *: {\n 'state': ,\n Optional (str) evi: ,\n 'xc_id': ,\n Optional (str) statistics: {\n 'packet_totals': {\n 'receive': ,\n 'send': ,\n },\n 'byte_totals': {\n 'receive': ,\n 'send': ,\n },\n Optional (str) mac_move: ,\n },\n },\n },\n },\n },\n },\n },\n}", "uid": "show_l2vpn_bridge-domain_detail", - "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_l2vpn.py#L1330" + "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_l2vpn.py#L1332" } }, "show l2vpn bridge-domain summary": { @@ -33938,7 +33938,7 @@ "package": "genie.libs.parser", "schema": "{\n'number_of_groups': ,\n'bridge_domains': {\n 'total': ,\n 'up': ,\n 'shutdown': ,\n },\n'ac': {\n 'total': ,\n 'up': ,\n 'down': ,\n },\n'pw': {\n 'total': ,\n 'up': ,\n 'down': ,\n },\n}", "uid": "show_l2vpn_bridge-domain_summary", - "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_l2vpn.py#L863" + "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_l2vpn.py#L865" } }, "show l2vpn evpn capabilities": { @@ -35093,7 +35093,7 @@ "package": "genie.libs.parser", "schema": "{\n'local_interface': ,\n'xconnect_id': ,\n'status': ,\n'segment': {\n Any (str) *: {\n 'segment_type': ,\n Optional (str) ac_interface: ,\n Optional (str) internal_id: ,\n Optional (str) evi: ,\n Optional (str) ac_id: ,\n 'status': ,\n Optional (str) control_word: ,\n 'statistics': {\n Any (str) *: {\n 'received': ,\n 'sent': ,\n },\n },\n },\n },\n}", "uid": "show_l2vpn_forwarding_xconnect_xconnect_name_detail_location_location_name", - "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_l2vpn.py#L2754" + "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_l2vpn.py#L2756" } }, "show l2vpn mac-learning {mac_type} all location {location}": { diff --git a/src/genie/libs/parser/iosxr/show_l2vpn.py b/src/genie/libs/parser/iosxr/show_l2vpn.py index 2329c51c6e..c050350f8c 100644 --- a/src/genie/libs/parser/iosxr/show_l2vpn.py +++ b/src/genie/libs/parser/iosxr/show_l2vpn.py @@ -518,6 +518,7 @@ def cli(self, output=None): bridge_domain_dict.update({'state': state}) bridge_domain_dict.update({'shg_id': shg_id}) bridge_domain_dict.update({'mst_i': mst_i}) + enter_vfi = False continue # Aging: 300 s, MAC limit: 4000, Action: none, Notification: syslog @@ -613,6 +614,7 @@ def cli(self, output=None): # clear state from earlier state = '' group = m.groupdict() + enter_vfi = True vfi = group['vfi'] vfi_dict = bridge_domain_dict.setdefault('vfi', {}). \ setdefault(vfi, {}) @@ -631,7 +633,7 @@ def cli(self, output=None): state = group['state'] static_mac_address = int(group['static_mac_address']) - if vfi: + if enter_vfi: neighbor_dict = vfi_dict.setdefault('neighbor', {}). \ setdefault(neighbor, {}). \ setdefault('pw_id', {}). \ @@ -685,7 +687,7 @@ def cli(self, output=None): evpn_state = group['state'] evpn_dict = bridge_domain_dict.setdefault('evpn', {}). \ setdefault(evpn, {}) - evpn_dict.update({'state': state}) + evpn_dict.update({'state': evpn_state}) continue return ret_dict diff --git a/src/genie/libs/parser/iosxr/tests/ShowL2vpnBridgeDomain/cli/equal/golden_output7_expected.py b/src/genie/libs/parser/iosxr/tests/ShowL2vpnBridgeDomain/cli/equal/golden_output7_expected.py new file mode 100644 index 0000000000..909f925f27 --- /dev/null +++ b/src/genie/libs/parser/iosxr/tests/ShowL2vpnBridgeDomain/cli/equal/golden_output7_expected.py @@ -0,0 +1,83 @@ +expected_output = { + "bridge_group":{ + "NETWORK":{ + "bridge_domain":{ + "NETWORK_680_1":{ + "id":0, + "state":"up", + "shg_id":0, + "mst_i":0, + "mac_aging_time":300, + "mac_limit":16000, + "mac_limit_action":"none", + "mac_limit_notification":"syslog, trap", + "filter_mac_address":0, + "ac":{ + "num_ac":1, + "num_ac_up":1, + "interfaces":{ + "HundredGigE0/1/0/1.1":{ + "state":"up", + "static_mac_address":0 + } + } + }, + "vfi":{ + "num_vfi":1, + "IBR_NETWORK_680_1":{ + "state":"up", + "neighbor":{ + "192.168.201.1":{ + "pw_id":{ + 1513:{ + "state":"up", + "static_mac_address":0 + }, + 1514:{ + "state":"up", + "static_mac_address":0 + }, + 1680:{ + "state":"up", + "static_mac_address":0 + } + } + } + } + } + }, + "pw":{ + "num_pw":5, + "num_pw_up":5, + "neighbor":{ + "192.168.201.1":{ + "pw_id":{ + 1630:{ + "state":"up", + "static_mac_address":0 + } + } + }, + "192.168.201.2":{ + "pw_id":{ + 1630:{ + "state":"up", + "static_mac_address":0 + } + } + } + } + }, + "pbb":{ + "num_pbb":0, + "num_pbb_up":0 + }, + "vni":{ + "num_vni":0, + "num_vni_up":0 + } + } + } + } + } +} diff --git a/src/genie/libs/parser/iosxr/tests/ShowL2vpnBridgeDomain/cli/equal/golden_output7_output.txt b/src/genie/libs/parser/iosxr/tests/ShowL2vpnBridgeDomain/cli/equal/golden_output7_output.txt new file mode 100644 index 0000000000..af7945740e --- /dev/null +++ b/src/genie/libs/parser/iosxr/tests/ShowL2vpnBridgeDomain/cli/equal/golden_output7_output.txt @@ -0,0 +1,15 @@ +Bridge group: NETWORK, bridge-domain: NETWORK_680_1, id: 0, state: up, ShgId: 0, MSTi: 0 + Aging: 300 s, MAC limit: 16000, Action: none, Notification: syslog, trap + Filter MAC addresses: 0 + ACs: 1 (1 up), VFIs: 1, PWs: 5 (5 up), PBBs: 0 (0 up), VNIs: 0 (0 up) + List of ACs: + Hu0/1/0/1.1, state: up, Static MAC addresses: 0 + List of Access PWs: + Neighbor 192.168.201.1 pw-id 1630, state: up, Static MAC addresses: 0 + Neighbor 192.168.201.2 pw-id 1630, state: up, Static MAC addresses: 0 + List of VFIs: + VFI IBR_NETWORK_680_1 (up) + Neighbor 192.168.201.1 pw-id 1513, state: up, Static MAC addresses: 0 + Neighbor 192.168.201.1 pw-id 1514, state: up, Static MAC addresses: 0 + Neighbor 192.168.201.1 pw-id 1680, state: up, Static MAC addresses: 0 + List of Access VFIs: \ No newline at end of file