When using the default user shell in FreeBSD and NetBSD and executing
a test in which the app name parameter to OVS_APP_EXIT_AND_WAIT
contains backticks (e.g. "`pwd`/unixctl"), TMPPID expands to:

    `cat "$OVS_RUNDIR"/"`pwd`"/unixctl.pid 2>/dev/null`

This results in an "unterminated quoted string" syntax error from
the shell.

Correct this by replacing backticks with $(...) in OVS_APP_EXIT_AND_WAIT.
Verified via "make check" under NetBSD 7 and Fedora 23.

Fixes: f9b11f2a09b4 ("tests: Make OVS_APP_EXIT_AND_WAIT() wait for process 
termination")
Reported-by: Aaron Conole <acon...@redhat.com>
Signed-off-by: Lance Richardson <lrich...@redhat.com>
---
 tests/ovs-macros.at | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/ovs-macros.at b/tests/ovs-macros.at
index 20003b8..e5710a0 100644
--- a/tests/ovs-macros.at
+++ b/tests/ovs-macros.at
@@ -135,7 +135,7 @@ dnl
 dnl Ask the daemon named DAEMON to exit, via ovs-appctl, and then waits for it
 dnl to exit.
 m4_define([OVS_APP_EXIT_AND_WAIT],
-  [TMPPID=`cat "$OVS_RUNDIR"/$1.pid 2>/dev/null`
+  [TMPPID=$(cat "$OVS_RUNDIR"/$1.pid 2>/dev/null)
    AT_CHECK([ovs-appctl -t $1 exit])
    OVS_WAIT_WHILE([kill -0 $TMPPID 2>/dev/null])])
 
-- 
2.5.5

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to