Skip to content

Commit

Permalink
Fix coverage
Browse files Browse the repository at this point in the history
Signed-off-by: Vivek Reddy <[email protected]>
  • Loading branch information
vivekrnv committed Dec 8, 2023
1 parent 3456f5c commit 504ae4a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/mock_tests/warmrestarthelper_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ namespace wrhelper_test
{"nexthop", "2.1.0.0"},
{"weight", "1"},
});
m_routeTable->set("1.2.0.0/24",
{
{"ifname", "eth2"},
{"nexthop", "2.2.0.0"},
{"weight", "1"},
{"random_attrib", "random_val"},
});
wrHelper->runRestoration();
ASSERT_EQ(wrHelper->getState(), WarmStart::RESTORED);

Expand All @@ -70,6 +77,16 @@ namespace wrhelper_test
{"protocol", "kernel"}
}
});
wrHelper->insertRefreshMap({
"1.2.0.0/24",
"SET",
{
{"ifname", "eth2"},
{"nexthop", "2.2.0.0"},
{"weight", "1"},
{"protocol", "kernel"}
}
});
wrHelper->reconcile();
ASSERT_EQ(wrHelper->getState(), WarmStart::RECONCILED);

Expand All @@ -82,5 +99,8 @@ namespace wrhelper_test

m_routeTable->hget("1.1.0.0/24", "weight", val);
ASSERT_EQ(val, "4");

m_routeTable->hget("1.2.0.0/24", "protocol", val);
ASSERT_EQ(val, "kernel");
}
}

0 comments on commit 504ae4a

Please sign in to comment.