summaryrefslogtreecommitdiff
path: root/tests/topotests/bgp-route-map/test_route_map_topo1.py
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas.abraitis@gmail.com>2020-02-27 10:03:16 +0200
committerGitHub <noreply@github.com>2020-02-27 10:03:16 +0200
commit1f713948c68dc7b51a22d2414f40dbc33a06b926 (patch)
tree1fc889a7dede6f4efbef471a4ab9fcc33c34183a /tests/topotests/bgp-route-map/test_route_map_topo1.py
parent7a7cd6e9b28405142e9ae0efb6f4bcf4131d6350 (diff)
parentb9f80297c82572824894803b41c56c529f1fd74b (diff)
Merge pull request #5864 from kuldeepkash/route_map
tests: Optimizing route-map test cases
Diffstat (limited to 'tests/topotests/bgp-route-map/test_route_map_topo1.py')
-rwxr-xr-xtests/topotests/bgp-route-map/test_route_map_topo1.py26
1 files changed, 16 insertions, 10 deletions
diff --git a/tests/topotests/bgp-route-map/test_route_map_topo1.py b/tests/topotests/bgp-route-map/test_route_map_topo1.py
index 86ec6c82d2..22dd3a6380 100755
--- a/tests/topotests/bgp-route-map/test_route_map_topo1.py
+++ b/tests/topotests/bgp-route-map/test_route_map_topo1.py
@@ -71,7 +71,7 @@ from time import sleep
# Save the Current Working Directory to find configuration files.
CWD = os.path.dirname(os.path.realpath(__file__))
-sys.path.append(os.path.join(CWD, '../'))
+sys.path.append(os.path.join(CWD, "../"))
# pylint: disable=C0413
# Import topogen and topotest helpers
@@ -102,7 +102,7 @@ ADDR_TYPES = check_address_types()
# Reading the data from JSON File for topology and configuration creation
jsonFile = "{}/bgp_route_map_topo1.json".format(CWD)
try:
- with open(jsonFile, 'r') as topoJson:
+ with open(jsonFile, "r") as topoJson:
topo = json.load(topoJson)
except IOError:
assert False, "Could not read file {}".format(jsonFile)
@@ -442,11 +442,12 @@ def test_route_map_inbound_outbound_same_neighbor_p0(request):
}
}
- result = verify_rib(tgen, adt, dut, input_dict_2, protocol=protocol)
+ result = verify_rib(tgen, adt, dut, input_dict_2, protocol=protocol,
+ expected=False)
assert result is not True, "Testcase {} : Failed \n"
- "Expected behavior: routes are not present in rib \n"
- "Error: {}".format(
+ "routes are not present in rib \n Error: {}".format(
tc_name, result)
+ logger.info("Expected behaviour: {}".format(result))
# Verifying RIB routes
dut = "r4"
@@ -461,11 +462,12 @@ def test_route_map_inbound_outbound_same_neighbor_p0(request):
]
}
}
- result = verify_rib(tgen, adt, dut, input_dict, protocol=protocol)
+ result = verify_rib(tgen, adt, dut, input_dict, protocol=protocol,
+ expected=False)
assert result is not True, "Testcase {} : Failed \n "
- "Expected behavior: routes are not present in rib \n "
- "Error: {}".format(
+ "routes are not present in rib \n Error: {}".format(
tc_name, result)
+ logger.info("Expected behaviour: {}".format(result))
write_test_footer(tc_name)
@@ -649,10 +651,14 @@ def test_route_map_with_action_values_combination_of_prefix_action_p0(
}
}
- result = verify_rib(tgen, adt, dut, input_dict_2, protocol=protocol)
+ #tgen.mininet_cli()
+ result = verify_rib(tgen, adt, dut, input_dict_2, protocol=protocol,
+ expected=False)
if "deny" in [prefix_action, rmap_action]:
- assert result is not True, "Testcase {} : Failed \n Error: {}".\
+ assert result is not True, "Testcase {} : Failed \n "
+ "Routes are still present \n Error: {}".\
format(tc_name, result)
+ logger.info("Expected behaviour: {}".format(result))
else:
assert result is True, "Testcase {} : Failed \n Error: {}".format(
tc_name, result)