-
Notifications
You must be signed in to change notification settings - Fork 525
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not allow to add port to .1Q bridge while router port deletion is …
…not completed (#2669) * Do not set port to be a bridge port while it is still a router port
- Loading branch information
Showing
3 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Define classes and functions to mock SAI bridge functions. | ||
#pragma once | ||
|
||
#include <gmock/gmock.h> | ||
|
||
extern "C" | ||
{ | ||
#include "sai.h" | ||
} | ||
|
||
// Mock class including mock functions mapping to SAI bridge functions. | ||
class MockSaiBridge | ||
{ | ||
public: | ||
MOCK_METHOD4(create_bridge_port, sai_status_t(sai_object_id_t *bridge_port_id, | ||
sai_object_id_t switch_id, | ||
uint32_t attr_count, | ||
const sai_attribute_t *attr_list)); | ||
}; | ||
|
||
// Note that before mock functions below are used, mock_sai_bridge must be | ||
// initialized to point to an instance of MockSaiBridge. | ||
MockSaiBridge *mock_sai_bridge; | ||
|
||
sai_status_t mock_create_bridge_port(sai_object_id_t *bridge_port_id, | ||
sai_object_id_t switch_id, | ||
uint32_t attr_count, | ||
const sai_attribute_t *attr_list) | ||
{ | ||
return mock_sai_bridge->create_bridge_port(bridge_port_id, switch_id, attr_count, attr_list); | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters