Skip to content
Merged
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
9 changes: 8 additions & 1 deletion tests/dualtor_io/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,17 @@ def pytest_generate_tests(metafunc):
def setup_loganalyzer(loganalyzer):
"""Fixture to allow customize loganalyzer behaviors."""

def _setup_loganalyzer(duthost, collect_only):
KERNEL_BOOTUP_SYSLOG = "kernel: [ 0.000000] Linux version"

def _setup_loganalyzer(duthost, collect_only=False, collect_from_bootup=False):
if collect_only:
loganalyzer[duthost.hostname].match_regex = []
loganalyzer[duthost.hostname].expect_regex = []
loganalyzer[duthost.hostname].ignore_regex = []

if collect_from_bootup:
loganalyzer[duthost.hostname].start_marker = KERNEL_BOOTUP_SYSLOG
loganalyzer[duthost.hostname].ansible_loganalyzer.start_marker = \
KERNEL_BOOTUP_SYSLOG

return _setup_loganalyzer
8 changes: 4 additions & 4 deletions tests/dualtor_io/test_tor_failure.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def test_active_tor_reboot_upstream(
Send upstream traffic and reboot the active ToR. Confirm switchover
occurred and disruption lasts < 1 second
"""
setup_loganalyzer(upper_tor_host, collect_only=True)
setup_loganalyzer(upper_tor_host, collect_only=True, collect_from_bootup=True)
send_server_to_t1_with_action(
upper_tor_host, verify=True, delay=MUX_SIM_ALLOWED_DISRUPTION_SEC,
action=toggle_upper_tor_pdu, stop_after=60
Expand Down Expand Up @@ -99,7 +99,7 @@ def test_active_tor_reboot_downstream_standby(
Send downstream traffic to the standby ToR and reboot the active ToR.
Confirm switchover occurred and disruption lasts < 1 second
"""
setup_loganalyzer(upper_tor_host, collect_only=True)
setup_loganalyzer(upper_tor_host, collect_only=True, collect_from_bootup=True)
send_t1_to_server_with_action(
lower_tor_host, verify=True, delay=MUX_SIM_ALLOWED_DISRUPTION_SEC,
action=toggle_upper_tor_pdu, stop_after=60
Expand All @@ -123,7 +123,7 @@ def test_standby_tor_reboot_upstream(
Send upstream traffic and reboot the standby ToR. Confirm no switchover
occurred and no disruption
"""
setup_loganalyzer(lower_tor_host, collect_only=True)
setup_loganalyzer(lower_tor_host, collect_only=True, collect_from_bootup=True)
send_server_to_t1_with_action(
upper_tor_host, verify=True,
action=toggle_lower_tor_pdu, stop_after=60
Expand All @@ -147,7 +147,7 @@ def test_standby_tor_reboot_downstream_active(
Send downstream traffic to the active ToR and reboot the standby ToR.
Confirm no switchover occurred and no disruption
"""
setup_loganalyzer(lower_tor_host, collect_only=True)
setup_loganalyzer(lower_tor_host, collect_only=True, collect_from_bootup=True)
send_t1_to_server_with_action(
upper_tor_host, verify=True,
action=toggle_lower_tor_pdu, stop_after=60
Expand Down
Loading