[ovs-dev] [RFC 2/4] tests: make as() function as documented

Lance Richardson lrichard at redhat.com
Wed Mar 2 21:40:46 UTC 2016


As documented, the as() function should only create a subshell
to execute the provided command when a command is present. Correct
the implementation to check for the presence of the command parameter
instead of the sandbox name (which is always present in current
usage).

Signed-off-by: Lance Richardson <lrichard at redhat.com>
---
 tests/ofproto-macros.at | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/ofproto-macros.at b/tests/ofproto-macros.at
index 1b22c44..637675c 100644
--- a/tests/ofproto-macros.at
+++ b/tests/ofproto-macros.at
@@ -104,7 +104,7 @@ sim_add () {
 # "as $1 COMMAND..." sets those variables in a subshell and invokes COMMAND
 # there.
 as() {
-    if test "X$1" != X; then
+    if test "X$2" != X; then
         (ovs_setenv $1; shift; $@)
     else
         ovs_setenv $1
-- 
2.5.0




More information about the dev mailing list