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

Ilya Maximets i.maximets at samsung.com
Wed Aug 1 14:00:11 UTC 2018


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 at samsung.com>
---
 tests/ofproto-macros.at | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/tests/ofproto-macros.at b/tests/ofproto-macros.at
index 2a56ae6..96219cd 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
-- 
2.7.4



More information about the dev mailing list