summaryrefslogtreecommitdiff
path: root/tests/topotests/ospfv3_basic_functionality/test_ospfv3_authentication.py
diff options
context:
space:
mode:
authorDonald Sharp <donaldsharp72@gmail.com>2022-12-15 07:31:49 -0500
committerGitHub <noreply@github.com>2022-12-15 07:31:49 -0500
commit9da878b66abb654c46b99e529bb01e7878999a9f (patch)
treeb0efc582e6733989ba01df9876735d63eb18e4c8 /tests/topotests/ospfv3_basic_functionality/test_ospfv3_authentication.py
parenta1dcf3022aef2acd09ebef5d41e2d525281f239e (diff)
parentac6ef90b879b8d9251251bb0e634ff19946e47db (diff)
Merge pull request #12481 from kuldeepkash/topotests_startup
tests: Topotests daemon start as per feature test
Diffstat (limited to 'tests/topotests/ospfv3_basic_functionality/test_ospfv3_authentication.py')
-rw-r--r--tests/topotests/ospfv3_basic_functionality/test_ospfv3_authentication.py59
1 files changed, 20 insertions, 39 deletions
diff --git a/tests/topotests/ospfv3_basic_functionality/test_ospfv3_authentication.py b/tests/topotests/ospfv3_basic_functionality/test_ospfv3_authentication.py
index d32a05a88e..0fe0fd95b0 100644
--- a/tests/topotests/ospfv3_basic_functionality/test_ospfv3_authentication.py
+++ b/tests/topotests/ospfv3_basic_functionality/test_ospfv3_authentication.py
@@ -50,7 +50,6 @@ from lib.common_config import (
reset_config_on_routers,
step,
shutdown_bringup_interface,
- topo_daemons,
)
from lib.topolog import logger
from lib.topojson import build_topo_from_json, build_config_from_json
@@ -94,6 +93,7 @@ TESTCASES =
"""
+
def setup_module(mod):
"""
Sets up the pytest environment
@@ -112,12 +112,9 @@ def setup_module(mod):
topo = tgen.json_topo
# ... and here it calls Mininet initialization functions.
- # get list of daemons needs to be started for this suite.
- daemons = topo_daemons(tgen, topo)
-
# Starting topology, create tmp files which are loaded to routers
# to start daemons and then start routers
- start_topology(tgen, daemons)
+ start_topology(tgen)
# Creating configuration from JSON
build_config_from_json(tgen, topo)
@@ -157,6 +154,7 @@ def teardown_module(mod):
# Test cases start here.
# ##################################
+
def test_ospf6_auth_trailer_tc1_md5(request):
"""
OSPFv3 Authentication Trailer - Verify ospfv3 authentication trailer
@@ -233,9 +231,7 @@ def test_ospf6_auth_trailer_tc1_md5(request):
tc_name, ospf6_covergence
)
- step(
- "Disable authentication on R2 "
- )
+ step("Disable authentication on R2 ")
r2_ospf6_auth = {
"r2": {
@@ -245,7 +241,7 @@ def test_ospf6_auth_trailer_tc1_md5(request):
"hash-algo": "md5",
"key": "ospf6",
"key-id": "10",
- "del_action": True
+ "del_action": True,
}
}
}
@@ -401,9 +397,7 @@ def test_ospf6_auth_trailer_tc2_sha256(request):
tc_name, ospf6_covergence
)
- step(
- "Disable authentication on R2 "
- )
+ step("Disable authentication on R2 ")
r2_ospf6_auth = {
"r2": {
@@ -413,7 +407,7 @@ def test_ospf6_auth_trailer_tc2_sha256(request):
"hash-algo": "hmac-sha-256",
"key": "ospf6",
"key-id": "10",
- "del_action": True
+ "del_action": True,
}
}
}
@@ -492,6 +486,7 @@ def test_ospf6_auth_trailer_tc2_sha256(request):
write_test_footer(tc_name)
+
def test_ospf6_auth_trailer_tc3_keychain_md5(request):
"""
OSPFv3 Authentication Trailer - Verify ospfv3 authentication trailer
@@ -583,21 +578,10 @@ def test_ospf6_auth_trailer_tc3_keychain_md5(request):
tc_name, ospf6_covergence
)
- step(
- "Disable authentication on R2 "
- )
+ step("Disable authentication on R2 ")
r2_ospf6_auth = {
- "r2": {
- "links": {
- "r1": {
- "ospf6": {
- "keychain": "auth",
- "del_action": True
- }
- }
- }
- }
+ "r2": {"links": {"r1": {"ospf6": {"keychain": "auth", "del_action": True}}}}
}
result = config_ospf6_interface(tgen, topo, r2_ospf6_auth)
assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result)
@@ -670,6 +654,7 @@ def test_ospf6_auth_trailer_tc3_keychain_md5(request):
write_test_footer(tc_name)
+
def test_ospf6_auth_trailer_tc4_keychain_sha256(request):
"""
OSPFv3 Authentication Trailer - Verify ospfv3 authentication trailer
@@ -761,21 +746,10 @@ def test_ospf6_auth_trailer_tc4_keychain_sha256(request):
tc_name, ospf6_covergence
)
- step(
- "Disable authentication on R2 "
- )
+ step("Disable authentication on R2 ")
r2_ospf6_auth = {
- "r2": {
- "links": {
- "r1": {
- "ospf6": {
- "keychain": "auth",
- "del_action": True
- }
- }
- }
- }
+ "r2": {"links": {"r1": {"ospf6": {"keychain": "auth", "del_action": True}}}}
}
result = config_ospf6_interface(tgen, topo, r2_ospf6_auth)
assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result)
@@ -848,6 +822,7 @@ def test_ospf6_auth_trailer_tc4_keychain_sha256(request):
write_test_footer(tc_name)
+
def test_ospf6_auth_trailer_tc5_md5_keymissmatch(request):
"""
OSPFv3 Authentication Trailer - Verify ospfv3 authentication trailer
@@ -963,6 +938,7 @@ def test_ospf6_auth_trailer_tc5_md5_keymissmatch(request):
write_test_footer(tc_name)
+
def test_ospf6_auth_trailer_tc6_sha256_mismatch(request):
"""
OSPFv3 Authentication Trailer - Verify ospfv3 authentication trailer
@@ -1073,6 +1049,7 @@ def test_ospf6_auth_trailer_tc6_sha256_mismatch(request):
write_test_footer(tc_name)
+
def test_ospf6_auth_trailer_tc7_keychain_md5_missmatch(request):
"""
OSPFv3 Authentication Trailer - Verify ospfv3 authentication trailer
@@ -1204,6 +1181,7 @@ def test_ospf6_auth_trailer_tc7_keychain_md5_missmatch(request):
write_test_footer(tc_name)
+
def test_ospf6_auth_trailer_tc8_keychain_sha256_missmatch(request):
"""
OSPFv3 Authentication Trailer - Verify ospfv3 authentication trailer
@@ -1335,6 +1313,7 @@ def test_ospf6_auth_trailer_tc8_keychain_sha256_missmatch(request):
write_test_footer(tc_name)
+
def test_ospf6_auth_trailer_tc9_keychain_not_configured(request):
"""
OSPFv3 Neighborship without Authentication Trailer -
@@ -1412,6 +1391,7 @@ def test_ospf6_auth_trailer_tc9_keychain_not_configured(request):
write_test_footer(tc_name)
+
def test_ospf6_auth_trailer_tc10_no_auth_trailer(request):
"""
OSPFv3 Neighborship without Authentication Trailer -
@@ -1441,6 +1421,7 @@ def test_ospf6_auth_trailer_tc10_no_auth_trailer(request):
write_test_footer(tc_name)
+
if __name__ == "__main__":
args = ["-s"] + sys.argv[1:]
sys.exit(pytest.main(args))