Add a unit test to use non-default bgp origin attribute

Bug #1723549 reported by Ananth Suryanarayana
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R3.2
Fix Committed
Medium
Ananth Suryanarayana
R4.0
Fix Committed
Medium
Ananth Suryanarayana
R4.1
Fix Committed
Medium
Ananth Suryanarayana
Trunk
Fix Committed
Medium
Ananth Suryanarayana

Bug Description

By default, we always use INCOMPLETE. Add a test to send a different attribute and also verify that it is received (encoded and decoded) correctly.

diff --git a/src/bgp/test/bgp_ip_test.cc b/src/bgp/test/bgp_ip_test.cc
index af05bfc..f9f83c4 100644
--- a/src/bgp/test/bgp_ip_test.cc
+++ b/src/bgp/test/bgp_ip_test.cc
@@ -270,7 +270,7 @@ protected:
         BgpTable *table = GetTable(server, instance);
         BgpAttrSpec attr_spec;

- BgpAttrOrigin origin_spec(BgpAttrOrigin::INCOMPLETE);
+ BgpAttrOrigin origin_spec(BgpAttrOrigin::IGP);
         attr_spec.push_back(&origin_spec);

         AsPathSpec path_spec;
@@ -333,6 +333,8 @@ protected:
                 continue;
             if (path->GetAttr()->nexthop().to_string() != nexthop)
                 continue;
+ if (path->GetAttr()->origin() != BgpAttrOrigin::IGP)
+ continue;
             return true;
         }
         return false;

Changed in juniperopenstack:
assignee: nobody → Ananth Suryanarayana (anantha-l)
Changed in juniperopenstack:
status: New → In Progress
milestone: none → r5.0.0
description: updated
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/36534
Submitter: Ananth Suryanarayana (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R4.0

Review in progress for https://review.opencontrail.org/36535
Submitter: Ananth Suryanarayana (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R4.1

Review in progress for https://review.opencontrail.org/36536
Submitter: Ananth Suryanarayana (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/36534
Submitter: Ananth Suryanarayana (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R3.2

Review in progress for https://review.opencontrail.org/36537
Submitter: Ananth Suryanarayana (<email address hidden>)

Nischal Sheth (nsheth)
tags: added: contrail-control
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/36536
Committed: http://github.com/Juniper/contrail-controller/commit/80413a7f615816206d784d17926c45ca88e41d48
Submitter: Zuul (<email address hidden>)
Branch: R4.1

commit 80413a7f615816206d784d17926c45ca88e41d48
Author: Ananth Suryanarayana <email address hidden>
Date: Fri Oct 13 16:27:47 2017 -0700

Add unit test to test non default BGP Route Origin

Add routes with non-default Origin such as IGP and verify that route is
received correctly over bgp. This ensures that both encode and decode worked
correctly

Change-Id: I99404e0dafc1878b13d422e271b3b734b43389aa
Closes-Bug: 1723549

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Reviewed: https://review.opencontrail.org/36535
Committed: http://github.com/Juniper/contrail-controller/commit/ddbf7d4d9483f601055346644aa6a00153a98704
Submitter: Zuul (<email address hidden>)
Branch: R4.0

commit ddbf7d4d9483f601055346644aa6a00153a98704
Author: Ananth Suryanarayana <email address hidden>
Date: Fri Oct 13 16:27:47 2017 -0700

Add unit test to test non default BGP Route Origin

Add routes with non-default Origin such as IGP and verify that route is
received correctly over bgp. This ensures that both encode and decode worked
correctly

Change-Id: I99404e0dafc1878b13d422e271b3b734b43389aa
Closes-Bug: 1723549

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Reviewed: https://review.opencontrail.org/36534
Committed: http://github.com/Juniper/contrail-controller/commit/ee8a80a7dcd4b092345b4bd8dfa006244dfcec3a
Submitter: Zuul (<email address hidden>)
Branch: master

commit ee8a80a7dcd4b092345b4bd8dfa006244dfcec3a
Author: Ananth Suryanarayana <email address hidden>
Date: Fri Oct 13 16:27:47 2017 -0700

Add unit test to test non default BGP Route Origin

Add routes with non-default Origin such as IGP and verify that route is
received correctly over bgp. This ensures that both encode and decode worked
correctly

Change-Id: I99404e0dafc1878b13d422e271b3b734b43389aa
Closes-Bug: 1723549

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Reviewed: https://review.opencontrail.org/36537
Committed: http://github.com/Juniper/contrail-controller/commit/bfc4e508f28e40bc38639f64d8eda5f8c8149cfa
Submitter: Zuul (<email address hidden>)
Branch: R3.2

commit bfc4e508f28e40bc38639f64d8eda5f8c8149cfa
Author: Ananth Suryanarayana <email address hidden>
Date: Fri Oct 13 16:27:47 2017 -0700

Add unit test to test non default BGP Route Origin

Add routes with non-default Origin such as IGP and verify that route is
received correctly over bgp. This ensures that both encode and decode worked
correctly

Change-Id: I99404e0dafc1878b13d422e271b3b734b43389aa
Closes-Bug: 1723549

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.