Skip to content

Commit

Permalink
Try fix UT
Browse files Browse the repository at this point in the history
  • Loading branch information
liuh-80 committed Jul 13, 2022
1 parent 9a7ddfc commit 67d22e1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/platform_tests/cli/test_sonic_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,25 @@
pytest.mark.device_type('vs')
]

DOCKER_START_WAIT_TIME = 10
CONFIG_RELOAD_WAIT_TIME = 60
DOCKER_WAIT_TIME = 10

@pytest.fixture(scope='function')
def stop_database_docker(duthosts, enum_rand_one_per_hwsku_hostname):
duthost = duthosts[enum_rand_one_per_hwsku_hostname]

# shutdown database docker before test
duthost.command("sudo docker stop database", module_ignore_errors=True)
time.sleep(DOCKER_WAIT_TIME)

yield

# start database docker after test
duthost.command("sudo docker start database", module_ignore_errors=True)
time.sleep(DOCKER_START_WAIT_TIME)
time.sleep(DOCKER_WAIT_TIME)

# reload config, because some critical process not work after database docker restart
duthost.shell('sudo config save -y')
config_reload(duthost)
time.sleep(CONFIG_RELOAD_WAIT_TIME)
wait_critical_processes(duthost)

def test_sonic_installer_not_depends_on_database_docker(duthosts, enum_rand_one_per_hwsku_hostname, stop_database_docker):
Expand Down

0 comments on commit 67d22e1

Please sign in to comment.