On Fri, Jul 29, 2016 at 11:17:03AM -0700, Joe Stringer wrote: > On 28 July 2016 at 10:54, Eric Garver <e...@erig.me> wrote: > > Add macros OVS_CHECK_8021AD(), ADD_SVLAN() and ADD_CVLAN(). > > > > Signed-off-by: Eric Garver <e...@erig.me> > > --- > > tests/system-common-macros.at | 29 ++++++++++++++++++++++++++++- > > 1 file changed, 28 insertions(+), 1 deletion(-) > > > > diff --git a/tests/system-common-macros.at b/tests/system-common-macros.at > > index 4ffc3822a4d3..537df45096f3 100644 > > --- a/tests/system-common-macros.at > > +++ b/tests/system-common-macros.at > > @@ -93,12 +93,35 @@ m4_define([ADD_VETH], > > # Add a VLAN device named 'port' within 'namespace'. It will be configured > > # with the ID 'vlan-id' and the address 'ip-addr'. > > m4_define([ADD_VLAN], > > - [ NS_CHECK_EXEC([$2], [ip link add link $1 name $1.$3 type vlan id $3]) > > + [ NS_CHECK_EXEC([$2], [ip link add link $1 name $1.$3 type vlan proto > > 802.1q id $3]) > > NS_CHECK_EXEC([$2], [ip link set dev $1.$3 up]) > > NS_CHECK_EXEC([$2], [ip addr add dev $1.$3 $4]) > > ] > > ) > > > > +# ADD_SVLAN([port], [namespace], [vlan-id], [ip-addr]) > > +# > > +# Add a SVLAN device named 'port' within 'namespace'. It will be configured > > +# with the ID 'vlan-id' and the address 'ip-addr'. > > +m4_define([ADD_SVLAN], > > + [ NS_CHECK_EXEC([$2], [ip link add link $1 name $1.$3 type vlan proto > > 802.1ad id $3]) > > + NS_CHECK_EXEC([$2], [ip link set dev $1.$3 up]) > > + NS_CHECK_EXEC([$2], [ip addr add dev $1.$3 $4]) > > + NS_CHECK_EXEC([$2], [ip link set $1 mtu 1504]) > > + NS_CHECK_EXEC([$2], [ip link set $1.$3 mtu 1500]) > > + ] > > +) > > + > > +# ADD_CVLAN([port], [namespace], [vlan-id], [ip-addr]) > > +# > > +# Similar to ADD_VLAN(), but sets MTU. > > +# > > +m4_define([ADD_CVLAN], > > + [ ADD_VLAN([$1], [$2], [$3], [$4]) > > + NS_CHECK_EXEC([$2], [ip link set $1.$3 mtu 1500]) > > + ] > > +) > > + > > # ADD_OVS_TUNNEL([type], [bridge], [port], [remote-addr], [overlay-addr]) > > # > > # Add an ovs-based tunnel device in the root namespace, with name 'port' > > and > > @@ -175,3 +198,7 @@ m4_define([OVS_CHECK_GRE], > > # OVS_CHECK_GENEVE() > > m4_define([OVS_CHECK_GENEVE], > > [AT_SKIP_IF([! ip link add foo type geneve help 2>&1 | grep geneve > > >/dev/null])]) > > + > > +# OVS_CHECK_8021AD() > > +m4_define([OVS_CHECK_8021AD], > > + [AT_SKIP_IF([test `sed -n 's/.*VLAN label stack length probed as > > \(\d*\)/\1/p' ovs-vswitchd.log` -lt 2])]) > > This is clearly relying on the string to be printed by OVS, but if you > had an extra line something like this first then it would work with > existing OVS today, too: > > AT_SKIP_IF([! grep "VLAN label stack" ovs-vswitchd.log])
Good point. I'll add that. Thanks. _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev