diff options
| author | Kuldeep Kashyap <kashyapk@vmware.com> | 2020-04-01 05:30:38 +0000 |
|---|---|---|
| committer | Kuldeep Kashyap <kashyapk@vmware.com> | 2020-04-08 12:21:26 +0000 |
| commit | b7250ecfdc89101e2712ade9e140ab9f8ebb26a8 (patch) | |
| tree | f50f13308bd3d666767061a13db5481d0bcf47f6 /tests/topotests/bgp-basic-functionality-topo1/test_bgp_basic_functionality.py | |
| parent | 9d450273dfd8d6141a0c43bc93a49b6c51cd9b1c (diff) | |
tests: Added new tests to bgp-basic-functionality-topo1
1. Added 2 new test cases to bgp-basic-functionality-topo1
2. Enhanced 2 tests to run for both static routes and network advvertise command
Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
Diffstat (limited to 'tests/topotests/bgp-basic-functionality-topo1/test_bgp_basic_functionality.py')
| -rwxr-xr-x | tests/topotests/bgp-basic-functionality-topo1/test_bgp_basic_functionality.py | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/tests/topotests/bgp-basic-functionality-topo1/test_bgp_basic_functionality.py b/tests/topotests/bgp-basic-functionality-topo1/test_bgp_basic_functionality.py index 7a74b62980..1b2faa601a 100755 --- a/tests/topotests/bgp-basic-functionality-topo1/test_bgp_basic_functionality.py +++ b/tests/topotests/bgp-basic-functionality-topo1/test_bgp_basic_functionality.py @@ -233,6 +233,112 @@ def test_bgp_config_with_4byte_as_number(request): write_test_footer(tc_name) +def test_BGP_config_with_invalid_ASN_p2(request): + """ + Configure BGP with invalid ASN(ex - 0, reserved ASN) and verify test case + ended up with error + """ + + tgen = get_topogen() + global BGP_CONVERGENCE + + if BGP_CONVERGENCE != True: + pytest.skip('skipped because of BGP Convergence failure') + + # test case name + tc_name = request.node.name + write_test_header(tc_name) + + # Api call to modify AS number + input_dict = { + "r1": { + "bgp":{ + "local_as": 0, + } + }, + "r2": { + "bgp":{ + "local_as": 0, + } + }, + "r3": { + "bgp":{ + "local_as": 0, + } + }, + "r4": { + "bgp":{ + "local_as": 64000, + } + } + } + result = modify_as_number(tgen, topo, input_dict) + try: + assert result is True + except AssertionError: + logger.info("Expected behaviour: {}".format(result)) + logger.info("BGP config is not created because of invalid ASNs") + + write_test_footer(tc_name) + + +def test_BGP_config_with_2byteAS_and_4byteAS_number_p1(request): + """ + Configure BGP with 4 byte and 2 byte ASN and verify BGP is converged + """ + + tgen = get_topogen() + global BGP_CONVERGENCE + + if BGP_CONVERGENCE != True: + pytest.skip('skipped because of BGP Convergence failure') + + # test case name + tc_name = request.node.name + write_test_header(tc_name) + + # Api call to modify AS number + input_dict = { + "r1": { + "bgp":{ + "local_as": 131079 + } + }, + "r2": { + "bgp":{ + "local_as": 131079 + } + }, + "r3": { + "bgp":{ + "local_as": 131079 + } + }, + "r4": { + "bgp":{ + "local_as": 111 + } + } + } + result = modify_as_number(tgen, topo, input_dict) + if result != True: + assert False, "Testcase " + tc_name + " :Failed \n Error: {}".\ + format(result) + + result = verify_as_numbers(tgen, topo, input_dict) + if result != True: + assert False, "Testcase " + tc_name + " :Failed \n Error: {}".\ + format(result) + + # Api call verify whether BGP is converged + result = verify_bgp_convergence(tgen, topo) + if result != True: + assert False, "Testcase " + tc_name + " :Failed \n Error: {}".\ + format(result) + + write_test_footer(tc_name) + + def test_bgp_timers_functionality(request): """ Test to modify bgp timers and verify timers functionality. |
