Skip to content

Commit e8ca075

Browse files
vaibhavhdAharonMalkin
authored andcommitted
[advanced-reboot] Handle logs on tmpfs for all new platforms (sonic-net#9094)
Fix the tests failing on newly addded platforms where logs are moved to tmpfs. Related PR: sonic-net/sonic-buildimage#15077 Fixes: sonic-net/sonic-buildimage#15895 This change updates the check from hwsku match to platform match
1 parent 0c46ac0 commit e8ca075

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

tests/platform_tests/conftest.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,15 @@
2121
FMT = "%b %d %H:%M:%S.%f"
2222
FMT_SHORT = "%b %d %H:%M:%S"
2323
FMT_ALT = "%Y-%m-%dT%H:%M:%S.%f%z"
24-
SMALL_DISK_SKUS = [
25-
"Arista-7060CX-32S-C32",
26-
"Arista-7060CX-32S-Q32",
27-
"Arista-7060CX-32S-D48C8"
24+
LOGS_ON_TMPFS_PLATFORMS = [
25+
"x86_64-arista_7050_qx32",
26+
"x86_64-arista_7050_qx32s",
27+
"x86_64-arista_7060_cx32s",
28+
"x86_64-arista_7260cx3_64",
29+
"x86_64-arista_7050cx3_32s",
30+
"x86_64-mlnx_msn2700-r0",
31+
"x86_64-dell_s6100_c2538-r0",
32+
"armhf-nokia_ixs7215_52x-r0"
2833
]
2934

3035

@@ -452,7 +457,7 @@ def advanceboot_loganalyzer(duthosts, enum_rand_one_per_hwsku_frontend_hostname,
452457
name='device_type') for arg in mark.args]
453458
if 'vs' not in device_marks:
454459
pytest.skip('Testcase not supported for kvm')
455-
hwsku = duthost.facts["hwsku"]
460+
platform = duthost.facts["platform"]
456461
logs_in_tmpfs = list()
457462

458463
loganalyzer = LogAnalyzer(
@@ -486,7 +491,7 @@ def pre_reboot_analysis():
486491
True if (log_filesystem and "tmpfs" in log_filesystem) else False)
487492
base_os_version.append(get_current_sonic_version(duthost))
488493
bgpd_log = bgpd_log_handler(preboot=True)
489-
if hwsku in SMALL_DISK_SKUS or (len(logs_in_tmpfs) > 0 and logs_in_tmpfs[0] is True):
494+
if platform in LOGS_ON_TMPFS_PLATFORMS or (len(logs_in_tmpfs) > 0 and logs_in_tmpfs[0] is True):
490495
# For small disk devices, /var/log in mounted in tmpfs.
491496
# Hence, after reboot the preboot logs are lost.
492497
# For log_analyzer to work, it needs logs from the shutdown path
@@ -508,7 +513,7 @@ def pre_reboot_analysis():
508513

509514
def post_reboot_analysis(marker, event_counters=None, reboot_oper=None, log_dir=None):
510515
bgpd_log_handler()
511-
if hwsku in SMALL_DISK_SKUS or (len(logs_in_tmpfs) > 0 and logs_in_tmpfs[0] is True):
516+
if platform in LOGS_ON_TMPFS_PLATFORMS or (len(logs_in_tmpfs) > 0 and logs_in_tmpfs[0] is True):
512517
restore_backup = "mv /host/syslog.99 /var/log/; " +\
513518
"mv /host/sairedis.rec.99 /var/log/swss/; " +\
514519
"mv /host/swss.rec.99 /var/log/swss/; " +\

0 commit comments

Comments
 (0)