Skip to content

Commit a02339b

Browse files
JibinBaogshemesh2
authored andcommitted
Skip some tests when reboot-type is warm-reboot or fast-reboot on smartswitch (sonic-net#19617)
* Skip warm-reboot and fast-reboot for smartswitch * Skip warm-reboot case for test_bgp_session case on smartswitch Signed-off-by: Guy Shemesh <[email protected]>
1 parent 5cdf3ff commit a02339b

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

tests/bgp/test_bgp_session.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,15 +174,17 @@ def test_bgp_session_interface_down(duthosts, rand_one_dut_hostname, fanouthosts
174174
4: do the test, reset bgp or swss or do the reboot
175175
5: Verify all bgp sessions are up
176176
'''
177+
duthost = duthosts[rand_one_dut_hostname]
178+
177179
# Skip the test on dualtor with reboot test type
178180
pytest_require(
179181
("dualtor" not in tbinfo["topo"]["name"] or test_type != "reboot"),
180182
"warm reboot is not supported on dualtor"
181183
)
182-
if test_type == "reboot" and "isolated" in tbinfo["topo"]["name"]:
183-
pytest.skip("Warm Reboot is not supported on isolated topology")
184-
185-
duthost = duthosts[rand_one_dut_hostname]
184+
if test_type == "reboot" and (
185+
"isolated" in tbinfo["topo"]["name"] or
186+
duthost.dut_basic_facts()['ansible_facts']['dut_basic_facts'].get("is_smartswitch")):
187+
pytest.skip("Warm Reboot is not supported on isolated topology or smartswitch")
186188

187189
# Skip the test on Virtual Switch due to fanout switch dependency and warm reboot
188190
asic_type = duthost.facts['asic_type']

tests/common/reboot.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import logging
55
import sys
66
import os
7+
import pytest
78
from multiprocessing.pool import ThreadPool
89
from collections import deque
910

@@ -255,7 +256,8 @@ def reboot_smartswitch(duthost, reboot_type=REBOOT_TYPE_COLD):
255256
"""
256257

257258
if reboot_type not in reboot_ss_ctrl_dict:
258-
logger.info("Skipping the reboot test as the reboot type {} is not supported".format(reboot_type))
259+
pytest.skip(
260+
"Skipping the reboot test as the reboot type {} is not supported on smartswitch".format(reboot_type))
259261
return
260262

261263
hostname = duthost.hostname
@@ -343,7 +345,7 @@ def reboot(duthost, localhost, reboot_type='cold', delay=10,
343345
collect_console_log, args=(duthost, localhost, timeout + wait_conlsole_connection))
344346
time.sleep(wait_conlsole_connection)
345347
# Perform reboot
346-
if duthost.get_facts().get("is_smartswitch"):
348+
if duthost.dut_basic_facts()['ansible_facts']['dut_basic_facts'].get("is_smartswitch"):
347349
reboot_res, dut_datetime = reboot_smartswitch(duthost, reboot_type)
348350
else:
349351
reboot_res, dut_datetime = perform_reboot(duthost, pool, reboot_command, reboot_helper,

tests/restapi/test_restapi.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,10 @@ def test_check_reset_status(construct_url, duthosts, rand_one_dut_hostname, loca
5757
pytest_assert(response['reset_status'] == "true")
5858

5959
support_warm_fast_reboot = True
60-
if 'isolated' in duthosts.tbinfo['topo']['name']:
60+
if 'isolated' in duthosts.tbinfo['topo']['name'] or \
61+
duthost.dut_basic_facts()['ansible_facts']['dut_basic_facts'].get("is_smartswitch"):
6162
support_warm_fast_reboot = False
62-
logger.info("Skipping warm and fast reboot tests for isolated topology")
63+
logger.info("Skipping warm and fast reboot tests for isolated topology or smartswitch")
6364

6465
# Check reset status post fast reboot
6566
if support_warm_fast_reboot:

0 commit comments

Comments
 (0)