diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-08-14 20:41:28 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-08-15 15:26:44 +0200 |
commit | d5ac2419296142d015684a8e3f7e5eb9f387d1b6 (patch) | |
tree | 7d7f13e127021e2d845c05a15ea28105cd4761df | |
parent | dae0fb64426ae752bab3c3023b1697282b0ffd4e (diff) | |
download | vyos-1x-d5ac2419296142d015684a8e3f7e5eb9f387d1b6.tar.gz vyos-1x-d5ac2419296142d015684a8e3f7e5eb9f387d1b6.zip |
smoketest: shim: wait for commit to be completed
This completes commit e7d841d285 ("smoketest: shim: remove superfluous sleep()
in getFRRconfig()").
(cherry picked from commit 9b21e4a769385514f0bf625d665d588266dc6de4)
-rw-r--r-- | smoketest/scripts/cli/base_vyostest_shim.py | 5 |
1 files changed, 5 insertions, 0 deletions
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 """ |