diff --git a/src/bgp/test/graceful_restart_test.cc b/src/bgp/test/graceful_restart_test.cc index c101aafbf6c..a7382a8e376 100644 --- a/src/bgp/test/graceful_restart_test.cc +++ b/src/bgp/test/graceful_restart_test.cc @@ -896,7 +896,7 @@ test::NextHops GracefulRestartTest::GetNextHops (test::NetworkAgentMock *agent, test::NextHops nexthops; nexthops.push_back(test::NextHop("100.100.100." + boost::lexical_cast(agent->id()), - 10000 + instance_id)); + 10000 + instance_id, "gre")); return nexthops; } diff --git a/src/control-node/test/network_agent_mock.cc b/src/control-node/test/network_agent_mock.cc index 60b72e72cb5..be814a6382b 100644 --- a/src/control-node/test/network_agent_mock.cc +++ b/src/control-node/test/network_agent_mock.cc @@ -1023,7 +1023,7 @@ void NetworkAgentMock::AddRoute(const string &network_name, int local_pref, int med) { NextHops nexthops; if (!nexthop.empty()) { - nexthops.push_back(NextHop(nexthop, 0)); + nexthops.push_back(NextHop(nexthop)); } RouteAttributes attributes( local_pref, med, RouteAttributes::GetDefaultSequence()); @@ -1066,7 +1066,7 @@ void NetworkAgentMock::AddRoute(const string &network_name, const RouteAttributes &attributes) { NextHops nexthops; if (!nexthop.empty()) - nexthops.push_back(NextHop(nexthop, 0)); + nexthops.push_back(NextHop(nexthop)); AddRoute(network_name, prefix, nexthops, attributes); } @@ -1094,7 +1094,7 @@ void NetworkAgentMock::AddInet6Route(const string &network, const RouteAttributes &attributes) { NextHops nexthops; if (!nexthop.empty()) - nexthops.push_back(NextHop(nexthop, 0)); + nexthops.push_back(NextHop(nexthop)); AddInet6Route(network, prefix, nexthops, attributes); } @@ -1113,7 +1113,7 @@ void NetworkAgentMock::AddInet6Route(const string &network, int med) { NextHops nexthops; if (!nexthop_str.empty()) { - nexthops.push_back(NextHop(nexthop_str, 0)); + nexthops.push_back(NextHop(nexthop_str)); } RouteAttributes attributes( local_pref, med, RouteAttributes::GetDefaultSequence()); @@ -1140,7 +1140,7 @@ void NetworkAgentMock::DeleteInet6Route(const string &network, void NetworkAgentMock::AddBogusInet6Route(const string &network, const string &prefix, const string &nexthop, TestErrorType error_type) { NextHops nexthops; - nexthops.push_back(NextHop(nexthop, 0)); + nexthops.push_back(NextHop(nexthop)); AgentPeer *peer = GetAgent(); xml_document *xdoc = impl_->Inet6RouteAddBogusXmlDoc(network, prefix, @@ -1154,7 +1154,7 @@ void NetworkAgentMock::AddEnetRoute(const string &network_name, NextHops nexthops; if (!nexthop.empty()) { - nexthops.push_back(NextHop(nexthop, 0)); + nexthops.push_back(NextHop(nexthop)); } AddEnetRoute(network_name, prefix, nexthops, params); } @@ -1186,7 +1186,7 @@ void NetworkAgentMock::AddEnetRoute(const string &network_name, NextHops nexthops; if (!nexthop.empty()) - nexthops.push_back(NextHop(nexthop, 0)); + nexthops.push_back(NextHop(nexthop)); AddEnetRoute(network_name, prefix, nexthops, attributes); } diff --git a/src/control-node/test/network_agent_mock.h b/src/control-node/test/network_agent_mock.h index 49f8e0266dc..1e3d6c0efd3 100644 --- a/src/control-node/test/network_agent_mock.h +++ b/src/control-node/test/network_agent_mock.h @@ -191,18 +191,20 @@ struct NextHop { NextHop(bool no_label, std::string address) : address_(address), no_label_(no_label), label_(0) { } - NextHop(std::string address, uint32_t label, std::string tun1 = "gre", + NextHop(std::string address, uint32_t label, std::string tunnel, const std::string virtual_network = "") : address_(address), no_label_(false), label_(label), virtual_network_(virtual_network) { - if (tun1 == "all") { + if (tunnel.empty()) { + tunnel_encapsulations_.push_back("gre"); + } else if (tunnel == "all") { tunnel_encapsulations_.push_back("gre"); tunnel_encapsulations_.push_back("udp"); - } else if (tun1 == "all_ipv6") { + } else if (tunnel == "all_ipv6") { tunnel_encapsulations_.push_back("gre"); tunnel_encapsulations_.push_back("udp"); } else { - tunnel_encapsulations_.push_back(tun1); + tunnel_encapsulations_.push_back(tunnel); } }