summaryrefslogtreecommitdiff
path: root/tests/topotests/bgp-basic-functionality-topo1/test_bgp_basic_functionality.py
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas.abraitis@gmail.com>2020-04-09 11:49:43 +0300
committerGitHub <noreply@github.com>2020-04-09 11:49:43 +0300
commitfdf44b9038f8b0000aed27b602a4409847c692d7 (patch)
tree25c6e0950b625fe79a2c9a018b9cb9ded924253b /tests/topotests/bgp-basic-functionality-topo1/test_bgp_basic_functionality.py
parent2ee1e4b1ba956eb6f56631b61ddc2847668196ad (diff)
parent38c3547ac8400a2995a0ce98a93545a3da38bc2d (diff)
Merge pull request #6125 from kuldeepkash/bgp-communities
tests: Adding new test suite bgp_communities_topo1
Diffstat (limited to 'tests/topotests/bgp-basic-functionality-topo1/test_bgp_basic_functionality.py')
-rwxr-xr-xtests/topotests/bgp-basic-functionality-topo1/test_bgp_basic_functionality.py106
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.