Skip to content

Commit

Permalink
tests: Added testcases start and end time.
Browse files Browse the repository at this point in the history
These changes will help us to determine the testsuite execution time.

Signed-off-by: y-bharath14 <[email protected]>
  • Loading branch information
y-bharath14 committed Apr 26, 2024
1 parent b2263bc commit c1396c3
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/topotests/bfd_bgp_cbit_topo3/test_bfd_bgp_cbit_topo3.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import os
import sys
import json
import time
from functools import partial
import pytest

Expand All @@ -33,6 +34,11 @@

def setup_module(mod):
"Sets up the pytest environment"

testsuite_run_time = time.asctime(time.localtime(time.time()))
logger.info("Testsuite start time: {}".format(testsuite_run_time))
logger.info("=" * 40)

topodef = {
"s1": ("r1", "r2"),
"s2": ("r2", "r3"),
Expand Down Expand Up @@ -71,6 +77,10 @@ def teardown_module(_mod):
tgen = get_topogen()
tgen.stop_topology()

logger.info(
"Testsuite end time: {}".format(time.asctime(time.localtime(time.time())))
)
logger.info("=" * 40)

def test_protocols_convergence():
"""
Expand Down
10 changes: 10 additions & 0 deletions tests/topotests/bfd_isis_topo1/test_bfd_isis_topo1.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@

import os
import sys
import time
import pytest
import json
from functools import partial
Expand All @@ -76,6 +77,11 @@

def setup_module(mod):
"Sets up the pytest environment"

testsuite_run_time = time.asctime(time.localtime(time.time()))
logger.info("Testsuite start time: {}".format(testsuite_run_time))
logger.info("=" * 40)

topodef = {
"s1": ("rt1:eth-rt2", "rt2:eth-rt1"),
"s2": ("rt1:eth-rt3", "rt3:eth-rt1"),
Expand Down Expand Up @@ -110,6 +116,10 @@ def teardown_module(mod):
# This function tears down the whole topology.
tgen.stop_topology()

logger.info(
"Testsuite end time: {}".format(time.asctime(time.localtime(time.time())))
)
logger.info("=" * 40)

def print_cmd_result(rname, command):
print(get_topogen().gears[rname].vtysh_cmd(command, isjson=False))
Expand Down
12 changes: 12 additions & 0 deletions tests/topotests/bfd_vrf_topo1/test_bfd_vrf_topo1.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import os
import sys
import time
import json
from functools import partial
import pytest
Expand All @@ -36,6 +37,8 @@


def build_topo(tgen):
logger.info("Building topology with 4 routers")

# Create 4 routers
for routern in range(1, 5):
tgen.add_router("r{}".format(routern))
Expand All @@ -55,6 +58,11 @@ def build_topo(tgen):

def setup_module(mod):
"Sets up the pytest environment"

testsuite_run_time = time.asctime(time.localtime(time.time()))
logger.info("Testsuite start time: {}".format(testsuite_run_time))
logger.info("=" * 40)

tgen = Topogen(build_topo, mod.__name__)
tgen.start_topology()

Expand Down Expand Up @@ -115,6 +123,10 @@ def teardown_module(_mod):
router.net.delete_netns("{}-bfd-cust1".format(rname))
tgen.stop_topology()

logger.info(
"Testsuite end time: {}".format(time.asctime(time.localtime(time.time())))
)
logger.info("=" * 40)

def test_bfd_connection():
"Assert that the BFD peers can find themselves."
Expand Down

0 comments on commit c1396c3

Please sign in to comment.