Skip to content

Commit

Permalink
Fix test_reload_config issue: #11654 (#11675)
Browse files Browse the repository at this point in the history
Cherry-pick #11674 to 202205 branch
1. Revert PR: #7289, because the relevant issue has been fixed by PR:sonic-net/sonic-buildimage#15080
2. Remove  wait_until(60, 1, 0, check_interfaces_config_service_status, duthost) in PR: #7953 due to the above same reason
  • Loading branch information
JibinBao authored Mar 4, 2024
1 parent 3fbd841 commit a6cf129
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions tests/platform_tests/test_reload_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import logging

import pytest
import re

from tests.common.fixtures.conn_graph_facts import conn_graph_facts
from tests.common.utilities import wait_until
Expand Down Expand Up @@ -94,9 +93,6 @@ def test_reload_configuration_checks(duthosts, enum_rand_one_per_hwsku_hostname,
# we must give it a little longer or else it may falsely fail the test.
wait_until(360, 1, 0, check_database_status, duthost)

# Check if interfaces-config.service is exited
wait_until(60, 1, 0, check_interfaces_config_service_status, duthost)

logging.info("Reload configuration check")
out = duthost.shell("sudo config reload -y", executable="/bin/bash", module_ignore_errors=True)
# config reload command shouldn't work immediately after system reboot
Expand All @@ -112,8 +108,6 @@ def test_reload_configuration_checks(duthosts, enum_rand_one_per_hwsku_hostname,
logging.info("Checking config reload after system is up")
# Check if all database containers have started
wait_until(60, 1, 0, check_database_status, duthost)
# Check if interfaces-config.service is exited
wait_until(60, 1, 0, check_interfaces_config_service_status, duthost)
out = duthost.shell("sudo config reload -y", executable="/bin/bash", module_ignore_errors=True)
assert "Retry later" in out['stdout']
assert wait_until(300, 20, 0, config_system_checks_passed, duthost)
Expand All @@ -135,11 +129,3 @@ def test_reload_configuration_checks(duthosts, enum_rand_one_per_hwsku_hostname,
assert "Retry later" not in out['stdout']

assert wait_until(300, 20, 0, config_system_checks_passed, duthost)


def check_interfaces_config_service_status(duthost):
# check interfaces-config.service status
regx_interface_config_service_exit = r'.*Main PID: \d+ \(code=exited, status=0\/SUCCESS\).*'
interface_config_server_status = duthost.command(
'systemctl status interfaces-config.service', module_ignore_errors=True)['stdout']
return re.search(regx_interface_config_service_exit, interface_config_server_status)

0 comments on commit a6cf129

Please sign in to comment.