tests: Enhance error messages for static route automation.
Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
)
assert (
result is True
- ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed Error: Routes are missing in RIB".format(tc_name)
step("Configure IBGP IPv4 peering between R2 and R3 router.")
step("Configure redistribute static in BGP on R2 router")
)
assert (
result is not True
- ), "Testcase {} : Failed" "Error: Routes is still present in RIB".format(
+ ), "Testcase {} : Failed Expected: Routes should not present in RIB \nError: Routes are still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
step("Configure the static route with nexthop N1")
tc_name, result
)
- step("Remove the static route configured with nexthop N2 from" "running config")
+ step("Remove the static route configured with nexthop N2 from running config")
input_dict_4 = {
"r2": {
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes is" " still present in RIB".format(
+ ), "Testcase {} : Failed \nExpected: Routes should not present in RIB \nError: Routes are still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
step("Configure the static route with nexthop N2")
input_dict_4 = {
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
nh = next_hop_ip["nh1"][addr_type]
result = verify_rib(
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes is" " still present in RIB".format(
+ ), "Testcase {} : Failed \nExpected: Routes should not present in RIB \nError: Routes are still present in RIB".format(
tc_name
)
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Route is" " still present in RIB".format(
+ ), "Testcase {} : Failed \nExpected: Routes should not present in RIB \nError: Route is still present in RIB".format(
tc_name
)
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Route is" " still present in RIB".format(
+ ), "Testcase {} : Failed \n Expected: Routes should not present in RIB \nError: Route is still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
dut = "r3"
result = verify_bgp_rib(tgen, addr_type, dut, input_dict_4)
assert (
result is True
- ), "Testcase {} : Failed \nError: Route is" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Route is missing in RIB".format(tc_name)
result = verify_rib(
tgen, addr_type, dut, input_dict_4, protocol=protocol, expected=False
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Route is" " still present in RIB".format(
+ ), "Testcase {} : Failed \nExpected: Routes should not present in RIB \nError: Route is still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
step("Shut nexthop interface N2")
intf = topo["routers"]["r2"]["links"]["r1-link1"]["interface"]
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes is" " still present in RIB".format(
+ ), "Testcase {} : Failed \nExpected: Routes should not present in RIB \nError: Routes are still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
dut = "r3"
result = verify_bgp_rib(tgen, addr_type, dut, input_dict_4)
assert (
result is True
- ), "Testcase {} : Failed \nError: Route is" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Route is missing in RIB".format(tc_name)
result = verify_rib(
tgen, addr_type, dut, input_dict_4, protocol=protocol, expected=False
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Route is" " still present in RIB".format(
+ ), "Testcase {} : Failed \nExpected: Routes should not present in RIB \nError: Route is still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
dut = "r3"
result = verify_bgp_rib(tgen, addr_type, dut, input_dict_4)
assert (
result is True
- ), "Testcase {} : Failed \nError: Route is" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Route is missing in RIB".format(tc_name)
result = verify_rib(
tgen, addr_type, dut, input_dict_4, protocol=protocol, expected=False
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Route is" " still present in RIB".format(
+ ), "Testcase {} : Failed \nExpected: Routes should not present in RIB \nError: Route is still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
dut = "r3"
result = verify_bgp_rib(tgen, addr_type, dut, input_dict_4)
assert (
result is True
- ), "Testcase {} : Failed \nError: Route is" " still present in RIB".format(
+ ), "Testcase {} : Failed \nError: Route is still present in RIB".format(
tc_name
)
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Route is" " still present in RIB".format(
+ ), "Testcase {} : Failed \nExpected: Routes should not present in RIB \nError: Route is still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" "missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
rte2_nh2 = {
"r2": {
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes is" "not active in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nExpected: Routes should not present in RIB \nError: Routes are not active in RIB".format(
+ tc_name
+ )
step("Configure IBGP IPv4 peering between R2 and R3 router.")
step("Explicit route is added in R3 for R2 nexthop rechability")
tc_name, result
)
- step("Remove the static route configured with nexthop N1 from" "running config")
+ step("Remove the static route configured with nexthop N1 from running config")
rt1_nh1 = {
"r2": {
"static_routes": [
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes is" "missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nExpected: Routes should not present in RIB \nError: Routes are missing in RIB".format(
+ tc_name
+ )
rte2_nh2 = {
"r2": {
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" "not active in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are not active in RIB".format(tc_name)
step("Configure the static route with nexthop N1")
rte1_nh1 = {
tc_name, result
)
- step("Remove the static route configured with nexthop N2 from" "running config")
+ step("Remove the static route configured with nexthop N2 from running config")
rte2_nh2 = {
"r2": {
"static_routes": [
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes is" " still present in RIB".format(
+ ), "Testcase {} : Failed \nExpected: Routes should not present in RIB \nError: Routes are still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
step("Configure the static route with nexthop N2")
rte2_nh2 = {
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes is" " still present in RIB".format(
+ ), "Testcase {} : Failed \nExpected: Routes should not present in RIB \nError: Routes are still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
step("No shut the nexthop interface N1")
shutdown_bringup_interface(tgen, dut, intf, True)
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
step("Shut nexthop interface N2")
intf = topo["routers"]["r2"]["links"]["r1-link1"]["interface"]
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes is" " still present in RIB".format(
+ ), "Testcase {} : Failed \nExpected: Routes should not present in RIB \nError: Routes are still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
step("No shut nexthop interface N2")
shutdown_bringup_interface(tgen, dut, intf, True)
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" "missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
rte2_nh2 = {
"r2": {
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes is" "not active in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nExpected: Routes should not active in RIB \nError: Routes are not active in RIB".format(
+ tc_name
+ )
dut = "r3"
protocol = "bgp"
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes is" "not active in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nExpected: Routes should not be active in RIB \nError: Routes are not active in RIB".format(
+ tc_name
+ )
dut = "r2"
step("Reload the FRR router")
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" "missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
dut = "r3"
protocol = "bgp"
result = verify_bgp_rib(tgen, addr_type, dut, rte1_nh1, next_hop=nh)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" "missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
rte2_nh2 = {
"r2": {
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes is" "not active in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nExpected: Routes should not be active in RIB \nError: Routes are not active in RIB".format(
+ tc_name
+ )
dut = "r3"
protocol = "bgp"
result = verify_bgp_rib(tgen, addr_type, dut, rte2_nh2, next_hop=nh)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" "not active in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are not active in RIB".format(tc_name)
result = verify_rib(
tgen,
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes is" "not active in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nExpected: Routes should not be active in RIB \nError: Routes are not active in RIB".format(
+ tc_name
+ )
write_test_footer(tc_name)
result = verify_bgp_rib(tgen, addr_type, dut, input_dict_4)
assert (
result is True
- ), "Testcase {} : Failed \nError: Route is" " still present in RIB".format(
+ ), "Testcase {} : Failed \nError: Route is still present in RIB".format(
tc_name
)
result = verify_rib(tgen, addr_type, dut, input_dict_4, protocol=protocol)
assert (
result is True
- ), "Testcase {} : Failed \nError: Route is" " still present in RIB".format(
+ ), "Testcase {} : Failed \nError: Route is still present in RIB".format(
tc_name
)
result = verify_bgp_rib(tgen, addr_type, dut, input_dict_4)
assert (
result is True
- ), "Testcase {} : Failed \nError: Route is" " missing in BGP RIB".format(
- tc_name
- )
+ ), "Testcase {} : Failed \nError: Route is missing in BGP RIB".format(tc_name)
protocol = "bgp"
result = verify_rib(
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Route is" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Route is missing in RIB".format(tc_name)
- step("Remove the static route on R3 configured with active" "interface")
+ step("Remove the static route on R3 configured with active interface")
for addr_type in ADDR_TYPES:
input_dict_4 = {
"r3": {
result = verify_bgp_rib(tgen, addr_type, dut, input_dict_4)
assert (
result is True
- ), "Testcase {} : Failed \nError: Route is" " missing in BGP RIB".format(
- tc_name
- )
+ ), "Testcase {} : Failed \nError: Route is missing in BGP RIB".format(tc_name)
protocol = "bgp"
result = verify_rib(
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Route is" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Route is missing in RIB".format(tc_name)
write_test_footer(tc_name)
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
step("Configure redistribute static in BGP on R2 router")
for addr_type in ADDR_TYPES:
result = verify_bgp_rib(tgen, addr_type, dut, input_dict_4)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
step(
"Remove the static route configured with nexthop N1 to N8, one"
)
assert (
result is not True
- ), "Testcase {} : Failed\nError: Routes is" " still present in RIB".format(
+ ), "Testcase {} : Failed\nError: routes are still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed\nError: Routes are" " missing in RIB".format(
- tc_name
- )
+ ), "Testcase {} : Failed\nError: Routes are missing in RIB".format(tc_name)
protocol = "static"
step("Random shut of the nexthop interfaces")
# Shutdown interface
dut = "r2"
step(
- " interface which is about to be shut no shut between r1 and r2 is " "%s",
+ " interface which is about to be shut no shut between r1 and r2 is %s",
topo["routers"]["r2"]["links"]["r1-link{}".format(randnum)]["interface"],
)
intf = topo["routers"]["r2"]["links"]["r1-link{}".format(randnum)]["interface"]
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
step("Remove random static route with all the nexthop")
dut = "r2"
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
for addr_type in ADDR_TYPES:
input_dict_4 = {
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
step("Remove the redistribute static knob")
for addr_type in ADDR_TYPES:
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes are" " still present in RIB".format(
+ ), "Testcase {} : Failed \nError: Routes are still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
nh = []
for nhp in range(2, 9):
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes " " are missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
step(
"Remove the static route configured with nexthop N1 to N8, one"
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes are" " still present in RIB".format(
- tc_name
- )
+ ), "Testcase {} : Failed \nError: Routes are still present in RIB".format(tc_name)
step("Configure the static route with nexthop N1 to N8, one by one")
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
nh = []
for nhp in range(2, 9):
nh.append(NEXT_HOP_IP["nh" + str(nhp)][addr_type])
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes " " are missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
step("Random shut of the nexthop interfaces")
randnum = random.randint(0, 7)
)
assert (
result is not True
- ), "Testcase {} : Failed \n" "Error: Routes are still present in RIB".format(
+ ), "Testcase {} : Failed \n Error: Routes are still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \n" "Error: Routes are missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \n Error: Routes are missing in RIB".format(tc_name)
dut = "r2"
protocol = "static"
result = verify_rib(tgen, addr_type, dut, input_dict_4, protocol=protocol)
assert (
result is True
- ), "Testcase {}: Failed \n " "Error: Routes are missing in RIB".format(tc_name)
+ ), "Testcase {}: Failed \n Error: Routes are missing in RIB".format(tc_name)
protocol = "bgp"
dut = "r3"
result = verify_rib(tgen, addr_type, dut, input_dict_4, protocol=protocol)
assert (
result is True
- ), "Testcase {}: Failed \n " "Error: Routes are missing in RIB".format(tc_name)
+ ), "Testcase {}: Failed \n Error: Routes are missing in RIB".format(tc_name)
step("Reload the FRR router")
# stop/start -> restart FRR router and verify
result = verify_rib(tgen, addr_type, dut, input_dict_4, protocol=protocol)
assert (
result is True
- ), "Testcase {} : Failed \n" "Error: Routes are still present in RIB".format(
+ ), "Testcase {} : Failed \n Error: Routes are still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
nh = []
for nhp in range(2, 9):
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes " " are missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
step(
"Remove the static route configured with nexthop N1 to N8, one"
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes are" " still present in RIB".format(
- tc_name
- )
+ ), "Testcase {} : Failed \nError: Routes are still present in RIB".format(tc_name)
step("Configure the static route with nexthop N1 to N8, one by one")
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
nh = []
for nhp in range(2, 9):
nh.append(NEXT_HOP_IP["nh" + str(nhp)][addr_type])
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes " " are missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
step("Random shut of the nexthop interfaces")
randnum = random.randint(0, 7)
)
assert (
result is not True
- ), "Testcase {} : Failed \n" "Error: Routes are still present in RIB".format(
+ ), "Testcase {} : Failed \n Error: Routes are still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \n" "Error: Routes are missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \n Error: Routes are missing in RIB".format(tc_name)
dut = "r2"
protocol = "static"
result = verify_rib(tgen, addr_type, dut, input_dict_4, protocol=protocol)
assert (
result is True
- ), "Testcase {} : Failed \n" "Error: Routes are still present in RIB".format(
+ ), "Testcase {} : Failed \n Error: Routes are still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
step("Verify that highest AD nexthop are inactive")
nh = []
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes " " are missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
step("Configure redistribute static in BGP on R2 router")
for addr_type in ADDR_TYPES:
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes are" " still present in RIB".format(
+ ), "Testcase {} : Failed \nError: Routes are still present in RIB".format(
tc_name
)
" value and all the nexthop populated in RIB and FIB again"
)
for addr_type in ADDR_TYPES:
- input_dict_4 = {
- "r2": {
- "static_routes": [
- {
- "network": PREFIX1[addr_type],
- }
- ]
- }
- }
+ input_dict_4 = {"r2": {"static_routes": [{"network": PREFIX1[addr_type]}]}}
nh = NEXT_HOP_IP["nh1"][addr_type]
result = verify_rib(
tgen, addr_type, dut, input_dict_4, next_hop=nh, protocol=protocol, fib=True
)
assert (
result is not True
- ), "Testcase {} : Failed \n" "Error: Routes are still present in RIB".format(
+ ), "Testcase {} : Failed \n Error: Routes are still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \n" "Error: Routes are missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \n Error: Routes are missing in RIB".format(tc_name)
step("Remove random static route with all the nexthop")
for addr_type in ADDR_TYPES:
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Route " " is missing in RIB".format(
- tc_name
- )
+ ), "Testcase {} : Failed \nError: Route is missing in RIB".format(tc_name)
write_test_footer(tc_name)
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
step("Verify that highest AD nexthop are inactive")
nh = []
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes " " are missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
step("Configure redistribute static in BGP on R2 router")
for addr_type in ADDR_TYPES:
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes are" " still present in RIB".format(
+ ), "Testcase {} : Failed \nError: Routes are still present in RIB".format(
tc_name
)
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes are" " still active in RIB".format(
+ ), "Testcase {} : Failed \nError: Routes are still active in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
step("Configure redistribute static in BGP on R2 router")
for addr_type in ADDR_TYPES:
input_dict_2 = {
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes are" " still present in RIB".format(
+ ), "Testcase {} : Failed \nError: Routes are still present in RIB".format(
tc_name
)
- step("Configure the static route with nexthop N1 to N8, one by" "one")
+ step("Configure the static route with nexthop N1 to N8, one by one")
for addr_type in ADDR_TYPES:
# add static routes
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
step("Random shut of the nexthop interfaces")
randnum = random.randint(0, 7)
)
assert (
result is not True
- ), "Testcase {} : Failed \n" "Error: Routes are still present in RIB".format(
+ ), "Testcase {} : Failed \n Error: Routes are still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \n" "Error: Routes are missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \n Error: Routes are missing in RIB".format(tc_name)
step("Reload the FRR router")
# stop/start -> restart FRR router and verify
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
write_test_footer(tc_name)
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes are" " still present in RIB".format(
- tc_name
- )
+ ), "Testcase {} : Failed \nError: Routes are still present in RIB".format(tc_name)
- step("Configure the static route with nexthop N1 to N8, one by" "one")
+ step("Configure the static route with nexthop N1 to N8, one by one")
for addr_type in ADDR_TYPES:
# add static routes
for nhp in range(1, 9):
)
assert (
result is not True
- ), "Testcase {} : Failed \n" "Error: Routes are still present in RIB".format(
+ ), "Testcase {} : Failed \n Error: Routes are still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \n" "Error: Routes are missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \n Error: Routes are missing in RIB".format(tc_name)
step("Reload the FRR router")
# stop/start -> restart FRR router and verify
result = verify_rib(tgen, addr_type, dut, input_dict_4)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" " missing in RIB of R2".format(
+ ), "Testcase {} : Failed \nError: routes are missing in RIB of R2".format(
tc_name
)
dut = "r3"
result = verify_bgp_rib(tgen, addr_type, dut, input_dict_4, expected=False)
assert result is not True, (
- "Testcase {} : Failed \nError: Routes is"
+ "Testcase {} : Failed \nError: routes are"
" still present in BGP RIB of R2".format(tc_name)
)
result = verify_rib(tgen, addr_type, dut, input_dict_4, expected=False)
assert result is not True, (
- "Testcase {} : Failed \nError: Routes is"
+ "Testcase {} : Failed \nError: routes are"
" still present in RIB of R2".format(tc_name)
)
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name)
input_dict_nh = {
"r1": {
result = verify_ip_nht(tgen, input_dict_nh)
assert (
result is True
- ), "Testcase {} : Failed \nError: Nexthop is" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Nexthop is missing in RIB".format(tc_name)
step(
"Shut / no shut IPv4 and IPv6 static next hop interface from"
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name)
shutdown_bringup_interface(tgen, dut, intf, True)
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes" " still present in RIB".format(
- tc_name
- )
+ ), "Testcase {} : Failed \nError: Routes still present in RIB".format(tc_name)
write_test_footer(tc_name)
"Configure 2 IPv4 static route (S1 and S2) in R2 with same"
"next hop N1 28.1.1.2"
)
- step("Configure static route S1 with tag 1 and static route S2 with" "tag2")
+ step("Configure static route S1 with tag 1 and static route S2 with tag2")
step("S1= ip route 10.1.1.1/24 28.1.1.2 tag 1")
step("S2= ip route 20.1.1.1/24 28.1.1.2 tag 2")
step("Enable redistribute static in BGP with route-map")
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
step("Configure route-map on R2 with allow tag1 and deny tag2")
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
step("shut/no shut of tag1 and tag2 nexthop")
)
clear_bgp(tgen, addr_type, "r2")
- step(" All BGP nbrs are down as authentication is mismatch on both" " the sides")
+ step(" All BGP nbrs are down as authentication is mismatch on both the sides")
bgp_convergence = verify_bgp_convergence(tgen, topo, expected=False)
assert (
bgp_convergence is not True
- ), "Testcase {} : " "Failed \n BGP nbrs must be down. Error: {}".format(
+ ), "Testcase {} : Failed \n BGP nbrs must be down. Error: {}".format(
tc_name, bgp_convergence
)
step("All BGP nbrs are up as authentication is matched now")
bgp_convergence = verify_bgp_convergence(tgen, topo)
- assert bgp_convergence is True, "Testcase {} : Failed \n " "Error: {}".format(
+ assert bgp_convergence is True, "Testcase {} : Failed \n Error: {}".format(
tc_name, bgp_convergence
)
"show ip prefix list"
)
result = verify_prefix_lists(tgen, input_dict_2)
- assert result is not True, "Testcase {} : Failed \n" " Error: {}".format(
+ assert result is not True, "Testcase {} : Failed \n Error: {}".format(
tc_name, result
)
tc_name, result
)
- step("Apply prefix list P1 on BGP neighbors 1 2 3 4 connected from " "frr r1")
+ step("Apply prefix list P1 on BGP neighbors 1 2 3 4 connected from frr r1")
# Configure prefix list to bgp neighbor
input_dict_4 = {
"r2": {
)
assert (
result4 is not True
- ), "Testcase {} : Failed \n" "routes are still present \n Error: {}".format(
+ ), "Testcase {} : Failed \n routes are still present \n Error: {}".format(
tc_name, result4
)
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name)
step("Configure IBGP IPv4 peering between R2 and R3 router.")
step("Configure redistribute static in BGP on R2 router")
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes is" " still present in RIB".format(
+ ), "Testcase {} : Failed \nError: routes are still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name)
step("Configure the static route with nexthop N1")
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes is" " still present in RIB".format(
+ ), "Testcase {} : Failed \nError: routes are still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name)
step("Configure the static route with nexthop N2")
input_dict_4 = {
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name)
nh = NEXT_HOP_IP["nh1"][addr_type]
result = verify_rib(
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes is" " still present in RIB".format(
+ ), "Testcase {} : Failed \nError: routes are still present in RIB".format(
tc_name
)
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Route is" " still present in RIB".format(
+ ), "Testcase {} : Failed \nError: Route is still present in RIB".format(
tc_name
)
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Route is" " still present in RIB".format(
+ ), "Testcase {} : Failed \nError: Route is still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name)
dut = "r3"
result = verify_bgp_rib(tgen, addr_type, dut, input_dict_4)
assert (
result is True
- ), "Testcase {} : Failed \nError: Route is" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Route is missing in RIB".format(tc_name)
result = verify_rib(
tgen, addr_type, dut, input_dict_4, protocol=protocol, expected=False
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Route is" " still present in RIB".format(
+ ), "Testcase {} : Failed \nError: Route is still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name)
step("Shut nexthop interface N2")
intf = topo["routers"]["r2"]["links"]["r1-link1"]["interface"]
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes is" " still present in RIB".format(
+ ), "Testcase {} : Failed \nError: routes are still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name)
dut = "r3"
result = verify_bgp_rib(tgen, addr_type, dut, input_dict_4)
assert (
result is True
- ), "Testcase {} : Failed \nError: Route is" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Route is missing in RIB".format(tc_name)
result = verify_rib(
tgen, addr_type, dut, input_dict_4, protocol=protocol, expected=False
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Route is" " still present in RIB".format(
+ ), "Testcase {} : Failed \nError: Route is still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name)
dut = "r3"
result = verify_bgp_rib(tgen, addr_type, dut, input_dict_4)
assert (
result is True
- ), "Testcase {} : Failed \nError: Route is" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Route is missing in RIB".format(tc_name)
result = verify_rib(
tgen, addr_type, dut, input_dict_4, protocol=protocol, expected=False
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Route is" " still present in RIB".format(
+ ), "Testcase {} : Failed \nError: Route is still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name)
dut = "r3"
result = verify_bgp_rib(tgen, addr_type, dut, input_dict_4)
assert (
result is True
- ), "Testcase {} : Failed \nError: Route is" " still present in RIB".format(
+ ), "Testcase {} : Failed \nError: Route is still present in RIB".format(
tc_name
)
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Route is" " still present in RIB".format(
+ ), "Testcase {} : Failed \nError: Route is still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" "missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name)
rte2_nh2 = {
"r2": {
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes is" "not active in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: routes are not active in RIB".format(tc_name)
step("Configure IBGP IPv4 peering between R2 and R3 router.")
step("Explicit route is added in R3 for R2 nexthop rechability")
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes is" "missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name)
rte2_nh2 = {
"r2": {
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" "not active in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: routes are not active in RIB".format(tc_name)
step("Configure the static route with nexthop N1")
rte1_nh1 = {
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes is" " still present in RIB".format(
+ ), "Testcase {} : Failed \nError: routes are still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name)
step("Configure the static route with nexthop N2")
rte2_nh2 = {
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes is" " still present in RIB".format(
+ ), "Testcase {} : Failed \nError: routes are still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name)
step("No shut the nexthop interface N1")
shutdown_bringup_interface(tgen, dut, intf, True)
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name)
step("Shut nexthop interface N2")
intf = topo["routers"]["r2"]["links"]["r1-link1"]["interface"]
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes is" " still present in RIB".format(
+ ), "Testcase {} : Failed \nError: routes are still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name)
step("No shut nexthop interface N2")
shutdown_bringup_interface(tgen, dut, intf, True)
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" "missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name)
rte2_nh2 = {
"r2": {
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes is" "not active in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: routes are not active in RIB".format(tc_name)
dut = "r3"
protocol = "bgp"
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes is" "not active in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: routes are not active in RIB".format(tc_name)
dut = "r2"
step("Reload the FRR router")
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" "missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name)
dut = "r3"
protocol = "bgp"
result = verify_bgp_rib(tgen, addr_type, dut, rte1_nh1, next_hop=nh)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" "missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: routes are missing in RIB".format(tc_name)
rte2_nh2 = {
"r2": {
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes is" "not active in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: routes are not active in RIB".format(tc_name)
dut = "r3"
protocol = "bgp"
result = verify_bgp_rib(tgen, addr_type, dut, rte2_nh2, next_hop=nh)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" "not active in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: routes are not active in RIB".format(tc_name)
result = verify_rib(
tgen,
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes is" "not active in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: routes are not active in RIB".format(tc_name)
write_test_footer(tc_name)
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
step("Configure redistribute static in BGP on R2 router")
for addr_type in ADDR_TYPES:
result = verify_bgp_rib(tgen, addr_type, dut, input_dict_4)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
step(
"Remove the static route configured with nexthop N1 to N8, one"
)
assert (
result is not True
- ), "Testcase {} : Failed\nError: Routes is" " still present in RIB".format(
+ ), "Testcase {} : Failed\nError: routes are still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed\nError: Routes are" " missing in RIB".format(
- tc_name
- )
+ ), "Testcase {} : Failed\nError: Routes are missing in RIB".format(tc_name)
protocol = "static"
step("Random shut of the nexthop interfaces")
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
step("Remove random static route with all the nexthop")
dut = "r2"
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
for addr_type in ADDR_TYPES:
input_dict_4 = {
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
step("Remove the redistribute static knob")
for addr_type in ADDR_TYPES:
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes are" " still present in RIB".format(
+ ), "Testcase {} : Failed \nError: Routes are still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
nh = []
for nhp in range(2, 9):
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes " " are present in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are present in RIB".format(tc_name)
step(
"Remove the static route configured with nexthop N1 to N8, one"
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes are" " still present in RIB".format(
- tc_name
- )
+ ), "Testcase {} : Failed \nError: Routes are still present in RIB".format(tc_name)
step("Configure the static route with nexthop N1 to N8, one by one")
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
nh = []
for nhp in range(2, 9):
nh.append(NEXT_HOP_IP["nh" + str(nhp)][addr_type])
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes " " are missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
step("Random shut of the nexthop interfaces")
randnum = random.randint(0, 7)
)
assert (
result is not True
- ), "Testcase {} : Failed \n" "Error: Routes are still present in RIB".format(
+ ), "Testcase {} : Failed \n Error: Routes are still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \n" "Error: Routes are missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \n Error: Routes are missing in RIB".format(tc_name)
protocol = "bgp"
# this is next hop reachability route in r3 as we are using ibgp
result = verify_rib(tgen, addr_type, dut, input_dict_4, protocol=protocol)
assert (
result is True
- ), "Testcase {} : Failed \n" "Error: Routes are missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \n Error: Routes are missing in RIB".format(tc_name)
protocol = "static"
dut = "r2"
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
nh = []
for nhp in range(2, 9):
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes " " are missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
step(
"Remove the static route configured with nexthop N1 to N8, one"
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes are" " still present in RIB".format(
- tc_name
- )
+ ), "Testcase {} : Failed \nError: Routes are still present in RIB".format(tc_name)
step("Configure the static route with nexthop N1 to N8, one by one")
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
nh = []
for nhp in range(2, 9):
nh.append(NEXT_HOP_IP["nh" + str(nhp)][addr_type])
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes " " are missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
step("Random shut of the nexthop interfaces")
randnum = random.randint(0, 7)
)
assert (
result is not True
- ), "Testcase {} : Failed \n" "Error: Routes are still present in RIB".format(
+ ), "Testcase {} : Failed \n Error: Routes are still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \n" "Error: Routes are missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \n Error: Routes are missing in RIB".format(tc_name)
dut = "r2"
protocol = "bgp"
result = verify_rib(tgen, addr_type, dut, input_dict_4, protocol=protocol)
assert (
result is True
- ), "Testcase {} : Failed \n" "Error: Routes are missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \n Error: Routes are missing in RIB".format(tc_name)
protocol = "static"
dut = "r2"
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
step("Verify that highest AD nexthop are inactive")
nh = []
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes " " are missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
step("Configure redistribute static in BGP on R2 router")
for addr_type in ADDR_TYPES:
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes are" " still present in RIB".format(
+ ), "Testcase {} : Failed \nError: Routes are still present in RIB".format(
tc_name
)
" value and all the nexthop populated in RIB and FIB again"
)
for addr_type in ADDR_TYPES:
- input_dict_4 = {
- "r2": {
- "static_routes": [
- {
- "network": PREFIX1[addr_type],
- }
- ]
- }
- }
+ input_dict_4 = {"r2": {"static_routes": [{"network": PREFIX1[addr_type]}]}}
nh = NEXT_HOP_IP["nh1"][addr_type]
result = verify_rib(
tgen, addr_type, dut, input_dict_4, next_hop=nh, protocol=protocol, fib=True
)
assert (
result is not True
- ), "Testcase {} : Failed \n" "Error: Routes are still present in RIB".format(
+ ), "Testcase {} : Failed \n Error: Routes are still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \n" "Error: Routes are missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \n Error: Routes are missing in RIB".format(tc_name)
step("Remove random static route with all the nexthop")
for addr_type in ADDR_TYPES:
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes are" " still present in RIB".format(
+ ), "Testcase {} : Failed \nError: Routes are still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
step("Verify that highest AD nexthop are inactive")
nh = []
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes " " are missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
step("Configure redistribute static in BGP on R2 router")
for addr_type in ADDR_TYPES:
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes are" " still present in RIB".format(
+ ), "Testcase {} : Failed \nError: Routes are still present in RIB".format(
tc_name
)
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes are" " still active in RIB".format(
+ ), "Testcase {} : Failed \nError: Routes are still active in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
step("Configure redistribute static in BGP on R2 router")
for addr_type in ADDR_TYPES:
input_dict_2 = {
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes are" " still present in RIB".format(
+ ), "Testcase {} : Failed \nError: Routes are still present in RIB".format(
tc_name
)
- step("Configure the static route with nexthop N1 to N8, one by" "one")
+ step("Configure the static route with nexthop N1 to N8, one by one")
for addr_type in ADDR_TYPES:
# add static routes
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
step("Random shut of the nexthop interfaces")
randnum = random.randint(0, 7)
)
assert (
result is not True
- ), "Testcase {} : Failed \n" "Error: Routes are still present in RIB".format(
+ ), "Testcase {} : Failed \n Error: Routes are still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \n" "Error: Routes are missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \n Error: Routes are missing in RIB".format(tc_name)
step("Reload the FRR router")
# stop/start -> restart FRR router and verify
)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes are" " missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \nError: Routes are missing in RIB".format(tc_name)
write_test_footer(tc_name)
)
assert (
result is not True
- ), "Testcase {} : Failed \nError: Routes are" " still present in RIB".format(
- tc_name
- )
+ ), "Testcase {} : Failed \nError: Routes are still present in RIB".format(tc_name)
- step("Configure the static route with nexthop N1 to N8, one by" "one")
+ step("Configure the static route with nexthop N1 to N8, one by one")
for addr_type in ADDR_TYPES:
# add static routes
for nhp in range(1, 9):
)
assert (
result is not True
- ), "Testcase {} : Failed \n" "Error: Routes are still present in RIB".format(
+ ), "Testcase {} : Failed \n Error: Routes are still present in RIB".format(
tc_name
)
)
assert (
result is True
- ), "Testcase {} : Failed \n" "Error: Routes are missing in RIB".format(tc_name)
+ ), "Testcase {} : Failed \n Error: Routes are missing in RIB".format(tc_name)
step("Reload the FRR router")
# stop/start -> restart FRR router and verify
result = verify_rib(tgen, addr_type, dut, input_dict_4)
assert (
result is True
- ), "Testcase {} : Failed \nError: Routes is" " missing in RIB of R2".format(
+ ), "Testcase {} : Failed \nError: routes are missing in RIB of R2".format(
tc_name
)
dut = "r3"
result = verify_bgp_rib(tgen, addr_type, dut, input_dict_4, expected=False)
assert result is not True, (
- "Testcase {} : Failed \nError: Routes is"
+ "Testcase {} : Failed \nError: routes are"
" still present in BGP RIB of R2".format(tc_name)
)
result = verify_rib(tgen, addr_type, dut, input_dict_4, expected=False)
assert result is not True, (
- "Testcase {} : Failed \nError: Routes is"
+ "Testcase {} : Failed \nError: routes are"
" still present in RIB of R2".format(tc_name)
)
)
clear_bgp(tgen, addr_type, "r2")
- step(" All BGP nbrs are down as authentication is mismatch on both" " the sides")
+ step(" All BGP nbrs are down as authentication is mismatch on both the sides")
bgp_convergence = verify_bgp_convergence(tgen, topo, expected=False)
assert (
bgp_convergence is not True
- ), "Testcase {} : " "Failed \n BGP nbrs must be down. Error: {}".format(
+ ), "Testcase {} : Failed \n BGP nbrs must be down. Error: {}".format(
tc_name, bgp_convergence
)
step("All BGP nbrs are up as authentication is matched now")
bgp_convergence = verify_bgp_convergence(tgen, topo)
- assert bgp_convergence is True, "Testcase {} : Failed \n " "Error: {}".format(
+ assert bgp_convergence is True, "Testcase {} : Failed \n Error: {}".format(
tc_name, bgp_convergence
)
"show ip prefix list"
)
result = verify_prefix_lists(tgen, input_dict_2)
- assert result is not True, "Testcase {} : Failed \n" " Error: {}".format(
+ assert result is not True, "Testcase {} : Failed \n Error: {}".format(
tc_name, result
)
tc_name, result
)
- step("Apply prefix list P1 on BGP neighbors 1 2 3 4 connected from " "frr r1")
+ step("Apply prefix list P1 on BGP neighbors 1 2 3 4 connected from frr r1")
# Configure prefix list to bgp neighbor
input_dict_4 = {
"r2": {
)
assert (
result4 is not True
- ), "Testcase {} : Failed \n" "routes are still present \n Error: {}".format(
+ ), "Testcase {} : Failed \n routes are still present \n Error: {}".format(
tc_name, result4
)