My idea was to use ADD_BR inside the OVS_TRAFFIC_VSWITCHD_START() parameters, but I'm fine with this approach too.
Acked-by: Daniele Di Proietto <diproiet...@vmware.com> On 08/08/2015 00:28, "Joe Stringer" <joestrin...@nicira.com> wrote: >This patch splits ADD_BR into two commands, so they can be used from >different contexts: > >ADD_BR(...) is a standalone command to add a bridge to OVS, and allows >additional ovs-vsctl arguments to be passed. It uses _ADD_BR(). >_ADD_BR(...) is the implementation-specific ovs-vsctl arguments to >set up the correct datapath type for userspace or kmod tests. > >Signed-off-by: Joe Stringer <joestrin...@nicira.com> >--- > tests/system-common-macros.at | 6 ++++++ > tests/system-kmod-macros.at | 6 +++--- > tests/system-userspace-macros.at | 6 +++--- > 3 files changed, 12 insertions(+), 6 deletions(-) > >diff --git a/tests/system-common-macros.at b/tests/system-common-macros.at >index 7f243f7..45e59e5 100644 >--- a/tests/system-common-macros.at >+++ b/tests/system-common-macros.at >@@ -36,6 +36,12 @@ m4_define([NS_CHECK_EXEC], > [ AT_CHECK([NS_EXEC([$1], [$2])], m4_shift(m4_shift($@))) ] > ) > >+# ADD_BR([name], [vsctl-args]) >+# >+# Expands into the proper ovs-vsctl commands to create a bridge with the >+# appropriate type, and allows additional arguments to be passed. >+m4_define([ADD_BR], [ovs-vsctl _ADD_BR([$1]) -- $2]) >+ > # ADD_VETH([port], [namespace], [ovs-br], [ip_addr]) > # > # Add a pair of veth ports. 'port' will be added to name space >'namespace', >diff --git a/tests/system-kmod-macros.at b/tests/system-kmod-macros.at >index 3f94504..a5aa5db 100644 >--- a/tests/system-kmod-macros.at >+++ b/tests/system-kmod-macros.at >@@ -1,8 +1,8 @@ >-# ADD_BR([name]) >+# _ADD_BR([name]) > # > # Expands into the proper ovs-vsctl commands to create a bridge with the > # appropriate type >-m4_define([ADD_BR], [[add-br $1]]) >+m4_define([_ADD_BR], [[add-br $1]]) > > # OVS_TRAFFIC_VSWITCHD_START([vsctl-args], [vsctl-output], [=override]) > # >@@ -18,7 +18,7 @@ m4_define([OVS_TRAFFIC_VSWITCHD_START], > ON_EXIT([modprobe -r openvswitch]) > _OVS_VSWITCHD_START([]) > dnl Add bridges, ports, etc. >- AT_CHECK([ovs-vsctl -- ADD_BR([br0]) -- set bridge br0 >protocols=[[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlo >w15]] fail-mode=secure -- $1 m4_if([$2], [], [], [| ${PERL} >$srcdir/uuidfilt.pl])], [0], [$2]) >+ AT_CHECK([ovs-vsctl -- _ADD_BR([br0]) -- set bridge br0 >protocols=[[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlo >w15]] fail-mode=secure -- $1 m4_if([$2], [], [], [| ${PERL} >$srcdir/uuidfilt.pl])], [0], [$2]) > ]) > > # OVS_TRAFFIC_VSWITCHD_STOP([WHITELIST], [extra_cmds]) >diff --git a/tests/system-userspace-macros.at >b/tests/system-userspace-macros.at >index b273576..adc40c4 100644 >--- a/tests/system-userspace-macros.at >+++ b/tests/system-userspace-macros.at >@@ -1,8 +1,8 @@ >-# ADD_BR([name]) >+# _ADD_BR([name]) > # > # Expands into the proper ovs-vsctl commands to create a bridge with the > # appropriate type >-m4_define([ADD_BR], [[add-br $1 -- set Bridge $1 datapath_type="netdev" >]]) >+m4_define([_ADD_BR], [[add-br $1 -- set Bridge $1 datapath_type="netdev" >]]) > > # OVS_TRAFFIC_VSWITCHD_START([vsctl-args], [vsctl-output], [=override]) > # >@@ -16,7 +16,7 @@ m4_define([OVS_TRAFFIC_VSWITCHD_START], > [ > _OVS_VSWITCHD_START([--disable-system]) > dnl Add bridges, ports, etc. >- AT_CHECK([ovs-vsctl -- ADD_BR([br0]) -- set bridge br0 >protocols=[[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlo >w15]] fail-mode=secure -- $1 m4_if([$2], [], [], [| ${PERL} >$srcdir/uuidfilt.pl])], [0], [$2]) >+ AT_CHECK([ovs-vsctl -- _ADD_BR([br0]) -- set bridge br0 >protocols=[[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlo >w15]] fail-mode=secure -- $1 m4_if([$2], [], [], [| ${PERL} >$srcdir/uuidfilt.pl])], [0], [$2]) > ]) > > # OVS_TRAFFIC_VSWITCHD_STOP([WHITELIST], [extra_cmds]) >-- >2.1.4 > _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev