summaryrefslogtreecommitdiffstats
path: root/tests/topotests/ospfv3_basic_functionality/test_ospfv3_single_area.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/topotests/ospfv3_basic_functionality/test_ospfv3_single_area.py')
-rw-r--r--tests/topotests/ospfv3_basic_functionality/test_ospfv3_single_area.py158
1 files changed, 111 insertions, 47 deletions
diff --git a/tests/topotests/ospfv3_basic_functionality/test_ospfv3_single_area.py b/tests/topotests/ospfv3_basic_functionality/test_ospfv3_single_area.py
index f0b139a5..00d4e8ff 100644
--- a/tests/topotests/ospfv3_basic_functionality/test_ospfv3_single_area.py
+++ b/tests/topotests/ospfv3_basic_functionality/test_ospfv3_single_area.py
@@ -36,7 +36,6 @@ from lib.common_config import (
step,
create_interfaces_cfg,
create_debug_log_config,
- apply_raw_config,
)
from lib.topolog import logger
from lib.topojson import build_config_from_json
@@ -121,7 +120,7 @@ def setup_module(mod):
logger.info("Running setup_module() done")
-def teardown_module(mod):
+def teardown_module():
"""
Teardown the pytest environment.
@@ -389,6 +388,11 @@ def test_ospfv3_hello_tc10_p0(request):
step("Bring up the base config as per the topology")
reset_config_on_routers(tgen)
+ ospf_covergence = verify_ospf6_neighbor(tgen)
+ assert (
+ ospf_covergence is True
+ ), "Testcase {} [01]: Reset Failed \n Error: {}".format(tc_name, ospf_covergence)
+
step("modify hello timer from default value to some other value on r1")
topo1 = {
@@ -403,7 +407,9 @@ def test_ospfv3_hello_tc10_p0(request):
}
result = create_interfaces_cfg(tgen, topo1)
- assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+ assert result is True, "Testcase {} [02]: Failed \n Error: {}".format(
+ tc_name, result
+ )
step(
"verify that new timer value is configured and applied using "
@@ -423,7 +429,9 @@ def test_ospfv3_hello_tc10_p0(request):
}
}
result = verify_ospf6_interface(tgen, topo, dut=dut, input_dict=input_dict)
- assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+ assert result is True, "Testcase {} [03]: Failed \n Error: {}".format(
+ tc_name, result
+ )
step("modify hello timer from default value to r1 hello timer on r2")
@@ -439,7 +447,9 @@ def test_ospfv3_hello_tc10_p0(request):
}
result = create_interfaces_cfg(tgen, topo1)
- assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+ assert result is True, "Testcase {} [04]: Failed \n Error: {}".format(
+ tc_name, result
+ )
step("verify that new timer value is configured.")
input_dict = {
@@ -456,12 +466,14 @@ def test_ospfv3_hello_tc10_p0(request):
}
dut = "r0"
result = verify_ospf6_interface(tgen, topo, dut=dut, input_dict=input_dict)
- assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+ assert result is True, "Testcase {} [05]: Failed \n Error: {}".format(
+ tc_name, result
+ )
step("verify that ospf neighbours are full")
ospf_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut)
- assert ospf_covergence is True, "Testcase Failed \n Error: {}".format(
- ospf_covergence
+ assert ospf_covergence is True, "Testcase {} [06]: Failed \n Error: {}".format(
+ tc_name, ospf_covergence
)
step("reconfigure the default hello timer value to default on r1 and r2")
@@ -478,7 +490,9 @@ def test_ospfv3_hello_tc10_p0(request):
}
result = create_interfaces_cfg(tgen, topo1)
- assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+ assert result is True, "Testcase {} [07]: Failed \n Error: {}".format(
+ tc_name, result
+ )
topo1 = {
"r1": {
@@ -492,7 +506,9 @@ def test_ospfv3_hello_tc10_p0(request):
}
result = create_interfaces_cfg(tgen, topo1)
- assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+ assert result is True, "Testcase {} [08]: Failed \n Error: {}".format(
+ tc_name, result
+ )
step("verify that new timer value is configured.")
input_dict = {
@@ -509,12 +525,14 @@ def test_ospfv3_hello_tc10_p0(request):
}
dut = "r0"
result = verify_ospf6_interface(tgen, topo, dut=dut, input_dict=input_dict)
- assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+ assert result is True, "Testcase {} [09]: Failed \n Error: {}".format(
+ tc_name, result
+ )
step("verify that ospf neighbours are full")
ospf_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut)
- assert ospf_covergence is True, "Testcase Failed \n Error: {}".format(
- ospf_covergence
+ assert ospf_covergence is True, "Testcase {} [10]: Failed \n Error: {}".format(
+ tc_name, ospf_covergence
)
step("reconfigure the default hello timer value to default on r1 and r2")
@@ -531,7 +549,9 @@ def test_ospfv3_hello_tc10_p0(request):
}
result = create_interfaces_cfg(tgen, topo1)
- assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+ assert result is True, "Testcase {} [11]: Failed \n Error: {}".format(
+ tc_name, result
+ )
topo1 = {
"r1": {
@@ -545,7 +565,9 @@ def test_ospfv3_hello_tc10_p0(request):
}
result = create_interfaces_cfg(tgen, topo1)
- assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+ assert result is True, "Testcase {} [12]: Failed \n Error: {}".format(
+ tc_name, result
+ )
step("verify that new timer value is configured.")
input_dict = {
@@ -562,12 +584,14 @@ def test_ospfv3_hello_tc10_p0(request):
}
dut = "r0"
result = verify_ospf6_interface(tgen, topo, dut=dut, input_dict=input_dict)
- assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+ assert result is True, "Testcase {} [13]: Failed \n Error: {}".format(
+ tc_name, result
+ )
step("verify that ospf neighbours are full")
ospf_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut)
- assert ospf_covergence is True, "Testcase Failed \n Error: {}".format(
- ospf_covergence
+ assert ospf_covergence is True, "Testcase {} [14]: Failed \n Error: {}".format(
+ tc_name, ospf_covergence
)
step("configure hello timer = 1 on r1 and r2")
@@ -583,7 +607,9 @@ def test_ospfv3_hello_tc10_p0(request):
}
result = create_interfaces_cfg(tgen, topo1)
- assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+ assert result is True, "Testcase {} [15]: Failed \n Error: {}".format(
+ tc_name, result
+ )
topo1 = {
"r1": {
@@ -597,7 +623,9 @@ def test_ospfv3_hello_tc10_p0(request):
}
result = create_interfaces_cfg(tgen, topo1)
- assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+ assert result is True, "Testcase {} [16]: Failed \n Error: {}".format(
+ tc_name, result
+ )
step("verify that new timer value is configured.")
input_dict = {
@@ -614,12 +642,14 @@ def test_ospfv3_hello_tc10_p0(request):
}
dut = "r0"
result = verify_ospf6_interface(tgen, topo, dut=dut, input_dict=input_dict)
- assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+ assert result is True, "Testcase {} [17]: Failed \n Error: {}".format(
+ tc_name, result
+ )
step("verify that ospf neighbours are full")
ospf_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut)
- assert ospf_covergence is True, "Testcase Failed \n Error: {}".format(
- ospf_covergence
+ assert ospf_covergence is True, "Testcase {} [18]: Failed \n Error: {}".format(
+ tc_name, ospf_covergence
)
step(" Configure hello timer = 65535")
@@ -635,7 +665,9 @@ def test_ospfv3_hello_tc10_p0(request):
}
result = create_interfaces_cfg(tgen, topo1)
- assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+ assert result is True, "Testcase {} [19]: Failed \n Error: {}".format(
+ tc_name, result
+ )
topo1 = {
"r1": {
@@ -649,7 +681,9 @@ def test_ospfv3_hello_tc10_p0(request):
}
result = create_interfaces_cfg(tgen, topo1)
- assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+ assert result is True, "Testcase {} [20]: Failed \n Error: {}".format(
+ tc_name, result
+ )
step("verify that new timer value is configured.")
input_dict = {
@@ -666,7 +700,9 @@ def test_ospfv3_hello_tc10_p0(request):
}
dut = "r0"
result = verify_ospf6_interface(tgen, topo, dut=dut, input_dict=input_dict)
- assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+ assert result is True, "Testcase {} [21]: Failed \n Error: {}".format(
+ tc_name, result
+ )
step(" Try configuring timer values outside range for example 65536")
topo1 = {
@@ -683,7 +719,7 @@ def test_ospfv3_hello_tc10_p0(request):
result = create_interfaces_cfg(tgen, topo1)
assert (
result is not True
- ), "Testcase {} : Failed \n Create interface failed. Error: {}".format(
+ ), "Testcase {} [23]: Failed \n Create interface failed. Error: {}".format(
tc_name, result
)
@@ -702,13 +738,17 @@ def test_ospfv3_hello_tc10_p0(request):
}
result = create_interfaces_cfg(tgen, topo1)
- assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+ assert result is True, "Testcase {} [24]: Failed \n Error: {}".format(
+ tc_name, result
+ )
step("Verify that timer value is deleted from intf & set to default value 40 sec.")
input_dict = {"r1": {"links": {"r0": {"ospf6": {"timerIntervalsConfigHello": 10}}}}}
dut = "r1"
result = verify_ospf6_interface(tgen, topo, dut=dut, input_dict=input_dict)
- assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+ assert result is True, "Testcase {} [25]: Failed \n Error: {}".format(
+ tc_name, result
+ )
write_test_footer(tc_name)
@@ -745,7 +785,9 @@ def test_ospfv3_dead_tc11_p0(request):
}
result = create_interfaces_cfg(tgen, topo1)
- assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+ assert result is True, "Testcase {} [01]: Failed \n Error: {}".format(
+ tc_name, result
+ )
step(
"verify that new timer value is configured and applied using "
@@ -754,7 +796,9 @@ def test_ospfv3_dead_tc11_p0(request):
dut = "r1"
input_dict = {"r1": {"links": {"r0": {"ospf6": {"timerIntervalsConfigDead": 48}}}}}
result = verify_ospf6_interface(tgen, topo, dut=dut, input_dict=input_dict)
- assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+ assert result is True, "Testcase {} [02]: Failed \n Error: {}".format(
+ tc_name, result
+ )
step("modify dead interval from default value to r1 dead interval timer on r2")
@@ -763,31 +807,35 @@ def test_ospfv3_dead_tc11_p0(request):
"links": {
"r1": {
"interface": topo["routers"]["r0"]["links"]["r1"]["interface"],
- "ospf6": {"dead_interval": 48, "hello_interval": 12},
+ "ospf6": {"hello_interval": 12, "dead_interval": 48},
}
}
}
}
result = create_interfaces_cfg(tgen, topo1)
- assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+ assert result is True, "Testcase {} [03]: Failed \n Error: {}".format(
+ tc_name, result
+ )
step("verify that new timer value is configured.")
input_dict = {"r0": {"links": {"r1": {"ospf6": {"timerIntervalsConfigDead": 48}}}}}
dut = "r0"
result = verify_ospf6_interface(tgen, topo, dut=dut, input_dict=input_dict)
- assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+ assert result is True, "Testcase {} [04]: Failed \n Error: {}".format(
+ tc_name, result
+ )
step("verify that ospf neighbours are full")
ospf_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut)
- assert ospf_covergence is True, "Testcase {} : Failed \n Error: {}".format(
+ assert ospf_covergence is True, "Testcase {} [05]: Failed \n Error: {}".format(
tc_name, ospf_covergence
)
step("remove ospf on R0")
ospf_del = {"r0": {"ospf6": {"delete": True}}}
result = create_router_ospf(tgen, topo, ospf_del)
- assert result is True, "Testcase : Failed \n Error: {}".format(result)
+ assert result is True, "Testcase [06]: Failed \n Error: {}".format(result)
# reconfiguring deleted ospf process by resetting the configs.
reset_config_on_routers(tgen)
@@ -805,7 +853,9 @@ def test_ospfv3_dead_tc11_p0(request):
}
result = create_interfaces_cfg(tgen, topo1)
- assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+ assert result is True, "Testcase {} [07]: Failed \n Error: {}".format(
+ tc_name, result
+ )
topo1 = {
"r1": {
@@ -819,17 +869,21 @@ def test_ospfv3_dead_tc11_p0(request):
}
result = create_interfaces_cfg(tgen, topo1)
- assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+ assert result is True, "Testcase {} [08]: Failed \n Error: {}".format(
+ tc_name, result
+ )
step("verify that new timer value is configured.")
input_dict = {"r0": {"links": {"r1": {"ospf6": {"timerIntervalsConfigDead": 40}}}}}
dut = "r0"
result = verify_ospf6_interface(tgen, topo, dut=dut, input_dict=input_dict)
- assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+ assert result is True, "Testcase {} [09]: Failed \n Error: {}".format(
+ tc_name, result
+ )
step("verify that ospf neighbours are full")
ospf_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut)
- assert ospf_covergence is True, "Testcase {} : Failed \n Error: {}".format(
+ assert ospf_covergence is True, "Testcase {} [10]: Failed \n Error: {}".format(
tc_name, ospf_covergence
)
@@ -847,7 +901,9 @@ def test_ospfv3_dead_tc11_p0(request):
}
result = create_interfaces_cfg(tgen, topo1)
- assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+ assert result is True, "Testcase {} [11]: Failed \n Error: {}".format(
+ tc_name, result
+ )
topo1 = {
"r1": {
@@ -861,7 +917,9 @@ def test_ospfv3_dead_tc11_p0(request):
}
result = create_interfaces_cfg(tgen, topo1)
- assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+ assert result is True, "Testcase {} [12]: Failed \n Error: {}".format(
+ tc_name, result
+ )
step("verify that new timer value is configured.")
input_dict = {
@@ -869,11 +927,13 @@ def test_ospfv3_dead_tc11_p0(request):
}
dut = "r0"
result = verify_ospf6_interface(tgen, topo, dut=dut, input_dict=input_dict)
- assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+ assert result is True, "Testcase {} [13]: Failed \n Error: {}".format(
+ tc_name, result
+ )
step("verify that ospf neighbours are full")
ospf_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut)
- assert ospf_covergence is True, "Testcase {} : Failed \n Error: {}".format(
+ assert ospf_covergence is True, "Testcase {} [14]: Failed \n Error: {}".format(
tc_name, ospf_covergence
)
@@ -892,7 +952,7 @@ def test_ospfv3_dead_tc11_p0(request):
result = create_interfaces_cfg(tgen, topo1)
assert (
result is not True
- ), "Testcase {} : Failed \n Create interface config failed. Error: {}".format(
+ ), "Testcase {} [15]: Failed \n Create interface config failed. Error: {}".format(
tc_name, result
)
@@ -911,13 +971,17 @@ def test_ospfv3_dead_tc11_p0(request):
}
result = create_interfaces_cfg(tgen, topo1)
- assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+ assert result is True, "Testcase {} [16]: Failed \n Error: {}".format(
+ tc_name, result
+ )
step("Verify that timer value is deleted from intf & set to default value 40 sec.")
input_dict = {"r1": {"links": {"r0": {"ospf6": {"timerIntervalsConfigDead": 40}}}}}
dut = "r1"
result = verify_ospf6_interface(tgen, topo, dut=dut, input_dict=input_dict)
- assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+ assert result is True, "Testcase {} [17]: Failed \n Error: {}".format(
+ tc_name, result
+ )
write_test_footer(tc_name)