Skip to content

Commit

Permalink
Adjust the EBB open/r config regex tests to accommodate EbLocal change
Browse files Browse the repository at this point in the history
Summary: Because the MPLS labels 0-15 are reserved, naming for Eb-Local port-channels has been changed from Port-Channel{1 digit} to Port-Channel1000{1 digit} so that we can still use the ID of the Port-Channel as the MPLS label for the static MPLS routes. E.g., instead of Port-Channel1, the name will be Port-Channel10001. This diff adjusts the test for open/r regex accordingly.

Reviewed By: xiangxu1121, ngocdmfb

Differential Revision: D56543807

fbshipit-source-id: af939d9a916a67df3ba9be324139b0741d3577ef
  • Loading branch information
Saikat Ray authored and facebook-github-bot committed Apr 26, 2024
1 parent 6d43bf6 commit 36ab9b0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions openr/config/tests/ConfigTest.cpp
Expand Up @@ -222,17 +222,22 @@ TEST(ConfigTest, AreaConfiguration) {
TEST(ConfigTest, EbbInterfaceConfiguration) {
openr::thrift::AreaConfig areaConfig;
areaConfig.area_id() = "myArea";
areaConfig.include_interface_regexes()->emplace_back("po[0-9]{1}");
areaConfig.include_interface_regexes()->emplace_back("po1000[0-9]{1}");
areaConfig.include_interface_regexes()->emplace_back("po[0-9]{4}");
areaConfig.include_interface_regexes()->emplace_back("po[0-9]{6}");
Config cfg{getBasicOpenrConfig("node-1", {areaConfig})};

auto const& areaConf = cfg.getAreas().at("myArea");

EXPECT_TRUE(areaConf.shouldDiscoverOnIface("po1"));
EXPECT_FALSE(areaConf.shouldDiscoverOnIface("po1"));
EXPECT_FALSE(areaConf.shouldDiscoverOnIface("po12"));
EXPECT_FALSE(areaConf.shouldDiscoverOnIface("po123"));
EXPECT_TRUE(areaConf.shouldDiscoverOnIface("po1234"));
for (int i = 0; i < 10; ++i) {
std::string interfaceName = fmt::format("po1000{}", i);
EXPECT_TRUE(areaConf.shouldDiscoverOnIface(interfaceName));
}
EXPECT_FALSE(areaConf.shouldDiscoverOnIface("po10010"));
EXPECT_FALSE(areaConf.shouldDiscoverOnIface("po12345"));
EXPECT_TRUE(areaConf.shouldDiscoverOnIface("po123456"));
EXPECT_FALSE(areaConf.shouldDiscoverOnIface("po1234567"));
Expand Down

0 comments on commit 36ab9b0

Please sign in to comment.