From d5ac2419296142d015684a8e3f7e5eb9f387d1b6 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 14 Aug 2021 20:41:28 +0200 Subject: smoketest: shim: wait for commit to be completed This completes commit e7d841d285 ("smoketest: shim: remove superfluous sleep() in getFRRconfig()"). (cherry picked from commit 9b21e4a769385514f0bf625d665d588266dc6de4) --- smoketest/scripts/cli/base_vyostest_shim.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'smoketest/scripts/cli') diff --git a/smoketest/scripts/cli/base_vyostest_shim.py b/smoketest/scripts/cli/base_vyostest_shim.py index f851852de..93b2ca150 100644 --- a/smoketest/scripts/cli/base_vyostest_shim.py +++ b/smoketest/scripts/cli/base_vyostest_shim.py @@ -20,7 +20,9 @@ from time import sleep from vyos.configsession import ConfigSession from vyos.configsession import ConfigSessionError from vyos import ConfigError +from vyos.defaults import commit_lock from vyos.util import cmd +from vyos.util import run save_config = '/tmp/vyos-smoketest-save' @@ -70,6 +72,9 @@ class VyOSUnitTestSHIM: def cli_commit(self): self._session.commit() + # during a commit there is a process opening commit_lock, and run() returns 0 + while run(f'sudo lsof | grep -q {commit_lock}') == 0: + sleep(0.250) def getFRRconfig(self, string, end='$'): """ Retrieve current "running configuration" from FRR """ -- cgit v1.2.3