Skip to content

Commit 3156593

Browse files
authored
Fix the SIGTERM tests for chassisd to make sure the daemon actually restarted. (#7150)
1 parent ef482ff commit 3156593

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/platform_tests/daemon/test_chassisd.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ def check_expected_daemon_status(duthost, expected_daemon_status):
6767
daemon_status, _ = duthost.get_pmon_daemon_status(daemon_name)
6868
return daemon_status == expected_daemon_status
6969

70+
def check_if_daemon_restarted(duthost, daemon_name, pre_daemon_pid):
71+
daemon_status, daemon_pid = duthost.get_pmon_daemon_status(daemon_name)
72+
return (daemon_pid > pre_daemon_pid)
73+
7074
def collect_data(duthost):
7175
keys = duthost.shell('sonic-db-cli STATE_DB KEYS "CHASSIS_*TABLE|*"')['stdout_lines']
7276

@@ -164,6 +168,7 @@ def test_pmon_chassisd_term_and_start_status(check_daemon_status, duthosts, enum
164168

165169
duthost.stop_pmon_daemon(daemon_name, SIG_TERM, pre_daemon_pid)
166170

171+
wait_until(120, 10, 0, check_if_daemon_restarted, duthost, daemon_name, pre_daemon_pid)
167172
wait_until(50, 10, 0, check_expected_daemon_status, duthost, expected_running_status)
168173

169174
post_daemon_status, post_daemon_pid = duthost.get_pmon_daemon_status(daemon_name)

0 commit comments

Comments
 (0)