|
7 | 7 | #include "ut_helper.h" |
8 | 8 | #include "mock_orchagent_main.h" |
9 | 9 | #include "mock_table.h" |
10 | | -#include "mock_response_publisher.h" |
11 | 10 | #include "bulker.h" |
12 | 11 |
|
13 | 12 | extern string gMySwitchType; |
14 | 13 |
|
15 | | -extern std::unique_ptr<MockResponsePublisher> gMockResponsePublisher; |
16 | | - |
17 | | -using ::testing::_; |
18 | 14 |
|
19 | 15 | namespace routeorch_test |
20 | 16 | { |
@@ -286,10 +282,6 @@ namespace routeorch_test |
286 | 282 | {"mac_addr", "00:00:00:00:00:00" }}); |
287 | 283 | intfTable.set("Ethernet0:10.0.0.1/24", { { "scope", "global" }, |
288 | 284 | { "family", "IPv4" }}); |
289 | | - intfTable.set("Ethernet4", { {"NULL", "NULL" }, |
290 | | - {"mac_addr", "00:00:00:00:00:00" }}); |
291 | | - intfTable.set("Ethernet4:11.0.0.1/32", { { "scope", "global" }, |
292 | | - { "family", "IPv4" }}); |
293 | 285 | gIntfsOrch->addExistingData(&intfTable); |
294 | 286 | static_cast<Orch *>(gIntfsOrch)->doTask(); |
295 | 287 |
|
@@ -430,58 +422,4 @@ namespace routeorch_test |
430 | 422 | ASSERT_EQ(current_set_count + 1, set_route_count); |
431 | 423 | ASSERT_EQ(sai_fail_count, 0); |
432 | 424 | } |
433 | | - |
434 | | - TEST_F(RouteOrchTest, RouteOrchTestSetDelResponse) |
435 | | - { |
436 | | - gMockResponsePublisher = std::make_unique<MockResponsePublisher>(); |
437 | | - |
438 | | - std::deque<KeyOpFieldsValuesTuple> entries; |
439 | | - std::string key = "2.2.2.0/24"; |
440 | | - std::vector<FieldValueTuple> fvs{{"ifname", "Ethernet0,Ethernet0"}, {"nexthop", "10.0.0.2,10.0.0.3"}, {"protocol", "bgp"}}; |
441 | | - entries.push_back({key, "SET", fvs}); |
442 | | - |
443 | | - auto consumer = dynamic_cast<Consumer *>(gRouteOrch->getExecutor(APP_ROUTE_TABLE_NAME)); |
444 | | - consumer->addToSync(entries); |
445 | | - |
446 | | - EXPECT_CALL(*gMockResponsePublisher, publish(APP_ROUTE_TABLE_NAME, key, std::vector<FieldValueTuple>{{"protocol", "bgp"}}, ReturnCode(SAI_STATUS_SUCCESS), false)).Times(1); |
447 | | - static_cast<Orch *>(gRouteOrch)->doTask(); |
448 | | - |
449 | | - // add entries again to the consumer queue (in case of rapid DEL/SET operations from fpmsyncd, routeorch just gets the last SET update) |
450 | | - consumer->addToSync(entries); |
451 | | - |
452 | | - EXPECT_CALL(*gMockResponsePublisher, publish(APP_ROUTE_TABLE_NAME, key, std::vector<FieldValueTuple>{{"protocol", "bgp"}}, ReturnCode(SAI_STATUS_SUCCESS), false)).Times(1); |
453 | | - static_cast<Orch *>(gRouteOrch)->doTask(); |
454 | | - |
455 | | - entries.clear(); |
456 | | - |
457 | | - // Route deletion |
458 | | - |
459 | | - entries.clear(); |
460 | | - entries.push_back({key, "DEL", {}}); |
461 | | - |
462 | | - consumer->addToSync(entries); |
463 | | - |
464 | | - EXPECT_CALL(*gMockResponsePublisher, publish(APP_ROUTE_TABLE_NAME, key, std::vector<FieldValueTuple>{}, ReturnCode(SAI_STATUS_SUCCESS), false)).Times(1); |
465 | | - static_cast<Orch *>(gRouteOrch)->doTask(); |
466 | | - |
467 | | - gMockResponsePublisher.reset(); |
468 | | - } |
469 | | - |
470 | | - TEST_F(RouteOrchTest, RouteOrchSetFullMaskSubnetPrefix) |
471 | | - { |
472 | | - gMockResponsePublisher = std::make_unique<MockResponsePublisher>(); |
473 | | - |
474 | | - std::deque<KeyOpFieldsValuesTuple> entries; |
475 | | - std::string key = "11.0.0.1/32"; |
476 | | - std::vector<FieldValueTuple> fvs{{"ifname", "Ethernet4"}, {"nexthop", "0.0.0.0"}, {"protocol", "bgp"}}; |
477 | | - entries.push_back({key, "SET", fvs}); |
478 | | - |
479 | | - auto consumer = dynamic_cast<Consumer *>(gRouteOrch->getExecutor(APP_ROUTE_TABLE_NAME)); |
480 | | - consumer->addToSync(entries); |
481 | | - |
482 | | - EXPECT_CALL(*gMockResponsePublisher, publish(APP_ROUTE_TABLE_NAME, key, std::vector<FieldValueTuple>{{"protocol", "bgp"}}, ReturnCode(SAI_STATUS_SUCCESS), false)).Times(1); |
483 | | - static_cast<Orch *>(gRouteOrch)->doTask(); |
484 | | - |
485 | | - gMockResponsePublisher.reset(); |
486 | | - } |
487 | 425 | } |
0 commit comments