diff mbox series

[ovs-dev,v3,2/9] tests: Set default timeout for utils in subshell.

Message ID 1533731740-13253-3-git-send-email-i.maximets@samsung.com
State Superseded
Headers show
Series tests: Clean up syslog. | expand

Commit Message

Ilya Maximets Aug. 8, 2018, 12:35 p.m. UTC
Aliases are not inheritable. To add a default options for utils
executed in subshell we may try to catch them here and append
options explicitly.

There are still few cases with utils invocation in subshell inside
the functions that we can not track this way, but they are not
very frequent.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
---
 tests/ofproto-macros.at | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/tests/ofproto-macros.at b/tests/ofproto-macros.at
index 2a56ae6..df8e7c4 100644
--- a/tests/ofproto-macros.at
+++ b/tests/ofproto-macros.at
@@ -107,7 +107,17 @@  sim_add () {
 # there.
 as() {
     if test "X$2" != X; then
-        (ovs_setenv $1; shift; "$@")
+        (
+         ovs_setenv $1; shift;
+         cmd=$1; shift;
+         for util in $OVS_UTILS_LIST; do
+             if test "X$util" = "X$cmd"; then
+                 $cmd --timeout=$OVS_TIMEOUT "$@"
+                 exit "$?"
+             fi
+         done
+         $cmd "$@"
+        )
     else
         ovs_setenv $1
     fi