Skip to content

Commit

Permalink
Merge "Make bgp_show_neighbor_test more robust" into R2.20
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Aug 17, 2015
2 parents 35d130c + 1b79ac2 commit 91045f2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/bgp/bgp_xmpp_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2253,6 +2253,10 @@ void BgpXmppChannelManager::SetQueueDisable(bool disabled) {
queue_.set_disable(disabled);
}

size_t BgpXmppChannelManager::GetQueueSize() const {
return queue_.Length();
}

void BgpXmppChannelManager::ASNUpdateCallback(as_t old_asn,
as_t old_local_asn) {
BOOST_FOREACH(XmppChannelMap::value_type &i, channel_map_) {
Expand Down
1 change: 1 addition & 0 deletions src/bgp/bgp_xmpp_channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ class BgpXmppChannelManager {
}
bool IsReadyForDeletion();
void SetQueueDisable(bool disabled);
size_t GetQueueSize() const;
void RoutingInstanceCallback(std::string vrf_name, int op);
void ASNUpdateCallback(as_t old_asn, as_t old_local_asn);
void IdentifierUpdateCallback(Ip4Address old_identifier);
Expand Down
11 changes: 11 additions & 0 deletions src/bgp/test/bgp_show_neighbor_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,15 @@ class BgpShowNeighborTest : public ::testing::Test {
peer_y2->deleter()->ResumeDelete();
}

void VerifyBgpPeerDelete() {
BgpPeer *peer_y1 = bgp_server_x_->FindMatchingPeer(
BgpConfigManager::kMasterInstance, "Y1");
TASK_UTIL_EXPECT_TRUE(peer_y1->IsDeleted());
BgpPeer *peer_y2 = bgp_server_x_->FindMatchingPeer(
BgpConfigManager::kMasterInstance, "Y2");
TASK_UTIL_EXPECT_TRUE(peer_y2->IsDeleted());
}

void AddBgpPeerNames(vector<string> *neighbor_names,
const string &name = string()) {
if (name.empty() || name == "Y1") {
Expand Down Expand Up @@ -671,7 +680,9 @@ TYPED_TEST(BgpShowNeighborTest, RequestWithSearch8) {
this->PauseBgpPeerDelete();
this->bcm_x_->SetQueueDisable(true);
this->ShutdownAgents();
TASK_UTIL_EXPECT_EQ(12, this->bcm_x_->GetQueueSize());
this->bgp_server_x_->Shutdown(false);
this->VerifyBgpPeerDelete();
this->sandesh_context_.set_page_limit(0);
this->sandesh_context_.set_iter_limit(0);
vector<string> neighbor_names;
Expand Down

0 comments on commit 91045f2

Please sign in to comment.