Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Chassis][T2]: Reduce traffic-shift TSA/TSB tests runtime #16307

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/bgp/route_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,12 @@ def parse_routes_process(node=None, results=None, my_community=exp_community):
results[hostname] = routes
try:
all_routes = parallel_run(parse_routes_process, (), {}, list(
neigh_hosts.values()), timeout=240, concurrent_tasks=8)
neigh_hosts.values()), timeout=240, concurrent_tasks=12)
except BaseException as err:
logger.error(
'Failed to get routes info from VMs. Got error: {}\n\nTrying one more time.'.format(err))
all_routes = parallel_run(parse_routes_process, (), {}, list(
neigh_hosts.values()), timeout=240, concurrent_tasks=8)
neigh_hosts.values()), timeout=240, concurrent_tasks=12)
return all_routes


Expand Down Expand Up @@ -193,7 +193,7 @@ def parse_routes_process_vsonic(node=None, results=None):
results[hostname] = routes

all_routes = parallel_run(parse_routes_process_vsonic, (), {}, list(neigh_hosts.values()),
timeout=120, concurrent_tasks=8)
timeout=120, concurrent_tasks=12)
return all_routes


Expand Down
24 changes: 12 additions & 12 deletions tests/bgp/test_startup_tsa_tsb_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,14 @@ def check_ssh_state(localhost, dut_ip, expected_state, timeout=60):


@pytest.mark.disable_loganalyzer
def test_tsa_tsb_service_with_dut_cold_reboot(duthosts, localhost, enum_rand_one_per_hwsku_frontend_hostname, ptfhost,
def test_tsa_tsb_service_with_dut_cold_reboot(duthosts, localhost, rand_one_dut_front_end_hostname, ptfhost,
nbrhosts, traffic_shift_community, tbinfo):
"""
Test startup TSA_TSB service after DUT cold reboot
Verify startup_tsa_tsb.service started automatically when dut comes up
Verify this service configures TSA and starts a timer and configures TSB once the timer is expired
"""
duthost = duthosts[enum_rand_one_per_hwsku_frontend_hostname]
duthost = duthosts[rand_one_dut_front_end_hostname]
tsa_tsb_timer = get_startup_tsb_timer(duthost)
int_status_result, crit_process_check = True, True
if not tsa_tsb_timer:
Expand Down Expand Up @@ -278,14 +278,14 @@ def test_tsa_tsb_service_with_dut_cold_reboot(duthosts, localhost, enum_rand_one


@pytest.mark.disable_loganalyzer
def test_tsa_tsb_service_with_dut_abnormal_reboot(duthosts, localhost, enum_rand_one_per_hwsku_frontend_hostname,
def test_tsa_tsb_service_with_dut_abnormal_reboot(duthosts, localhost, rand_one_dut_front_end_hostname,
ptfhost, nbrhosts, traffic_shift_community, tbinfo):
"""
Test startup TSA_TSB service after DUT abnormal reboot/crash
Verify startup_tsa_tsb.service started automatically when dut comes up after crash
Verify this service configures TSA and starts a timer and configures TSB once the timer is expired
"""
duthost = duthosts[enum_rand_one_per_hwsku_frontend_hostname]
duthost = duthosts[rand_one_dut_front_end_hostname]
tsa_tsb_timer = get_startup_tsb_timer(duthost)
int_status_result, crit_process_check = True, True
if not tsa_tsb_timer:
Expand Down Expand Up @@ -701,15 +701,15 @@ def test_tsa_tsb_service_with_supervisor_abnormal_reboot(duthosts, localhost, en


@pytest.mark.disable_loganalyzer
def test_tsa_tsb_service_with_user_init_tsa(duthosts, localhost, enum_rand_one_per_hwsku_frontend_hostname, ptfhost,
def test_tsa_tsb_service_with_user_init_tsa(duthosts, localhost, rand_one_dut_front_end_hostname, ptfhost,
nbrhosts, traffic_shift_community, tbinfo):
"""
Initially, User initiates TSA on the DUT and saves the config on DUT.
Test startup TSA_TSB service after DUT cold reboot
Verify startup_tsa_tsb.service starts automatically when dut comes up
Verify this service doesn't configure another TSA and retains the existing TSA config on DUT
"""
duthost = duthosts[enum_rand_one_per_hwsku_frontend_hostname]
duthost = duthosts[rand_one_dut_front_end_hostname]
tsa_tsb_timer = get_startup_tsb_timer(duthost)
if not tsa_tsb_timer:
pytest.skip("startup_tsa_tsb.service is not supported on the {}".format(duthost.hostname))
Expand Down Expand Up @@ -806,7 +806,7 @@ def test_tsa_tsb_service_with_user_init_tsa(duthosts, localhost, enum_rand_one_p


@pytest.mark.disable_loganalyzer
def test_user_init_tsa_while_service_run_on_dut(duthosts, localhost, enum_rand_one_per_hwsku_frontend_hostname, ptfhost,
def test_user_init_tsa_while_service_run_on_dut(duthosts, localhost, rand_one_dut_front_end_hostname, ptfhost,
nbrhosts, traffic_shift_community, tbinfo):

"""
Expand All @@ -816,7 +816,7 @@ def test_user_init_tsa_while_service_run_on_dut(duthosts, localhost, enum_rand_o
Issue TSA while the service is running on dut, and make sure the TSA is configured
Make sure TSA_TSB service is stopped and dut continues to be in maintenance mode
"""
duthost = duthosts[enum_rand_one_per_hwsku_frontend_hostname]
duthost = duthosts[rand_one_dut_front_end_hostname]
tsa_tsb_timer = get_startup_tsb_timer(duthost)
int_status_result, crit_process_check = True, True
if not tsa_tsb_timer:
Expand Down Expand Up @@ -923,7 +923,7 @@ def test_user_init_tsa_while_service_run_on_dut(duthosts, localhost, enum_rand_o


@pytest.mark.disable_loganalyzer
def test_user_init_tsb_while_service_run_on_dut(duthosts, localhost, enum_rand_one_per_hwsku_frontend_hostname, ptfhost,
def test_user_init_tsb_while_service_run_on_dut(duthosts, localhost, rand_one_dut_front_end_hostname, ptfhost,
nbrhosts, traffic_shift_community, tbinfo):

"""
Expand All @@ -933,7 +933,7 @@ def test_user_init_tsb_while_service_run_on_dut(duthosts, localhost, enum_rand_o
Issue TSB while the service is running on dut, and make sure the TSB is configured
Make sure TSA_TSB service is stopped and dut continues to be in normal mode
"""
duthost = duthosts[enum_rand_one_per_hwsku_frontend_hostname]
duthost = duthosts[rand_one_dut_front_end_hostname]
tsa_tsb_timer = get_startup_tsb_timer(duthost)
int_status_result, crit_process_check = True, True
if not tsa_tsb_timer:
Expand Down Expand Up @@ -1170,14 +1170,14 @@ def test_user_init_tsb_on_sup_while_service_run_on_dut(duthosts, localhost,


@pytest.mark.disable_loganalyzer
def test_tsa_tsb_timer_efficiency(duthosts, localhost, enum_rand_one_per_hwsku_frontend_hostname, ptfhost,
def test_tsa_tsb_timer_efficiency(duthosts, localhost, rand_one_dut_front_end_hostname, ptfhost,
nbrhosts, traffic_shift_community, tbinfo):
"""
Test startup TSA_TSB service after DUT cold reboot
Verify the configured tsa_tsb_timer is sufficient for system to be stable
Verify this service configures TSA and starts a timer and configures TSB once the timer is expired
"""
duthost = duthosts[enum_rand_one_per_hwsku_frontend_hostname]
duthost = duthosts[rand_one_dut_front_end_hostname]
tsa_tsb_timer = get_startup_tsb_timer(duthost)
int_status_result, crit_process_check = True, True
if not tsa_tsb_timer:
Expand Down
24 changes: 12 additions & 12 deletions tests/bgp/test_traffic_shift.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@


@pytest.fixture(scope="module")
def nbrhosts_to_dut(duthosts, enum_rand_one_per_hwsku_frontend_hostname, nbrhosts):
duthost = duthosts[enum_rand_one_per_hwsku_frontend_hostname]
def nbrhosts_to_dut(duthosts, rand_one_dut_front_end_hostname, nbrhosts):
duthost = duthosts[rand_one_dut_front_end_hostname]
mg_facts = duthost.minigraph_facts(host=duthost.hostname)['ansible_facts']
nbrhosts_to_dut = {}
for host in list(nbrhosts.keys()):
Expand Down Expand Up @@ -63,13 +63,13 @@ def verify_all_routes_announce_to_neighs(dut_host, neigh_hosts, routes_dut, ip_v
return True


def test_TSA(duthosts, enum_rand_one_per_hwsku_frontend_hostname, ptfhost,
def test_TSA(duthosts, rand_one_dut_front_end_hostname, ptfhost,
nbrhosts_to_dut, bgpmon_setup_teardown, traffic_shift_community, tbinfo):
"""
Test TSA
Verify all routes are announced to bgp monitor, and only loopback routes are announced to neighs
"""
duthost = duthosts[enum_rand_one_per_hwsku_frontend_hostname]
duthost = duthosts[rand_one_dut_front_end_hostname]
# Initially make sure both supervisor and line cards are in BGP operational normal state
if tbinfo['topo']['type'] == 't2':
initial_tsa_check_before_and_after_test(duthosts)
Expand Down Expand Up @@ -99,13 +99,13 @@ def test_TSA(duthosts, enum_rand_one_per_hwsku_frontend_hostname, ptfhost,
initial_tsa_check_before_and_after_test(duthosts)


def test_TSB(duthosts, enum_rand_one_per_hwsku_frontend_hostname, ptfhost, nbrhosts, bgpmon_setup_teardown, tbinfo):
def test_TSB(duthosts, rand_one_dut_front_end_hostname, ptfhost, nbrhosts, bgpmon_setup_teardown, tbinfo):
"""
Test TSB.
Establish BGP session between PTF and DUT, and verify all routes are announced to bgp monitor,
and all routes are announced to neighbors
"""
duthost = duthosts[enum_rand_one_per_hwsku_frontend_hostname]
duthost = duthosts[rand_one_dut_front_end_hostname]
# Initially make sure both supervisor and line cards are in BGP operational normal state
if tbinfo['topo']['type'] == 't2':
initial_tsa_check_before_and_after_test(duthosts)
Expand Down Expand Up @@ -147,12 +147,12 @@ def test_TSB(duthosts, enum_rand_one_per_hwsku_frontend_hostname, ptfhost, nbrho
initial_tsa_check_before_and_after_test(duthosts)


def test_TSA_B_C_with_no_neighbors(duthosts, enum_rand_one_per_hwsku_frontend_hostname,
def test_TSA_B_C_with_no_neighbors(duthosts, rand_one_dut_front_end_hostname,
bgpmon_setup_teardown, nbrhosts, core_dump_and_config_check, tbinfo):
"""
Test TSA, TSB, TSC with no neighbors on ASIC0 in case of multi-asic and single-asic.
"""
duthost = duthosts[enum_rand_one_per_hwsku_frontend_hostname]
duthost = duthosts[rand_one_dut_front_end_hostname]
bgp_neighbors = {}
duts_data = core_dump_and_config_check
asic_index = 0 if duthost.is_multi_asic else DEFAULT_ASIC_ID
Expand Down Expand Up @@ -217,13 +217,13 @@ def test_TSA_B_C_with_no_neighbors(duthosts, enum_rand_one_per_hwsku_frontend_ho


@pytest.mark.disable_loganalyzer
def test_TSA_TSB_with_config_reload(duthosts, enum_rand_one_per_hwsku_frontend_hostname, ptfhost, nbrhosts,
def test_TSA_TSB_with_config_reload(duthosts, rand_one_dut_front_end_hostname, ptfhost, nbrhosts,
nbrhosts_to_dut, bgpmon_setup_teardown, traffic_shift_community, tbinfo):
"""
Test TSA after config save and config reload
Verify all routes are announced to bgp monitor, and only loopback routes are announced to neighs
"""
duthost = duthosts[enum_rand_one_per_hwsku_frontend_hostname]
duthost = duthosts[rand_one_dut_front_end_hostname]
# Initially make sure both supervisor and line cards are in BGP operational normal state
if tbinfo['topo']['type'] == 't2':
initial_tsa_check_before_and_after_test(duthosts)
Expand Down Expand Up @@ -286,14 +286,14 @@ def test_TSA_TSB_with_config_reload(duthosts, enum_rand_one_per_hwsku_frontend_h


@pytest.mark.disable_loganalyzer
def test_load_minigraph_with_traffic_shift_away(duthosts, enum_rand_one_per_hwsku_frontend_hostname,
def test_load_minigraph_with_traffic_shift_away(duthosts, rand_one_dut_front_end_hostname,
ptfhost, nbrhosts, nbrhosts_to_dut, bgpmon_setup_teardown,
traffic_shift_community, tbinfo):
"""
Test load_minigraph --traffic-shift-away
Verify all routes are announced to bgp monitor, and only loopback routes are announced to neighs
"""
duthost = duthosts[enum_rand_one_per_hwsku_frontend_hostname]
duthost = duthosts[rand_one_dut_front_end_hostname]
# Initially make sure both supervisor and line cards are in BGP operational normal state
if tbinfo['topo']['type'] == 't2':
initial_tsa_check_before_and_after_test(duthosts)
Expand Down
Loading