CiscoTestAutomation / genieparser

sub-component of Genie that parse the device output into structured datastructure
Apache License 2.0
248 stars 385 forks source link

IOSXR: ShowL2VPNBridgeDomainDetail parser bug #760

Closed agandl046 closed 9 months ago

agandl046 commented 1 year ago

For IOSXR, this expected output is wrong: https://github.com/CiscoTestAutomation/genieparser/blob/master/src/genie/libs/parser/iosxr/tests/ShowL2vpnBridgeDomainDetail/cli/equal/golden7_expected.py

It is hiding a bug in the ShowL2VPNBridgeDomainDetail parser: https://github.com/CiscoTestAutomation/genieparser/blob/master/src/genie/libs/parser/iosxr/show_l2vpn.py#L1258

In golden7_expected.py starting with Bridge group B2C, the vfi section is incorrect. For domain SEG180, it includes the Access PW for domain SEG242. For domain SEG242, it includes the Access PW for domain SEG244. This pattern continues for the other groups and domains.

sumitsehgal123 commented 1 year ago

Hi . Thanks for reaching out piestack support team, I will be looking at your ticket and reviewing it . Recommend is to always use the latest pyats version (i.e. Current released version 23.7)

sumitsehgal123 commented 1 year ago

Hi , I will be working on your ticket. I'll get back to you once I have any update on it.

iamsatyanarayan commented 1 year ago

Hi @agandl046 I am seeing the proper value in this line. Kindly let me know what is the exact issue you are facing.

agandl046 commented 1 year ago

@iamsatyanarayan That link to the line didn't work for me, but the issue is in the expected.py, not the output.txt.

In this section from the golden7_output.txt, group BC2 domain SEG180 should have a PW with neighbor value 10.11.44.8. But nowhere in the golden7_expected.py is there 10.11.44.8. Additionally, SEG180 should only have 10.11.44.92 as a neighbor under vfi but it also has 10.11.44.12 as a neighbor. This neighbor comes from the Access PW under SEG242, which can be confirmed since the pw_id for 10.11.44.12 in golden7_expected.py is 242 instead of 180.

What appears to be happening in the parser is that the first time a PW under List of Access PWs is encountered, it is ignored and then the second time a PW under List of Access PWs is encountered, it is added as a neighbor under vfi to the previous group/domain (instead of the current). If you look at every neighbor IP under List of Access PWs, you will see that it is under the wrong group and/or domain.

Output section:

Bridge group: B2C, bridge-domain: SEG180, id: 138, state: up, ShgId: 0, MSTi: 0
  ... (truncated)
  ACs: 2 (2 up), VFIs: 1, PWs: 2 (1 up), PBBs: 0 (0 up), VNIs: 0 (0 up)
  List of ACs:
  ... (truncated)
  List of Access PWs:
    PW: neighbor 10.11.44.8, PW ID 180, state is standby ( all ready )
      ... (truncated)
      Storm Control: bridge-domain policer
  List of VFIs:
    VFI SEG180 (up)
      PW: neighbor 10.11.44.92, PW ID 99180, state is up ( established )
      ... (truncated)
      VFI Statistics:
        drops: illegal VLAN 0, illegal length 0
  List of Access VFIs:

Bridge group: B2C, bridge-domain: SEG242, id: 252, state: up, ShgId: 0, MSTi: 0
  ... (truncated)
  List of Access PWs:
    PW: neighbor 10.11.44.12, PW ID 242, state is standby ( all ready )
      ... (truncated)
      Storm Control: bridge-domain policer
  List of VFIs:
    VFI SEG242 (up)
      PW: neighbor 10.11.44.92, PW ID 99242, state is up ( established )
      ... (truncated)
  List of Access VFIs:

Expected Section:

... (truncated)
"B2C": {
    "bridge_domain": {
        "SEG180": {
            "state": "up",
            "id": 138,
            ... (truncated)
            "vfi": {
                "num_vfi": 1, <<< SAYS 1, BUT THERE ARE 2
                "SEG180": {
                    "state": "up",
                    "neighbor": {
                        "10.11.44.92": {
                            "pw_id": {
                                "99180": {
                                    ... (truncated)
                                 }
                            }
                        },
                        "10.11.44.12": { <<< SHOULD ACCESS PW BE UNDER SEG242
                            "pw_id": {
                                "242": {
                                    ...  (truncated)
                              }
                        },
iamsatyanarayan commented 1 year ago

Hi @agandl046 as you mentioned in the issue in expected output_7.py:- "10.11.44.12": SHOULD ACCESS PW BE UNDER SEG242 that I got it but secondly you mentioned "num_vfi": 1, <<< SAYS 1, BUT THERE ARE 2 that i didn't get it properly can you please explain ?

agandl046 commented 1 year ago

@iamsatyanarayan For context, I am not a network engineer so I may use some terms incorrectly or misunderstand the reasoning behind the schema structure.

I agree that the CLI output confirms that there should be 1 VFI. My comment was meant to point out that 10.11.44.12 was under the vfi section instead of under the pw section. Which is where I assume the Access PWs should go. This part of the schema, for reference.

iamsatyanarayan commented 1 year ago

Hi @agandl046 I am looking into this. I will inform you once I have any update regarding this issue.

kameswararaot commented 1 year ago

Hi @agandl046 I am looking into this. I will inform you once I have any update regarding this issue.

kameswararaot commented 12 months ago

Hi @agandl046,

I am checking this issue with my team. I will get back to you.

kameswararaot commented 11 months ago

Hi @agandl046,

Still I am working on this issue with my team. I will get back to you.

SohanTirpude commented 9 months ago

Hello @agandl046,

For this issue we merged the PR, so the fix will be available in upcoming pyATS version. Hence, I am closing this issue. If you are still seeing this issue with newer pyATS version, then kindly let me know. If you have any other issues, kindly open a new ticket.

Thank you.