diff options
| author | naveen <nguggarigoud@vmware.com> | 2020-08-18 15:58:34 +0530 |
|---|---|---|
| committer | nguggarigoud <nguggarigoud@vmware.com> | 2020-09-18 15:13:46 +0530 |
| commit | a81774ec7d67f36f1380b9130cbc45a7e8001d1b (patch) | |
| tree | 424af6c82eb593923d574ece6efa723151ac4e4e /tests/topotests/ospf_basic_functionality/test_ospf_rte_calc.py | |
| parent | 4256a20961308bda6528ee1313063ac4396e6e94 (diff) | |
tests: ospf basic functionality topojson testcases.
1. Removed static sleeps.
Signed-off-by: naveen <nguggarigoud@vmware.com>
Diffstat (limited to 'tests/topotests/ospf_basic_functionality/test_ospf_rte_calc.py')
| -rw-r--r-- | tests/topotests/ospf_basic_functionality/test_ospf_rte_calc.py | 63 |
1 files changed, 26 insertions, 37 deletions
diff --git a/tests/topotests/ospf_basic_functionality/test_ospf_rte_calc.py b/tests/topotests/ospf_basic_functionality/test_ospf_rte_calc.py index aceae4ae20..a46fa6fcce 100644 --- a/tests/topotests/ospf_basic_functionality/test_ospf_rte_calc.py +++ b/tests/topotests/ospf_basic_functionality/test_ospf_rte_calc.py @@ -26,7 +26,6 @@ import os import sys import time import pytest -from time import sleep import ipaddress import json @@ -271,13 +270,24 @@ def test_ospf_redistribution_tc5_p0(request): assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result) dut = "r1" - result = verify_ospf_rib(tgen, dut, input_dict, next_hop=nh) + result = verify_ospf_rib( + tgen, dut, input_dict, next_hop=nh, attempts=5, expected=False + ) assert result is not True, "Testcase {} : Failed \n Error: {}".format( tc_name, result ) protocol = "ospf" - result = verify_rib(tgen, "ipv4", dut, input_dict, protocol=protocol, next_hop=nh) + result = verify_rib( + tgen, + "ipv4", + dut, + input_dict, + protocol=protocol, + next_hop=nh, + attempts=5, + expected=False, + ) assert result is not True, "Testcase {} : Failed \n Error: {}".format( tc_name, result ) @@ -310,23 +320,6 @@ def test_ospf_redistribution_tc5_p0(request): intf = topo["routers"]["r0"]["links"]["r3"]["interface"] shutdown_bringup_interface(tgen, dut, intf, False) - step("Verify that intraroute calculated for R1 intf on R0 is deleted.") - dut = "r1" - - # sleep is added so that neighbor gets deleted after interface shut. - sleep(12) - - result = verify_ospf_rib(tgen, dut, input_dict, expected=False) - assert result is not True, "Testcase {} : Failed \n Error: {}".format( - tc_name, result - ) - - protocol = "ospf" - result = verify_rib(tgen, "ipv4", dut, input_dict, protocol=protocol, next_hop=nh) - assert result is not True, "Testcase {} : Failed \n Error: {}".format( - tc_name, result - ) - step("un shut the OSPF interface on R0") dut = "r0" shutdown_bringup_interface(tgen, dut, intf, True) @@ -395,13 +388,24 @@ def test_ospf_redistribution_tc6_p0(request): assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result) dut = "r1" - result = verify_ospf_rib(tgen, dut, input_dict, next_hop=nh) + result = verify_ospf_rib( + tgen, dut, input_dict, next_hop=nh, attempts=5, expected=False + ) assert result is not True, "Testcase {} : Failed \n Error: {}".format( tc_name, result ) protocol = "ospf" - result = verify_rib(tgen, "ipv4", dut, input_dict, protocol=protocol, next_hop=nh) + result = verify_rib( + tgen, + "ipv4", + dut, + input_dict, + protocol=protocol, + next_hop=nh, + attempts=5, + expected=False, + ) assert result is not True, "Testcase {} : Failed \n Error: {}".format( tc_name, result ) @@ -434,21 +438,6 @@ def test_ospf_redistribution_tc6_p0(request): intf = topo["routers"]["r0"]["links"]["r3"]["interface"] shutdown_bringup_interface(tgen, dut, intf, False) - step("Verify that intraroute calculated for R1 intf on R0 is deleted.") - dut = "r1" - - sleep(10) - result = verify_ospf_rib(tgen, dut, input_dict) - assert result is not True, "Testcase {} : Failed \n Error: {}".format( - tc_name, result - ) - - protocol = "ospf" - result = verify_rib(tgen, "ipv4", dut, input_dict, protocol=protocol, next_hop=nh) - assert result is not True, "Testcase {} : Failed \n Error: {}".format( - tc_name, result - ) - step("un shut the OSPF interface on R0") dut = "r0" shutdown_bringup_interface(tgen, dut, intf, True) |
