Skip to content

Commit

Permalink
[staticroutebfd] add UT for an invalid key logging issue.
Browse files Browse the repository at this point in the history
add UT for an invalid key logging issue.
  • Loading branch information
baorliu committed Dec 4, 2023
1 parent 64ac061 commit da233e3
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/sonic-bgpcfgd/tests/test_static_rt_bfd.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,23 @@ def test_set_del_ipv6():
{'del_default:2603:10e2:400::4/128': { }}
)

@patch('staticroutebfd.main.log_err')
def test_invalid_key(mocked_log_err):
dut = constructor()
intf_setup(dut)

set_del_test(dut, "srt",
"SET",
("2.2.2/24", {
"bfd": "true",
"nexthop": "192.168.1.2 , 192.168.2.2, 192.168.3.2",
"ifname": "if1, if2, if3",
}),
{},
{}
)
mocked_log_err.assert_called_with("invalid ip prefix for static route: '2.2.2/24'")

def test_set_del():
dut = constructor()
intf_setup(dut)
Expand Down

0 comments on commit da233e3

Please sign in to comment.