tests: make as() function as documented
authorLance Richardson <lrichard@redhat.com>
Wed, 2 Mar 2016 21:40:46 +0000 (16:40 -0500)
committerBen Pfaff <blp@ovn.org>
Fri, 18 Mar 2016 23:55:57 +0000 (16:55 -0700)
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@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
tests/ofproto-macros.at

index 18114d9..d475b9f 100644 (file)
@@ -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