summaryrefslogtreecommitdiff
path: root/smoketest
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-08-14 20:41:28 +0200
committerChristian Poessinger <christian@poessinger.com>2021-08-14 20:41:48 +0200
commit9b21e4a769385514f0bf625d665d588266dc6de4 (patch)
tree24e893f80f91d2f2cbe7c26b017168f591dee331 /smoketest
parente7d841d2854d8e0ebb95cb6f0bd83e84fba3a9fa (diff)
downloadvyos-1x-9b21e4a769385514f0bf625d665d588266dc6de4.tar.gz
vyos-1x-9b21e4a769385514f0bf625d665d588266dc6de4.zip
smoketest: shim: wait for commit to be completed
This completes commit e7d841d285 ("smoketest: shim: remove superfluous sleep() in getFRRconfig()").
Diffstat (limited to 'smoketest')
-rw-r--r--smoketest/scripts/cli/base_vyostest_shim.py5
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 c0665fa0c..419530c3d 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='$', endsection='^!'):
""" Retrieve current "running configuration" from FRR """