diff --git a/tests/bgp/test_bgp_session.py b/tests/bgp/test_bgp_session.py index cf3b3a29b9e..ad132e1c081 100644 --- a/tests/bgp/test_bgp_session.py +++ b/tests/bgp/test_bgp_session.py @@ -173,15 +173,17 @@ def test_bgp_session_interface_down(duthosts, rand_one_dut_hostname, fanouthosts 4: do the test, reset bgp or swss or do the reboot 5: Verify all bgp sessions are up ''' + duthost = duthosts[rand_one_dut_hostname] + # Skip the test on dualtor with reboot test type pytest_require( ("dualtor" not in tbinfo["topo"]["name"] or test_type != "reboot"), "warm reboot is not supported on dualtor" ) - if test_type == "reboot" and "isolated" in tbinfo["topo"]["name"]: - pytest.skip("Warm Reboot is not supported on isolated topology") - - duthost = duthosts[rand_one_dut_hostname] + if test_type == "reboot" and ( + "isolated" in tbinfo["topo"]["name"] or + duthost.dut_basic_facts()['ansible_facts']['dut_basic_facts'].get("is_smartswitch")): + pytest.skip("Warm Reboot is not supported on isolated topology or smartswitch") # Skip the test on Virtual Switch due to fanout switch dependency and warm reboot asic_type = duthost.facts['asic_type'] diff --git a/tests/common/reboot.py b/tests/common/reboot.py index e48eba5eabe..044fcfca4c9 100644 --- a/tests/common/reboot.py +++ b/tests/common/reboot.py @@ -4,6 +4,7 @@ import logging import sys import os +import pytest from multiprocessing.pool import ThreadPool from collections import deque @@ -255,7 +256,8 @@ def reboot_smartswitch(duthost, reboot_type=REBOOT_TYPE_COLD): """ if reboot_type not in reboot_ss_ctrl_dict: - logger.info("Skipping the reboot test as the reboot type {} is not supported".format(reboot_type)) + pytest.skip( + "Skipping the reboot test as the reboot type {} is not supported on smartswitch".format(reboot_type)) return hostname = duthost.hostname @@ -343,7 +345,7 @@ def reboot(duthost, localhost, reboot_type='cold', delay=10, collect_console_log, args=(duthost, localhost, timeout + wait_conlsole_connection)) time.sleep(wait_conlsole_connection) # Perform reboot - if duthost.get_facts().get("is_smartswitch"): + if duthost.dut_basic_facts()['ansible_facts']['dut_basic_facts'].get("is_smartswitch"): reboot_res, dut_datetime = reboot_smartswitch(duthost, reboot_type) else: reboot_res, dut_datetime = perform_reboot(duthost, pool, reboot_command, reboot_helper, diff --git a/tests/restapi/test_restapi.py b/tests/restapi/test_restapi.py index 4f93a07ac8d..7cd9ee07398 100644 --- a/tests/restapi/test_restapi.py +++ b/tests/restapi/test_restapi.py @@ -57,9 +57,10 @@ def test_check_reset_status(construct_url, duthosts, rand_one_dut_hostname, loca pytest_assert(response['reset_status'] == "true") support_warm_fast_reboot = True - if 'isolated' in duthosts.tbinfo['topo']['name']: + if 'isolated' in duthosts.tbinfo['topo']['name'] or \ + duthost.dut_basic_facts()['ansible_facts']['dut_basic_facts'].get("is_smartswitch"): support_warm_fast_reboot = False - logger.info("Skipping warm and fast reboot tests for isolated topology") + logger.info("Skipping warm and fast reboot tests for isolated topology or smartswitch") # Check reset status post fast reboot if support_warm_fast_reboot: