[MDSAL-177] BA comparison fails when comparing augmentation Created: 27/Jun/16  Updated: 09/Mar/18  Resolved: 18/Aug/16

Status: Resolved
Project: mdsal
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Claudio David Gasparini Assignee: Filip Gregor
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Attachments: Text File BA.txt    
Issue Links:
Blocks
blocks BGPCEP-476 Implement RibSupport tests for extens... Resolved
External issue ID: 6113

 Description   

We are suffering some issues comparing BA.

The corresponding model is

grouping flowspec-l3vpn-ipv6-routes {
container flowspec-l3vpn-ipv6-routes {
uses flowspec-ipv6-route {
augment "flowspec-route"

{ uses flowspec-l3vpn-rd; }

}
}
}

When FlowspecRouteBuilder#Equals

if (!e.getValue().equals(other.getAugmentation(e.getKey()))) {

First object contains Route distinguisher as augmentation, meanwhile the other contains it as children, therefore it fails.

Firs object creation

ROUTE = new FlowspecRouteBuilder().setKey(ROUTE_KEY)
.setPathId(PATH_ID).setFlowspec(FLOW_LIST)
.setAttributes(new AttributesBuilder().build())
.addAugmentation(FlowspecRoute1.class, new FlowspecRoute1Builder().setRouteDistinguisher(RD).build()).build();

Second one is readed from DS and converted using BindingToNormalizedNodeCodec->fromNormalizedNode



 Comments   
Comment by Claudio David Gasparini [ 27/Jun/16 ]

Attachment BA.txt has been added with description: BA Containers

Comment by Claudio David Gasparini [ 11/Jul/16 ]

we write to DS a flowspec-route

Yii

/(urn:opendaylight:params:xml:ns:yang:bgp-rib?revision=2013-09-25)bgp-rib/rib/rib[

{(urn:opendaylight:params:xml:ns:yang:bgp-rib?revision=2013-09-25)id=rib}

]/loc-rib/tables/tables[

{(urn:opendaylight:params:xml:ns:yang:bgp-rib?revision=2013-09-25)afi=(urn:opendaylight:params:xml:ns:yang:bgp-types?revision=2013-09-19)ipv6-address-family, (urn:opendaylight:params:xml:ns:yang:bgp-rib?revision=2013-09-25)safi=(urn:opendaylight:params:xml:ns:yang:bgp-flowspec?revision=2015-08-07)flowspec-l3vpn-subsequent-address-family}

]/routes/(urn:opendaylight:params:xml:ns:yang:bgp-flowspec?revision=2015-08-07)flowspec-l3vpn-ipv6-routes/flowspec-route/flowspec-route[

{(urn:opendaylight:params:xml:ns:yang:bgp-flowspec?revision=2015-08-07)path-id=1, (urn:opendaylight:params:xml:ns:yang:bgp-flowspec?revision=2015-08-07)route-key=[l3vpn with route-distinguisher 0:5:3] all packets to 2001:db8:1:2::/64}

]

MapEntry

ImmutableMapEntryNode{nodeIdentifier=(urn:opendaylight:params:xml:ns:yang:bgp-flowspec?revision=2015-08-07)flowspec-route[

{( urn:opendaylight:params:xml:ns:yang:bgp-flowspec?revision=2015-08-07)path-id=1, (urn:opendaylight:params:xml:ns:yang:bgp-flowspec?revision=2015-08-07)route-key=[l3vpn with route-distinguisher 0:5:3] all packets to 2001:db8:1:2::/64}

], value=[
ImmutableContainerNode{nodeIdentifier=(urn:opendaylight:params:xml:ns:yang:bgp-flowspec?revision=2015-08-07)attributes, value=[], attributes={}},
ImmutableLeafNode{nodeIdentifier=(urn:opendaylight:params:xml:ns:yang:bgp-flowspec?revision=2015-08-07)path-id, value=1, attributes={}},
ImmutableLeafNode{nodeIdentifier=(urn:opendaylight:params:xml:ns:yang:bgp-flowspec?revision=2015-08-07)route-distinguisher, value=0:5:3, attributes={}},
ImmutableUnkeyedListNode{nodeIdentifier=(urn:opendaylight:params:xml:ns:yang:bgp-flowspec?revision=2015-08-07)flowspec, value=[
ImmutableUnkeyedListEntryNode{nodeIdentifier=(urn:opendaylight:params:xml:ns:yang:bgp-flowspec?revision=2015-08-07)flowspec, value=[
ImmutableChoiceNode{nodeIdentifier=(urn:opendaylight:params:xml:ns:yang:bgp-flowspec?revision=2015-08-07)flowspec-type, value=[
ImmutableLeafNode{nodeIdentifier=(urn:opendaylight:params:xml:ns:yang:bgp-flowspec?revision=2015-08-07)destination-prefix, value=2001:db8:1:2::/64, attributes={}}]}], attributes={}}]},
ImmutableLeafNode{nodeIdentifier=(urn:opendaylight:params:xml:ns:yang:bgp-flowspec?revision=2015-08-07)route-key,
value=[l3vpn with route-distinguisher 0:5:3] all packets to 2001:db8:1:2::/64, attributes={}}], attributes={}}

then we use BindingToNormalizedNodeCodec#fromNormalizedNode to convert to BA and we obtain DataObject
where we observe that the route is almost the expected one, but there is missing the route-distinguisher as a augmentation
inside the LazyObject data contains the 5 children with all info, but cacheData instead only contains 4 there is missin route-distinguisher.

inside context, I see possibleAugmentation -> route-distinguisher.

So I guess there is some missing step in adding the augmentation to dataCache or where is required, I'm not familiar
with the code, so just pointing some posibilities.

Generated at Wed Feb 07 20:08:52 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.