Acked-by: Daniele Di Proietto <diproiet...@vmware.com> On 12/08/2015 22:01, "Joe Stringer" <joestrin...@nicira.com> wrote:
>This allows arbitrary commands to be passed into the NS_EXEC macro to be >executed within a namespace, including commands that have quotes and >commands chained together. > >Signed-off-by: Joe Stringer <joestrin...@nicira.com> >--- >Daniele, thanks for the suggestion, this seems to work pretty well. My >only complaint is that the test logs seem to end up with a bunch of >extra whitespaces printed after these commands. Do you have any insight >into why this might be? If you mean empty lines, I can confirm that. I'm not a m4 expert, but applying the following incremental removes those: diff --git a/tests/system-common-macros.at b/tests/system-common-macros.at index 91792af..2761c08 100644 --- a/tests/system-common-macros.at +++ b/tests/system-common-macros.at @@ -27,8 +27,7 @@ m4_define([ADD_NAMESPACES], m4_define([NS_EXEC], [ip netns exec $1 sh << NS_EXEC_HEREDOC $2 -NS_EXEC_HEREDOC] -) +NS_EXEC_HEREDOC]) # NS_CHECK_EXEC([namespace], [command], other_params...) # >--- > tests/system-common-macros.at | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >diff --git a/tests/system-common-macros.at b/tests/system-common-macros.at >index 1321e58..198592c 100644 >--- a/tests/system-common-macros.at >+++ b/tests/system-common-macros.at >@@ -25,7 +25,9 @@ m4_define([ADD_NAMESPACES], > # > # Execute 'command' in 'namespace' > m4_define([NS_EXEC], >- [ip netns exec $1 bash -c "$2"] >+ [ip netns exec $1 sh << NS_EXEC_HEREDOC >+$2 >+NS_EXEC_HEREDOC] > ) > > # NS_CHECK_EXEC([namespace], [command], other_params...) >-- >2.1.4 > _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev