-
Notifications
You must be signed in to change notification settings - Fork 666
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[config/show] Add command to control pending FIB suppression (#2495)
* [config/show] Add command to control pending FIB suppression What I did I added a command config suppress-pending-fib that will allow user to enable/disable this feature. Once it is enabled, BGP will wait for route to be programmed to HW before announcing the route to the peers. I also added a corresponding show command that prints the status of this feature.
- Loading branch information
1 parent
9e32962
commit 9126e7f
Showing
4 changed files
with
97 additions
and
2 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
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 @@ | ||
from click.testing import CliRunner | ||
|
||
import config.main as config | ||
import show.main as show | ||
from utilities_common.db import Db | ||
|
||
|
||
class TestSuppressFibPending: | ||
def test_synchronous_mode(self): | ||
runner = CliRunner() | ||
|
||
db = Db() | ||
|
||
result = runner.invoke(config.config.commands['suppress-fib-pending'], ['enabled'], obj=db) | ||
print(result.output) | ||
assert result.exit_code == 0 | ||
assert db.cfgdb.get_entry('DEVICE_METADATA' , 'localhost')['suppress-fib-pending'] == 'enabled' | ||
|
||
result = runner.invoke(show.cli.commands['suppress-fib-pending'], obj=db) | ||
assert result.exit_code == 0 | ||
assert result.output == 'Enabled\n' | ||
|
||
result = runner.invoke(config.config.commands['suppress-fib-pending'], ['disabled'], obj=db) | ||
print(result.output) | ||
assert result.exit_code == 0 | ||
assert db.cfgdb.get_entry('DEVICE_METADATA' , 'localhost')['suppress-fib-pending'] == 'disabled' | ||
|
||
result = runner.invoke(show.cli.commands['suppress-fib-pending'], obj=db) | ||
assert result.exit_code == 0 | ||
assert result.output == 'Disabled\n' | ||
|
||
result = runner.invoke(config.config.commands['suppress-fib-pending'], ['invalid-input'], obj=db) | ||
print(result.output) | ||
assert result.exit_code != 0 |