Skip to content

Commit

Permalink
Merge "Make service_chain_test more robust"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Mar 1, 2016
2 parents e376377 + 66753a8 commit b20f1d5
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/bgp/test/service_chain_test.cc
Expand Up @@ -618,18 +618,24 @@ class ServiceChainTest : public ::testing::Test {
return dynamic_cast<BgpRoute *>(db_entry);
}

BgpRoute *VerifyRouteExists(const string &instance, const string &prefix) {
TASK_UTIL_EXPECT_TRUE(RouteLookup(instance, prefix) != NULL);
bool CheckRouteExists(const string &instance, const string &prefix) {
task_util::TaskSchedulerLock lock;
BgpRoute *rt = RouteLookup(instance, prefix);
if (rt == NULL) {
return NULL;
}
TASK_UTIL_EXPECT_TRUE(rt->BestPath() != NULL);
return rt;
return (rt && rt->BestPath() != NULL);
}

void VerifyRouteExists(const string &instance, const string &prefix) {
TASK_UTIL_EXPECT_TRUE(CheckRouteExists(instance, prefix));
}

bool CheckRouteNoExists(const string &instance, const string &prefix) {
task_util::TaskSchedulerLock lock;
BgpRoute *rt = RouteLookup(instance, prefix);
return !rt;
}

void VerifyRouteNoExists(const string &instance, const string &prefix) {
TASK_UTIL_EXPECT_TRUE(RouteLookup(instance, prefix) == NULL);
TASK_UTIL_EXPECT_TRUE(CheckRouteNoExists(instance, prefix));
}

void VerifyRouteIsDeleted(const string &instance, const string &prefix) {
Expand Down

0 comments on commit b20f1d5

Please sign in to comment.