diff --git a/changelog/undistributed/changelog_show_bgp_address_family_iosxr_20240404103239.rst b/changelog/undistributed/changelog_show_bgp_address_family_iosxr_20240404103239.rst new file mode 100644 index 0000000000..3fc40108b0 --- /dev/null +++ b/changelog/undistributed/changelog_show_bgp_address_family_iosxr_20240404103239.rst @@ -0,0 +1,9 @@ +-------------------------------------------------------------------------------- + Fix +-------------------------------------------------------------------------------- +* IOSXR + * Modified ShowBgpAddressFamily: + * New Show Command - show bgp {address_family} community {community} + * New Show Command - show bgp {address_family} community {community} {exact_match} + * Updated regex for handling IPv6 adresses/prefixes + * Updated regex pattern for handling new lines in IPv6 address family output diff --git a/sdk_generator/outputs/github_parser.json b/sdk_generator/outputs/github_parser.json index b71b010b89..20a458c990 100644 --- a/sdk_generator/outputs/github_parser.json +++ b/sdk_generator/outputs/github_parser.json @@ -15415,7 +15415,7 @@ "folders": { "iosxr": { "class": "ShowBgpAddressFamily", - "doc": "Parser for:\n 'show bgp'\n 'show bgp {address_family}'\n ", + "doc": "Parser for:\n 'show bgp'\n 'show bgp {address_family}'\n 'show bgp {address_family} community {community}'\n 'show bgp {address_family} community {community} {exact_match}'\n ", "module_name": "iosxr.show_bgp", "package": "genie.libs.parser", "schema": "{\n 'address_family': {\n Any('*'): {\n Optional('router_identifier'): str,\n Optional('local_as'): Or (, ),\n Optional('generic_scan_interval'): int,\n Optional('non_stop_routing'): bool,\n Optional('table_state'): str,\n Optional('table_id'): str,\n Optional('rd_version'): int,\n Optional('bgp_table_version'): int,\n Optional('dampening_status'): str,\n Optional('nsr_initial_initsync_version'): str,\n Optional('nsr_issu_sync_group_versions'): str,\n Optional('nsr_initial_init_ver_status'): str,\n Optional('scan_interval'): int,\n Optional('processed_prefix'): int,\n Optional('processed_paths'): int,\n Optional('route_distinguisher'): {\n Any('*'): {\n Optional('default_vrf'): str,\n Optional('prefix'): {\n Any('*'): {\n Optional('index'): {\n Any('*'): {\n Optional('next_hop'): str,\n Optional('status_codes'): str,\n Optional('metric'): str,\n Optional('locprf'): str,\n Optional('weight'): str,\n Optional('path'): str,\n Optional('origin_codes'): str,\n },\n },\n },\n },\n },\n },\n Optional('prefix'): {\n Any('*'): {\n Optional('index'): {\n Any('*'): {\n Optional('next_hop'): str,\n Optional('status_codes'): str,\n Optional('metric'): str,\n Optional('locprf'): str,\n Optional('weight'): str,\n Optional('path'): str,\n Optional('origin_codes'): str,\n },\n },\n },\n },\n Optional('operation_mode'): str,\n Optional('process'): {\n Any('*'): {\n 'rcvtblver': int,\n 'brib_rib': int,\n 'labelver': int,\n 'importver': int,\n 'sendtblver': int,\n 'standbyver': int,\n },\n },\n Optional('neighbor'): {\n Any('*'): {\n 'remote_as': Or (, ),\n 'tbl_ver': int,\n 'spk': int,\n 'msg_rcvd': int,\n 'msg_sent': int,\n 'input_queue': int,\n 'output_queue': int,\n 'up_down': str,\n 'state_pfxrcd': str,\n },\n },\n },\n },\n}", @@ -15767,7 +15767,7 @@ "os": "iosxr" }, "uid": "show_bgp_dampened-paths", - "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_bgp.py#L9806" + "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_bgp.py#L9813" } } }, @@ -17467,7 +17467,7 @@ }, "iosxr": { "class": "ShowBgpAddressFamily", - "doc": "Parser for:\n 'show bgp'\n 'show bgp {address_family}'\n ", + "doc": "Parser for:\n 'show bgp'\n 'show bgp {address_family}'\n 'show bgp {address_family} community {community}'\n 'show bgp {address_family} community {community} {exact_match}'\n ", "module_name": "iosxr.show_bgp", "package": "genie.libs.parser", "schema": "{\n 'address_family': {\n Any('*'): {\n Optional('router_identifier'): str,\n Optional('local_as'): Or (, ),\n Optional('generic_scan_interval'): int,\n Optional('non_stop_routing'): bool,\n Optional('table_state'): str,\n Optional('table_id'): str,\n Optional('rd_version'): int,\n Optional('bgp_table_version'): int,\n Optional('dampening_status'): str,\n Optional('nsr_initial_initsync_version'): str,\n Optional('nsr_issu_sync_group_versions'): str,\n Optional('nsr_initial_init_ver_status'): str,\n Optional('scan_interval'): int,\n Optional('processed_prefix'): int,\n Optional('processed_paths'): int,\n Optional('route_distinguisher'): {\n Any('*'): {\n Optional('default_vrf'): str,\n Optional('prefix'): {\n Any('*'): {\n Optional('index'): {\n Any('*'): {\n Optional('next_hop'): str,\n Optional('status_codes'): str,\n Optional('metric'): str,\n Optional('locprf'): str,\n Optional('weight'): str,\n Optional('path'): str,\n Optional('origin_codes'): str,\n },\n },\n },\n },\n },\n },\n Optional('prefix'): {\n Any('*'): {\n Optional('index'): {\n Any('*'): {\n Optional('next_hop'): str,\n Optional('status_codes'): str,\n Optional('metric'): str,\n Optional('locprf'): str,\n Optional('weight'): str,\n Optional('path'): str,\n Optional('origin_codes'): str,\n },\n },\n },\n },\n Optional('operation_mode'): str,\n Optional('process'): {\n Any('*'): {\n 'rcvtblver': int,\n 'brib_rib': int,\n 'labelver': int,\n 'importver': int,\n 'sendtblver': int,\n 'standbyver': int,\n },\n },\n Optional('neighbor'): {\n Any('*'): {\n 'remote_as': Or (, ),\n 'tbl_ver': int,\n 'spk': int,\n 'msg_rcvd': int,\n 'msg_sent': int,\n 'input_queue': int,\n 'output_queue': int,\n 'up_down': str,\n 'state_pfxrcd': str,\n },\n },\n },\n },\n}", @@ -17675,6 +17675,38 @@ } } }, + "show bgp {address_family} community {community}": { + "folders": { + "iosxr": { + "class": "ShowBgpAddressFamily", + "doc": "Parser for:\n 'show bgp'\n 'show bgp {address_family}'\n 'show bgp {address_family} community {community}'\n 'show bgp {address_family} community {community} {exact_match}'\n ", + "module_name": "iosxr.show_bgp", + "package": "genie.libs.parser", + "schema": "{\n 'address_family': {\n Any('*'): {\n Optional('router_identifier'): str,\n Optional('local_as'): Or (, ),\n Optional('generic_scan_interval'): int,\n Optional('non_stop_routing'): bool,\n Optional('table_state'): str,\n Optional('table_id'): str,\n Optional('rd_version'): int,\n Optional('bgp_table_version'): int,\n Optional('dampening_status'): str,\n Optional('nsr_initial_initsync_version'): str,\n Optional('nsr_issu_sync_group_versions'): str,\n Optional('nsr_initial_init_ver_status'): str,\n Optional('scan_interval'): int,\n Optional('processed_prefix'): int,\n Optional('processed_paths'): int,\n Optional('route_distinguisher'): {\n Any('*'): {\n Optional('default_vrf'): str,\n Optional('prefix'): {\n Any('*'): {\n Optional('index'): {\n Any('*'): {\n Optional('next_hop'): str,\n Optional('status_codes'): str,\n Optional('metric'): str,\n Optional('locprf'): str,\n Optional('weight'): str,\n Optional('path'): str,\n Optional('origin_codes'): str,\n },\n },\n },\n },\n },\n },\n Optional('prefix'): {\n Any('*'): {\n Optional('index'): {\n Any('*'): {\n Optional('next_hop'): str,\n Optional('status_codes'): str,\n Optional('metric'): str,\n Optional('locprf'): str,\n Optional('weight'): str,\n Optional('path'): str,\n Optional('origin_codes'): str,\n },\n },\n },\n },\n Optional('operation_mode'): str,\n Optional('process'): {\n Any('*'): {\n 'rcvtblver': int,\n 'brib_rib': int,\n 'labelver': int,\n 'importver': int,\n 'sendtblver': int,\n 'standbyver': int,\n },\n },\n Optional('neighbor'): {\n Any('*'): {\n 'remote_as': Or (, ),\n 'tbl_ver': int,\n 'spk': int,\n 'msg_rcvd': int,\n 'msg_sent': int,\n 'input_queue': int,\n 'output_queue': int,\n 'up_down': str,\n 'state_pfxrcd': str,\n },\n },\n },\n },\n}", + "tokens": { + "os": "iosxr" + }, + "uid": "show_bgp_address_family_community_community", + "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_bgp.py#L9120" + } + } + }, + "show bgp {address_family} community {community} {exact_match}": { + "folders": { + "iosxr": { + "class": "ShowBgpAddressFamily", + "doc": "Parser for:\n 'show bgp'\n 'show bgp {address_family}'\n 'show bgp {address_family} community {community}'\n 'show bgp {address_family} community {community} {exact_match}'\n ", + "module_name": "iosxr.show_bgp", + "package": "genie.libs.parser", + "schema": "{\n 'address_family': {\n Any('*'): {\n Optional('router_identifier'): str,\n Optional('local_as'): Or (, ),\n Optional('generic_scan_interval'): int,\n Optional('non_stop_routing'): bool,\n Optional('table_state'): str,\n Optional('table_id'): str,\n Optional('rd_version'): int,\n Optional('bgp_table_version'): int,\n Optional('dampening_status'): str,\n Optional('nsr_initial_initsync_version'): str,\n Optional('nsr_issu_sync_group_versions'): str,\n Optional('nsr_initial_init_ver_status'): str,\n Optional('scan_interval'): int,\n Optional('processed_prefix'): int,\n Optional('processed_paths'): int,\n Optional('route_distinguisher'): {\n Any('*'): {\n Optional('default_vrf'): str,\n Optional('prefix'): {\n Any('*'): {\n Optional('index'): {\n Any('*'): {\n Optional('next_hop'): str,\n Optional('status_codes'): str,\n Optional('metric'): str,\n Optional('locprf'): str,\n Optional('weight'): str,\n Optional('path'): str,\n Optional('origin_codes'): str,\n },\n },\n },\n },\n },\n },\n Optional('prefix'): {\n Any('*'): {\n Optional('index'): {\n Any('*'): {\n Optional('next_hop'): str,\n Optional('status_codes'): str,\n Optional('metric'): str,\n Optional('locprf'): str,\n Optional('weight'): str,\n Optional('path'): str,\n Optional('origin_codes'): str,\n },\n },\n },\n },\n Optional('operation_mode'): str,\n Optional('process'): {\n Any('*'): {\n 'rcvtblver': int,\n 'brib_rib': int,\n 'labelver': int,\n 'importver': int,\n 'sendtblver': int,\n 'standbyver': int,\n },\n },\n Optional('neighbor'): {\n Any('*'): {\n 'remote_as': Or (, ),\n 'tbl_ver': int,\n 'spk': int,\n 'msg_rcvd': int,\n 'msg_sent': int,\n 'input_queue': int,\n 'output_queue': int,\n 'up_down': str,\n 'state_pfxrcd': str,\n },\n },\n },\n },\n}", + "tokens": { + "os": "iosxr" + }, + "uid": "show_bgp_address_family_community_community_exact_match", + "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_bgp.py#L9120" + } + } + }, "show bgp {address_family} evi {evi}": { "folders": { "iosxe": { @@ -18203,7 +18235,7 @@ "os": "iosxr" }, "uid": "show_bgp_address_family_bgp_prefix", - "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_bgp.py#L9491" + "url": "https://github.com/CiscoTestAutomation/genieparser/tree/master/src/genie/libs/parser/iosxr/show_bgp.py#L9498" } } }, diff --git a/src/genie/libs/parser/iosxr/show_bgp.py b/src/genie/libs/parser/iosxr/show_bgp.py index 2475ddbeed..60fd79f3b8 100644 --- a/src/genie/libs/parser/iosxr/show_bgp.py +++ b/src/genie/libs/parser/iosxr/show_bgp.py @@ -8696,9 +8696,16 @@ def cli(self, vrf=None, address_family=None, summary=None, value=None, output=No # *>i10.169.1.0/24 10.64.4.4 2219 100 0 300 33299 51178 47751 {27016} e # *>i192.168.111.0/24 10.189.99.98 0 0 i # *> 10.7.7.7/32 10.10.10.107 0 0 65107.65107 ? + # OR + # s>i2001:718::2:99/128 195.113.156.4 0 100 0 i + # s i 195.113.156.4 0 100 0 i + # s>i2001:718::2:101/128 + # 10.2.8.1 0 100 0 i + # s i 10.2.8.1 0 100 0 i + # s>i2001:718::2:116/128 p13 = re.compile(r'^(?P(i|s|x|S|d|h|\*|\>|\s)+)' - r' *(?P(?P[0-9\.\:\[\]]+)\/(?P\d+))?' - r' +(?P\S+) +(?P[\d\.\s\{\}]+)' + r' *(?P(?P[0-9a-f\.\:\[\]]+)\/(?P\d+))?[\n\r]*' + r' +(?P\S+)[\n\r]* +(?P[\d\.\s\{\}]+)' r'(?: *(?P(i|e|\?)))?$') # Processed 40 prefixes, 50 paths @@ -9122,16 +9129,23 @@ class ShowBgpAddressFamily(ShowBgpAddressFamilySchema): '''Parser for: 'show bgp' 'show bgp {address_family}' + 'show bgp {address_family} community {community}' + 'show bgp {address_family} community {community} {exact_match}' ''' + cli_command = [ + 'show bgp', + 'show bgp {address_family}', + 'show bgp {address_family} community {community}', + 'show bgp {address_family} community {community} {exact_match}',] - cli_command = ['show bgp', - 'show bgp {address_family}'] - - def cli(self, address_family=None, output=None): - + def cli(self, address_family=None, community=None, exact_match=None, output=None): # Execute command if output is None: - if address_family: + if address_family and community and exact_match: + command = self.cli_command[3].format(address_family=address_family, community=community, exact_match=exact_match) + elif address_family and community: + command = self.cli_command[2].format(address_family=address_family, community=community) + elif address_family: command = self.cli_command[1].format(address_family=address_family) else: command = self.cli_command[0] @@ -9193,9 +9207,16 @@ def cli(self, address_family=None, output=None): # *>i10.169.1.0/24 10.64.4.4 2219 100 0 300 33299 51178 47751 {27016} e # *>i192.168.111.0/24 10.189.99.98 0 0 i # *> 10.7.7.7/32 10.10.10.107 0 0 65107.65107 ? + # OR + # s>i2001:718::2:99/128 195.113.156.4 0 100 0 i + # s i 195.113.156.4 0 100 0 i + # s>i2001:718::2:101/128 + # 10.2.8.1 0 100 0 i + # s i 10.2.8.1 0 100 0 i + # s>i2001:718::2:116/128 p11 = re.compile(r'^(?P(i|s|x|S|d|h|\*|\>|\s)+)' - r' *(?P(?P[0-9\.\:\[\]]+)\/(?P\d+))?' - r' +(?P\S+) +(?P[\d\.\s\{\}]+)' + r' *(?P(?P[0-9a-f\.\:\[\]]+)\/(?P\d+))?[\n\r]*' + r' +(?P\S+)[\n\r]* +(?P[\d\.\s\{\}]+)' r'(?: *(?P(i|e|\?)))?$') # Processed 40 prefixes, 50 paths diff --git a/src/genie/libs/parser/iosxr/tests/ShowBgpAddressFamily/cli/equal/golden_output2_arguments.json b/src/genie/libs/parser/iosxr/tests/ShowBgpAddressFamily/cli/equal/golden_output2_arguments.json new file mode 100644 index 0000000000..8f4a4c6819 --- /dev/null +++ b/src/genie/libs/parser/iosxr/tests/ShowBgpAddressFamily/cli/equal/golden_output2_arguments.json @@ -0,0 +1,5 @@ +{ + "address_family": "ipv6 all", + "community": "1234:1234", + "exact_match": "exact_match" +} \ No newline at end of file diff --git a/src/genie/libs/parser/iosxr/tests/ShowBgpAddressFamily/cli/equal/golden_output2_expected.py b/src/genie/libs/parser/iosxr/tests/ShowBgpAddressFamily/cli/equal/golden_output2_expected.py new file mode 100644 index 0000000000..dc2c010a7e --- /dev/null +++ b/src/genie/libs/parser/iosxr/tests/ShowBgpAddressFamily/cli/equal/golden_output2_expected.py @@ -0,0 +1,240 @@ +expected_output = { + 'address_family': { + 'ipv6_all': { + 'bgp_table_version': 5530, + 'generic_scan_interval': 60, + 'local_as': 1234, + 'non_stop_routing': True, + 'nsr_initial_init_ver_status': 'reached', + 'nsr_initial_initsync_version': '7', + 'nsr_issu_sync_group_versions': '5530/0', + 'route_distinguisher': { + '1234:1234': { + 'prefix': { + '2001:0db8:85a3:0:0:0:0:1403::/48': { + 'index': { + 1: { + 'locprf': '0', + 'next_hop': '192.0.2.1', + 'origin_codes': 'i', + 'path': '0', + 'status_codes': '*>i', + 'weight': '100', + }, + 2: { + 'locprf': '0', + 'next_hop': '192.0.2.1', + 'origin_codes': 'i', + 'path': '0', + 'status_codes': '*i', + 'weight': '100', + }, + }, + }, + '2001:0db8:85a3::/64': { + 'index': { + 1: { + 'locprf': '0', + 'next_hop': '192.0.2.1', + 'origin_codes': 'i', + 'path': '0', + 'status_codes': '*>i', + 'weight': '100', + }, + 2: { + 'locprf': '0', + 'next_hop': '192.0.2.1', + 'origin_codes': 'i', + 'path': '0', + 'status_codes': '*i', + 'weight': '100', + }, + }, + }, + }, + }, + '1234:2505005': { + 'prefix': { + '2001:0db8:85a3:0:0:0:0:6:10:205::/112': { + 'index': { + 1: { + 'locprf': '100', + 'metric': '4294967295', + 'next_hop': '192.0.2.2', + 'origin_codes': 'i', + 'path': '65031', + 'status_codes': '*>i', + 'weight': '0', + }, + 2: { + 'locprf': '100', + 'metric': '4294967295', + 'next_hop': '192.0.2.2', + 'origin_codes': 'i', + 'path': '65031', + 'status_codes': '*i', + 'weight': '0', + }, + }, + }, + '2001:0db8:85a3:0:0:0:0:6:192:168:201::/112': { + 'index': { + 1: { + 'locprf': '100', + 'metric': '4294967295', + 'next_hop': '192.0.2.2', + 'origin_codes': 'i', + 'path': '65031', + 'status_codes': '*>i', + 'weight': '0', + }, + 2: { + 'locprf': '100', + 'metric': '4294967295', + 'next_hop': '192.0.2.2', + 'origin_codes': 'i', + 'path': '65031', + 'status_codes': '*i', + 'weight': '0', + }, + }, + }, + '2001:0db8:85a3:0:0:0:0:6:195:113:123:128:0/112': { + 'index': { + 1: { + 'locprf': '100', + 'metric': '4294967295', + 'next_hop': '192.0.2.2', + 'origin_codes': 'i', + 'path': '65031', + 'status_codes': '*>i', + 'weight': '0', + }, + 2: { + 'locprf': '100', + 'metric': '4294967295', + 'next_hop': '192.0.2.2', + 'origin_codes': 'i', + 'path': '65031', + 'status_codes': '*i', + 'weight': '0', + }, + }, + }, + '2001:0db8:85a3:0:0:0:0:6:195:113:123:80/125': { + 'index': { + 1: { + 'locprf': '100', + 'metric': '4294967295', + 'next_hop': '192.0.2.2', + 'origin_codes': 'i', + 'path': '65031', + 'status_codes': '*>i', + 'weight': '0', + }, + 2: { + 'locprf': '100', + 'metric': '4294967295', + 'next_hop': '192.0.2.2', + 'origin_codes': 'i', + 'path': '65031', + 'status_codes': '*i', + 'weight': '0', + }, + }, + }, + '2001:0db8:85a3:0:0:0:0:6:195:113:123:96:0/112': { + 'index': { + 1: { + 'locprf': '100', + 'metric': '4294967295', + 'next_hop': '192.0.2.2', + 'origin_codes': 'i', + 'path': '65031', + 'status_codes': '*>i', + 'weight': '0', + }, + 2: { + 'locprf': '100', + 'metric': '4294967295', + 'next_hop': '192.0.2.2', + 'origin_codes': 'i', + 'path': '65031', + 'status_codes': '*i', + 'weight': '0', + }, + }, + }, + '2001:0db8:85a3:0:0:0:0:6::10/127': { + 'index': { + 1: { + 'locprf': '0', + 'next_hop': '192.0.2.2', + 'origin_codes': 'i', + 'path': '0', + 'status_codes': '*>i', + 'weight': '100', + }, + 2: { + 'locprf': '0', + 'next_hop': '192.0.2.2', + 'origin_codes': 'i', + 'path': '0', + 'status_codes': '*i', + 'weight': '100', + }, + }, + }, + }, + }, + '1234:2505118': { + 'prefix': { + '2001:0db8:85a3:0:0:0:0:18::/56': { + 'index': { + 1: { + 'locprf': '100', + 'next_hop': '203.0.113.7', + 'origin_codes': 'i', + 'path': '0', + 'status_codes': '*>i', + 'weight': '100', + }, + 2: { + 'locprf': '100', + 'next_hop': '203.0.113.7', + 'origin_codes': 'i', + 'path': '0', + 'status_codes': '*i', + 'weight': '100', + }, + }, + }, + '2001:0db8:85a3:0:0:0:0:1e08::/48': { + 'index': { + 1: { + 'locprf': '100', + 'next_hop': '203.0.113.7', + 'origin_codes': 'i', + 'path': '0', + 'status_codes': '*>i', + 'weight': '100', + }, + 2: { + 'locprf': '100', + 'next_hop': '203.0.113.7', + 'origin_codes': 'i', + 'path': '0', + 'status_codes': '*i', + 'weight': '100', + }, + }, + }, + }, + }, + }, + 'router_identifier': '192.168.1.1', + 'scan_interval': 60, + 'table_state': 'active', + }, + }, + } \ No newline at end of file diff --git a/src/genie/libs/parser/iosxr/tests/ShowBgpAddressFamily/cli/equal/golden_output2_output.txt b/src/genie/libs/parser/iosxr/tests/ShowBgpAddressFamily/cli/equal/golden_output2_output.txt new file mode 100644 index 0000000000..9ddc19a9c2 --- /dev/null +++ b/src/genie/libs/parser/iosxr/tests/ShowBgpAddressFamily/cli/equal/golden_output2_output.txt @@ -0,0 +1,42 @@ +RP/0/RSP0/CPU0:router# show bgp ivp6 all community 1234:1234 exact-match +Address Family: VPNv6 Unicast +----------------------------- + +BGP router identifier 192.168.1.1, local AS number 1234 +BGP generic scan interval 60 secs +Non-stop routing is enabled +BGP table state: Active +Table ID: 0x0 +BGP main routing table version 5530 +BGP NSR Initial initsync version 7 (Reached) +BGP NSR/ISSU Sync-Group versions 5530/0 +BGP scan interval 60 secs + +Status codes: s suppressed, d damped, h history, * valid, > best i - internal, r RIB-failure, S stale, N Nexthop-discard +Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path +Route Distinguisher: 1234:1234 +Route Distinguisher Version: 53 +*>i2001:0db8:85a3::/64 192.0.2.1 0 100 0 i +* i 192.0.2.1 0 100 0 i +*>i2001:0db8:85a3:0:0:0:0:1403::/48 192.0.2.1 0 100 0 i +* i 192.0.2.1 0 100 0 i +Route Distinguisher: 1234:2505005 +Route Distinguisher Version: 54 +*>i2001:0db8:85a3:0:0:0:0:6::10/127 192.0.2.2 0 100 0 i +* i 192.0.2.2 0 100 0 i +*>i2001:0db8:85a3:0:0:0:0:6:195:113:123:80/125 192.0.2.2 4294967295 100 0 65031 i +* i 192.0.2.2 4294967295 100 0 65031 i +*>i2001:0db8:85a3:0:0:0:0:6:10:205::/112 192.0.2.2 4294967295 100 0 65031 i +* i 192.0.2.2 4294967295 100 0 65031 i +*>i2001:0db8:85a3:0:0:0:0:6:192:168:201::/112 192.0.2.2 4294967295 100 0 65031 i +* i 192.0.2.2 4294967295 100 0 65031 i +*>i2001:0db8:85a3:0:0:0:0:6:195:113:123:96:0/112 192.0.2.2 4294967295 100 0 65031 i +* i 192.0.2.2 4294967295 100 0 65031 i +*>i2001:0db8:85a3:0:0:0:0:6:195:113:123:128:0/112 192.0.2.2 4294967295 100 0 65031 i +* i 192.0.2.2 4294967295 100 0 65031 i +Route Distinguisher: 1234:2505118 +Route Distinguisher Version: 49 +*>i2001:0db8:85a3:0:0:0:0:18::/56 203.0.113.7 100 100 0 i +* i 203.0.113.7 100 100 0 i +*>i2001:0db8:85a3:0:0:0:0:1e08::/48 203.0.113.7 100 100 0 i +* i 203.0.113.7 100 100 0 i \ No newline at end of file diff --git a/src/genie/libs/parser/iosxr/tests/ShowBgpVrf/cli/equal/golden_output_8_arguments.json b/src/genie/libs/parser/iosxr/tests/ShowBgpVrf/cli/equal/golden_output_8_arguments.json new file mode 100644 index 0000000000..d489d031dd --- /dev/null +++ b/src/genie/libs/parser/iosxr/tests/ShowBgpVrf/cli/equal/golden_output_8_arguments.json @@ -0,0 +1,4 @@ +{ + "vrf": "xNet", + "address_family": "ipv6 unicast" +} diff --git a/src/genie/libs/parser/iosxr/tests/ShowBgpVrf/cli/equal/golden_output_8_expected.py b/src/genie/libs/parser/iosxr/tests/ShowBgpVrf/cli/equal/golden_output_8_expected.py new file mode 100644 index 0000000000..3375a1e928 --- /dev/null +++ b/src/genie/libs/parser/iosxr/tests/ShowBgpVrf/cli/equal/golden_output_8_expected.py @@ -0,0 +1,265 @@ +expected_output = {'vrf': {'xnet': {'address_family': {'ipv6_unicast': {'bgp_route_distinguisher': '20.3.3.1:100', + 'bgp_table_version': 217936, + 'bgp_vrf': 'xnet', + 'default_vrf': 'xnet', + 'local_as': 4852, + 'non_stop_routing': True, + 'nsr_initial_init_ver_status': 'reached', + 'nsr_initial_initsync_version': '17', + 'nsr_issu_sync_group_versions': '217936/0', + 'prefix': {'2700:2000:5130:f4gc:0:3d::/128': {'index': {1: {'alloc_mode': '0', + 'local_sid': 'N ' + 'i ' + '200::2 ' + '1 ' + '210', + 'locator': 'i', + 'status_codes': '*>i'}}}, + '2700:2000:5130:f4gc:0:4e::/128': {'index': {1: {'alloc_mode': '0', + 'local_sid': 'N ' + 'i ' + '200::2 ' + '1 ' + '210', + 'locator': 'i', + 'status_codes': '*>i'}}}, + '2700:2000:5130:f4gc:0:52::/128': {'index': {1: {'alloc_mode': '0', + 'local_sid': 'N ' + 'i ' + '200::2 ' + '1 ' + '210', + 'locator': 'i', + 'status_codes': '*>i'}}}, + '2700:2000:5130:f4gc:0:5b::/128': {'index': {1: {'alloc_mode': '0', + 'local_sid': 'N ' + 'i ' + '200::2 ' + '1 ' + '210', + 'locator': 'i', + 'status_codes': '*>i'}}}, + '2700:2000:5130:f4gc:0:5f::/128': {'index': {1: {'alloc_mode': '0', + 'local_sid': 'N ' + 'i ' + '200::2 ' + '1 ' + '210', + 'locator': 'i', + 'status_codes': '*>i'}}}, + '2700:2000:5130:f4gc:0:65::/128': {'index': {1: {'alloc_mode': '0', + 'local_sid': 'N ' + 'i ' + '200::2 ' + '1 ' + '210', + 'locator': 'i', + 'status_codes': '*>i'}}}, + '2700:2000:5130:f4gc:0:68::/128': {'index': {1: {'alloc_mode': '0', + 'local_sid': 'N ' + 'i ' + '200::2 ' + '1 ' + '210', + 'locator': 'i', + 'status_codes': '*>i'}}}, + '2700:2000:5130:f4gc:0:72::/128': {'index': {1: {'alloc_mode': '0', + 'local_sid': 'N ' + 'i ' + '200::2 ' + '1 ' + '210', + 'locator': 'i', + 'status_codes': '*>i'}}}, + '2700:2000:5130:f4gc:0:96::/128': {'index': {1: {'alloc_mode': '0', + 'local_sid': 'N ' + 'i ' + '200::2 ' + '1 ' + '210', + 'locator': 'i', + 'status_codes': '*>i'}}}, + '2700:2000:5130:f4gc:0:97::/128': {'index': {1: {'alloc_mode': '0', + 'local_sid': 'N ' + 'i ' + '200::2 ' + '1 ' + '210', + 'locator': 'i', + 'status_codes': '*>i'}}}, + '2700:2000:5130:f4gc:0:98::/128': {'index': {1: {'alloc_mode': '0', + 'local_sid': 'N ' + 'i ' + '200::2 ' + '1 ' + '210', + 'locator': 'i', + 'status_codes': '*>i'}}}, + '2700:2000:5130:f4gc:0:99::/128': {'index': {1: {'alloc_mode': '0', + 'local_sid': 'N ' + 'i ' + '200::2 ' + '1 ' + '210', + 'locator': 'i', + 'status_codes': '*>i'}}}, + '2700:2000:5130:f4gc:0:9a::/128': {'index': {1: {'alloc_mode': '0', + 'local_sid': 'N ' + 'i ' + '200::2 ' + '1 ' + '210', + 'locator': 'i', + 'status_codes': '*>i'}}}, + '2700:2000:5130:f4gc:0:9d::/128': {'index': {1: {'alloc_mode': '0', + 'local_sid': 'N ' + 'i ' + '200::2 ' + '1 ' + '210', + 'locator': 'i', + 'status_codes': '*>i'}}}, + '2700:2000:5130:f4gc:0:9e::/128': {'index': {1: {'alloc_mode': '0', + 'local_sid': 'N ' + 'i ' + '200::2 ' + '1 ' + '210', + 'locator': 'i', + 'status_codes': '*>i'}}}, + '2700:2000:5130:f4gc:0:a1::/128': {'index': {1: {'alloc_mode': '0', + 'local_sid': 'N ' + 'i ' + '200::2 ' + '1 ' + '210', + 'locator': 'i', + 'status_codes': '*>i'}}}, + '2700:2000:5130:f4gc:0:a2::/128': {'index': {1: {'alloc_mode': '0', + 'local_sid': 'N ' + 'i ' + '200::2 ' + '1 ' + '210', + 'locator': 'i', + 'status_codes': '*>i'}}}, + '3001:828:0:700:0:258:258:20/127': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:0:700:0:2a:2a:20/127': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:0:700:0:3b:3b:20/127': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:1300:7:196:114:124:90/125': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:1300:7::20/127': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:1307:193:169:202::/112': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:1307:196:114:124:106:0/112': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:1307:196:114:124:138:0/112': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:1307:20:306::/112': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:1500:4::/64': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:1504::/48': {'index': {1: {'locprf': '0', + 'next_hop': '20.3.5.2', + 'origin_codes': 'i', + 'path': '0', + 'status_codes': '*>i', + 'weight': '100'}}}, + '3001:828:19::/56': {'index': {1: {'alloc_mode': '0', + 'local_sid': '150', + 'locator': 'i', + 'locprf': '100', + 'next_hop': '196.114.157.8', + 'origin_codes': 'i', + 'path': '0', + 'status_codes': '*>i', + 'weight': '100'}}}, + '3001:828:2f09::/48': {'index': {1: {'alloc_mode': '0', + 'local_sid': '150', + 'locator': 'i', + 'locprf': '100', + 'next_hop': '196.114.157.8', + 'origin_codes': 'i', + 'path': '0', + 'status_codes': '*>i', + 'weight': '100'}}}, + '3001:828:300:26::/64': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:300:27::/64': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:300:28::/64': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:300:2::4:20/127': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:300:2::4:30/127': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:300:2::5:20/127': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:300:2::5:30/127': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:301:ffff::/64': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:316::/48': {'index': {1: {'locprf': '100', + 'metric': '100', + 'next_hop': '20.3.9.2', + 'origin_codes': '?', + 'path': '65221', + 'status_codes': '*>i', + 'weight': '0'}}}, + '3001:828:317::/48': {'index': {1: {'locprf': '100', + 'metric': '100', + 'next_hop': '20.3.9.2', + 'origin_codes': '?', + 'path': '65221', + 'status_codes': '*>i', + 'weight': '0'}}}, + '3001:828:318::/48': {'index': {1: {'locprf': '100', + 'metric': '100', + 'next_hop': '20.3.9.2', + 'origin_codes': '?', + 'path': '65221', + 'status_codes': '*>i', + 'weight': '0'}}}, + '3001:828:900:7::2:0/126': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:900:7::3:0/126': {'index': {1: {'status_codes': '*>i'}}}, + '3001:828:907::/48': {'index': {1: {'locprf': '100', + 'metric': '200', + 'next_hop': '20.3.4.2', + 'origin_codes': 'i', + 'path': '65086', + 'status_codes': '*>i', + 'weight': '0'}}}, + '3001:828::3:116/128': {'index': {1: {'status_codes': '*>i'}}}, + '3b06:48d8::/40': {'index': {1: {'locprf': '160', + 'metric': '100', + 'next_hop': '20.3.7.2', + 'origin_codes': '?', + 'path': '210498', + 'status_codes': '*>i', + 'weight': '0'}}}, + '3b13:950:2::/127': {'index': {1: {'locprf': '0', + 'next_hop': '20.3.12.2', + 'origin_codes': 'i', + 'path': '0', + 'status_codes': '*>i', + 'weight': '100'}}}, + '3b13:950:2::/48': {'index': {1: {'locprf': '100', + 'metric': '0', + 'next_hop': '196.114.157.54', + 'origin_codes': 'i', + 'path': '210367', + 'status_codes': '*i', + 'weight': '0'}, + 2: {'locprf': '100', + 'metric': '0', + 'next_hop': '20.3.12.2', + 'origin_codes': 'i', + 'path': '210367', + 'status_codes': '*>i', + 'weight': '0'}}}, + '3b13:950:2::3/127': {'index': {1: {'locprf': '0', + 'next_hop': '20.3.12.2', + 'origin_codes': 'i', + 'path': '0', + 'status_codes': '*>i', + 'weight': '100'}}}, + '::/0': {'index': {1: {'locprf': '205', + 'next_hop': '196.114.157.10', + 'origin_codes': 'i', + 'status_codes': '*>i', + 'weight': '0'}}}}, + 'processed_paths': 72, + 'processed_prefix': 51, + 'rd_version': 217935, + 'route_distinguisher': '20.3.3.1:100', + 'router_identifier': '20.3.3.1', + 'table_id': '0xe0800011', + 'table_state': 'active', + 'vrf_id': '0x60000002', + 'vrf_state': 'active'}}}}} diff --git a/src/genie/libs/parser/iosxr/tests/ShowBgpVrf/cli/equal/golden_output_8_output.txt b/src/genie/libs/parser/iosxr/tests/ShowBgpVrf/cli/equal/golden_output_8_output.txt new file mode 100644 index 0000000000..8a4311d869 --- /dev/null +++ b/src/genie/libs/parser/iosxr/tests/ShowBgpVrf/cli/equal/golden_output_8_output.txt @@ -0,0 +1,130 @@ +show bgp vrf xNet ipv6 unicast +BGP VRF xNet, state: Active +BGP Route Distinguisher: 20.3.3.1:100 +VRF ID: 0x60000002 +BGP router identifier 20.3.3.1, local AS number 4852 +Non-stop routing is enabled +BGP table state: Active +Table ID: 0xe0800011 RD version: 217935 +BGP main routing table version 217936 +BGP NSR Initial initsync version 17 (Reached) +BGP NSR/ISSU Sync-Group versions 217936/0 + +Status codes: s suppressed, d damped, h history, * valid, > best + i - internal, r RIB-failure, S stale, N Nexthop-discard +Origin codes: i - IGP, e - EGP, ? - incomplete + Network Next Hop Metric LocPrf Weight Path +Route Distinguisher: 20.3.3.1:100 (default for vrf xNet) +Route Distinguisher Version: 217935 +*>i::/0 196.114.157.10 205 0 i +*>i3001:828::3:116/128 + 196.114.157.25 1000 100 0 65086 i +*>i3001:828:0:700:0:2a:2a:20/127 + 20.3.1.1 0 100 0 i +*>i3001:828:0:700:0:3b:3b:20/127 + 20.3.3.2 0 100 0 i +*>i3001:828:0:700:0:258:258:20/127 + 196.114.157.10 0 100 0 i +*>i3001:828:19::/56 196.114.157.8 100 100 0 i +* 3001:828:19:3::2 + 150 0 i +*>i3001:828:300:2::4:20/127 + 20.3.9.2 0 100 0 i +*>i3001:828:300:2::4:30/127 + 20.3.7.2 0 100 0 i +*>i3001:828:300:2::5:20/127 + 20.3.9.2 0 100 0 i +*>i3001:828:300:2::5:30/127 + 20.3.7.2 0 100 0 i +*>i3001:828:300:26::/64 + 20.3.9.2 100 100 0 65221 ? +*>i3001:828:300:27::/64 + 20.3.9.2 100 100 0 65221 ? +*>i3001:828:300:28::/64 + 20.3.9.2 100 100 0 65221 ? +*>i3001:828:301:ffff::/64 + 20.3.9.2 100 100 0 65221 ? +*>i3001:828:316::/48 20.3.9.2 100 100 0 65221 ? +*>i3001:828:317::/48 20.3.9.2 100 100 0 65221 ? +*>i3001:828:318::/48 20.3.9.2 100 100 0 65221 ? +*>i3001:828:900:7::2:0/126 + 196.114.157.25 0 100 0 i +*>i3001:828:900:7::3:0/126 + 20.3.4.2 0 100 0 i +*>i3001:828:907::/48 20.3.4.2 200 100 0 65086 i +*>i3001:828:1300:7::20/127 + 20.3.6.2 0 100 0 i +*>i3001:828:1300:7:196:114:124:90/125 + 20.3.6.2 100 0 65031 i +*>i3001:828:1307:20:306::/112 + 20.3.6.2 100 0 65031 i +*>i3001:828:1307:193:169:202::/112 + 20.3.6.2 100 0 65031 i +*>i3001:828:1307:196:114:124:106:0/112 + 20.3.6.2 100 0 65031 i +*>i3001:828:1307:196:114:124:138:0/112 + 20.3.6.2 100 0 65031 i +*>i3001:828:1500:4::/64 + 20.3.5.2 0 100 0 i +*>i3001:828:1504::/48 20.3.5.2 0 100 0 i +*>i3001:828:2f09::/48 196.114.157.8 100 100 0 i +* 3001:828:19:3::2 + 150 0 i +*>i2700:2000:5130:f4gc:0:3d::/128 + 2.1.1.1 1 210 0 i +N i 200::2 1 210 0 i +*>i2700:2000:5130:f4gc:0:4e::/128 + 2.1.1.1 1 210 0 i +N i 200::2 1 210 0 i +*>i2700:2000:5130:f4gc:0:52::/128 + 2.1.1.1 1 210 0 i +N i 200::2 1 210 0 i +*>i2700:2000:5130:f4gc:0:5b::/128 + 2.1.1.1 1 210 0 i +N i 200::2 1 210 0 i +*>i2700:2000:5130:f4gc:0:5f::/128 + 2.1.1.1 1 210 0 i +N i 200::2 1 210 0 i +*>i2700:2000:5130:f4gc:0:65::/128 + 2.1.1.1 1 210 0 i +N i 200::2 1 210 0 i +*>i2700:2000:5130:f4gc:0:68::/128 + 2.1.1.1 1 210 0 i +N i 200::2 1 210 0 i +*>i2700:2000:5130:f4gc:0:72::/128 + 2.1.1.1 1 210 0 i +N i 200::2 1 210 0 i +*>i2700:2000:5130:f4gc:0:96::/128 + 2.1.1.1 1 210 0 i +N i 200::2 1 210 0 i +*>i2700:2000:5130:f4gc:0:97::/128 + 2.1.1.1 1 210 0 i +N i 200::2 1 210 0 i +*>i2700:2000:5130:f4gc:0:98::/128 + 2.1.1.1 1 210 0 i +N i 200::2 1 210 0 i +*>i2700:2000:5130:f4gc:0:99::/128 + 2.1.1.1 1 210 0 i +N i 200::2 1 210 0 i +*>i2700:2000:5130:f4gc:0:9a::/128 + 2.1.1.1 1 210 0 i +N i 200::2 1 210 0 i +*>i2700:2000:5130:f4gc:0:9d::/128 + 2.1.1.1 1 210 0 i +N i 200::2 1 210 0 i +*>i2700:2000:5130:f4gc:0:9e::/128 + 2.1.1.1 1 210 0 i +N i 200::2 1 210 0 i +*>i2700:2000:5130:f4gc:0:a1::/128 + 2.1.1.1 1 210 0 i +N i 200::2 1 210 0 i +*>i2700:2000:5130:f4gc:0:a2::/128 + 2.1.1.1 1 210 0 i +N i 200::2 1 210 0 i +*>i3b06:48d8::/40 20.3.7.2 100 160 0 210498 ? +* i3b13:950:2::/48 196.114.157.54 0 100 0 210367 i +*>i 20.3.12.2 0 100 0 210367 i +*>i3b13:950:2::/127 20.3.12.2 0 100 0 i +*>i3b13:950:2::3/127 20.3.12.2 0 100 0 i + +Processed 51 prefixes, 72 paths