Skip to content

Commit

Permalink
Merge "Reverse the routing-instance to route-aggregate link"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Jan 6, 2016
2 parents c95d70c + 8631eb1 commit daadb34
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions src/bgp/bgp_config_listener.cc
Expand Up @@ -58,7 +58,7 @@ void BgpConfigListener::DependencyTrackerInit() {
("connection", list_of("self"))
("virtual-network-routing-instance", list_of("self"))
("routing-policy-routing-instance", list_of("self"))
("routing-instance-route-aggregate", list_of("self"));
("route-aggregate-routing-instance", list_of("self"));
policy->insert(make_pair("routing-instance", rt_instance_react));

ReactionMap routing_policy_assoc_react = map_list_of<string, PropagateList>
Expand All @@ -78,6 +78,6 @@ void BgpConfigListener::DependencyTrackerInit() {
policy->insert(make_pair("virtual-network", virtual_network_react));

ReactionMap route_aggregate_react = map_list_of<string, PropagateList>
("self", list_of("routing-instance-route-aggregate"));
("self", list_of("route-aggregate-routing-instance"));
policy->insert(make_pair("route-aggregate", route_aggregate_react));
}
4 changes: 2 additions & 2 deletions src/bgp/bgp_config_parser.cc
Expand Up @@ -306,11 +306,11 @@ static bool ParseInstanceRouteAggregate(const string &instance,
if (add_change) {
MapObjectLinkAttr("routing-instance", instance,
"route-aggregate", aggregate_name,
"routing-instance-route-aggregate", NULL, requests);
"route-aggregate-routing-instance", NULL, requests);
} else {
MapObjectUnlink("routing-instance", instance,
"route-aggregate", aggregate_name,
"routing-instance-route-aggregate", requests);
"route-aggregate-routing-instance", requests);
}

return true;
Expand Down
10 changes: 5 additions & 5 deletions src/bgp/test/bgp_config_listener_test.cc
Expand Up @@ -2056,7 +2056,7 @@ TEST_F(BgpConfigListenerTest, RouteAggregate_1) {
PauseChangeListPropagation();
// unlink routing instance and route aggregate
ifmap_test_util::IFMapMsgUnlink(&db_, "routing-instance", "test",
"route-aggregate", "vn_subnet", "routing-instance-route-aggregate");
"route-aggregate", "vn_subnet", "route-aggregate-routing-instance");
task_util::WaitForIdle();

TASK_UTIL_EXPECT_EQ(0, GetChangeListCount());
Expand Down Expand Up @@ -2089,15 +2089,15 @@ TEST_F(BgpConfigListenerTest, RouteAggregate_2) {

// unlink routing instance and route aggregate
ifmap_test_util::IFMapMsgUnlink(&db_, "routing-instance", "test",
"route-aggregate", "vn_subnet", "routing-instance-route-aggregate");
"route-aggregate", "vn_subnet", "route-aggregate-routing-instance");
task_util::WaitForIdle();

TASK_UTIL_EXPECT_EQ(0, GetChangeListCount());

PauseChangeListPropagation();
// link routing instance and route aggregate
ifmap_test_util::IFMapMsgLink(&db_, "routing-instance", "test",
"route-aggregate", "vn_subnet", "routing-instance-route-aggregate");
"route-aggregate", "vn_subnet", "route-aggregate-routing-instance");
task_util::WaitForIdle();
TASK_UTIL_EXPECT_EQ(0, GetChangeListCount());
TASK_UTIL_EXPECT_EQ(0, GetNodeListCount());
Expand Down Expand Up @@ -2129,7 +2129,7 @@ TEST_F(BgpConfigListenerTest, RouteAggregate_3) {

// unlink routing instance and route aggregate
ifmap_test_util::IFMapMsgUnlink(&db_, "routing-instance", "test",
"route-aggregate", "vn_subnet", "routing-instance-route-aggregate");
"route-aggregate", "vn_subnet", "route-aggregate-routing-instance");
task_util::WaitForIdle();

TASK_UTIL_EXPECT_EQ(0, GetChangeListCount());
Expand Down Expand Up @@ -2241,7 +2241,7 @@ TEST_F(BgpConfigListenerTest, RouteAggregate_6) {
PauseChangeListPropagation();
// unlink routing instance and route aggregate
ifmap_test_util::IFMapMsgUnlink(&db_, "routing-instance", "test_0",
"route-aggregate", "vn_subnet_0", "routing-instance-route-aggregate");
"route-aggregate", "vn_subnet_0", "route-aggregate-routing-instance");
task_util::WaitForIdle();

TASK_UTIL_EXPECT_EQ(0, GetChangeListCount());
Expand Down
8 changes: 4 additions & 4 deletions src/bgp/test/bgp_ifmap_config_manager_test.cc
Expand Up @@ -2250,15 +2250,15 @@ TEST_F(BgpIfmapConfigManagerTest, RouteAggregate_Unlink) {

// unlink routing instance and route aggregate
ifmap_test_util::IFMapMsgUnlink(&db_, "routing-instance", "test",
"route-aggregate", "vn_subnet_0", "routing-instance-route-aggregate");
"route-aggregate", "vn_subnet_0", "route-aggregate-routing-instance");
task_util::WaitForIdle();

ASSERT_TRUE(test_ri->aggregate_routes(Address::INET).size() == 0);
ASSERT_TRUE(test_ri->aggregate_routes(Address::INET6).size() == 1);

// Link routing instance and route aggregate
ifmap_test_util::IFMapMsgLink(&db_, "routing-instance", "test",
"route-aggregate", "vn_subnet_0", "routing-instance-route-aggregate");
"route-aggregate", "vn_subnet_0", "route-aggregate-routing-instance");
task_util::WaitForIdle();

ASSERT_TRUE(test_ri->aggregate_routes(Address::INET).size() == 1);
Expand Down Expand Up @@ -2472,9 +2472,9 @@ TEST_F(BgpIfmapConfigManagerTest, RouteAggregate_MultipleInet_Unlink) {

// unlink routing instance and route aggregate
ifmap_test_util::IFMapMsgUnlink(&db_, "routing-instance", "test",
"route-aggregate", "vn_subnet_0", "routing-instance-route-aggregate");
"route-aggregate", "vn_subnet_0", "route-aggregate-routing-instance");
ifmap_test_util::IFMapMsgUnlink(&db_, "routing-instance", "test",
"route-aggregate", "vn_subnet_1", "routing-instance-route-aggregate");
"route-aggregate", "vn_subnet_1", "route-aggregate-routing-instance");
task_util::WaitForIdle();

ASSERT_TRUE(test_ri->aggregate_routes(Address::INET).size() == 1);
Expand Down
10 changes: 5 additions & 5 deletions src/bgp/test/route_aggregation_test.cc
Expand Up @@ -531,7 +531,7 @@ TEST_F(RouteAggregationTest, ConfigDelete) {

// Unlink the route aggregate config from vrf
ifmap_test_util::IFMapMsgUnlink(&config_db_, "routing-instance", "test",
"route-aggregate", "vn_subnet", "routing-instance-route-aggregate");
"route-aggregate", "vn_subnet", "route-aggregate-routing-instance");
task_util::WaitForIdle();

VERIFY_EQ(2, RouteCount("test.inet.0"));
Expand Down Expand Up @@ -669,12 +669,12 @@ TEST_F(RouteAggregationTest, ConfigDelete_Add) {

// Unlink the route aggregate config from vrf
ifmap_test_util::IFMapMsgUnlink(&config_db_, "routing-instance", "test",
"route-aggregate", "vn_subnet", "routing-instance-route-aggregate");
"route-aggregate", "vn_subnet", "route-aggregate-routing-instance");
task_util::WaitForIdle();

// Link the route aggregate config from vrf
ifmap_test_util::IFMapMsgLink(&config_db_, "routing-instance", "test",
"route-aggregate", "vn_subnet", "routing-instance-route-aggregate");
"route-aggregate", "vn_subnet", "route-aggregate-routing-instance");
task_util::WaitForIdle();

EnableUnregResolveTask("test", Address::INET);
Expand Down Expand Up @@ -876,7 +876,7 @@ TEST_F(RouteAggregationTest, ConfigDelete_DelayedRouteProcessing) {

// Unlink the route aggregate config from vrf
ifmap_test_util::IFMapMsgUnlink(&config_db_, "routing-instance", "test",
"route-aggregate", "vn_subnet", "routing-instance-route-aggregate");
"route-aggregate", "vn_subnet", "route-aggregate-routing-instance");
task_util::WaitForIdle();

EnableRouteAggregateUpdate("test", Address::INET);
Expand Down Expand Up @@ -920,7 +920,7 @@ TEST_F(RouteAggregationTest, ConfigDelete_DelayedRouteProcessing_1) {
DisableRouteAggregateUpdate("test", Address::INET);
// Unlink the route aggregate config from vrf
ifmap_test_util::IFMapMsgUnlink(&config_db_, "routing-instance", "test",
"route-aggregate", "vn_subnet", "routing-instance-route-aggregate");
"route-aggregate", "vn_subnet", "route-aggregate-routing-instance");
task_util::WaitForIdle();

EnableRouteAggregateUpdate("test", Address::INET);
Expand Down
6 changes: 3 additions & 3 deletions src/schema/bgp_schema.xsd
Expand Up @@ -39,10 +39,10 @@
<!--#IFMAP-SEMANTICS-IDL
Property('aggregate-route-entries', 'route-aggregate') -->

<xsd:element name="routing-instance-route-aggregate"/>
<xsd:element name="route-aggregate-routing-instance"/>
<!--#IFMAP-SEMANTICS-IDL
Link('routing-instance-route-aggregate',
'routing-instance', 'route-aggregate', ['ref']) -->
Link('route-aggregate-routing-instance',
'route-aggregate', 'routing-instance', ['ref']) -->

<xsd:simpleType name="SequenceNumberType">
<xsd:annotation>
Expand Down

0 comments on commit daadb34

Please sign in to comment.