On Mon, Feb 29, 2016 at 04:06:50PM +0300, Ilya Maximets wrote:
> This prevents failure of test scenarios 'make check-kernel'
> and 'make check-system-userspace' if creation of veth pairs or
> network namespaces is not supported by kernel (or module isn't loaded).
>
> Signed-off-by: Ilya Maximets <[email protected]>
> ---
> tests/system-common-macros.at | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/tests/system-common-macros.at b/tests/system-common-macros.at
> index fcd7792..c536fb4 100644
> --- a/tests/system-common-macros.at
> +++ b/tests/system-common-macros.at
> @@ -15,8 +15,8 @@ m4_define([DEL_NAMESPACES],
> m4_define([ADD_NAMESPACES],
> [m4_foreach([ns], [$@],
> [DEL_NAMESPACES(ns)
> - AT_CHECK([ip netns add ns])
> - on_exit 'DEL_NAMESPACES(ns)'
> + AT_SKIP_IF([! ip netns add ns])
> + on_exit 'DEL_NAMESPACES(ns)'
> ])
> ]
> )
> @@ -66,7 +66,7 @@ m4_define([ADD_INT],
> # The existing 'port' or 'ovs-port' will be removed before new ones are
> added.
> #
> m4_define([ADD_VETH],
> - [ AT_CHECK([ip link add $1 type veth peer name ovs-$1])
> + [ AT_SKIP_IF([! ip link add $1 type veth peer name ovs-$1])
> AT_CHECK([ip link set $1 netns $2])
> AT_CHECK([ip link set dev ovs-$1 up])
> AT_CHECK([ovs-vsctl add-port $3 ovs-$1])
I suspect that for these cases it would be better to use AT_CHECK with
"|| exit 77". That way the output of the command will get logged, which
will simplify troubleshooting if something goes wrong ("Why are these
tests skipped?" ... "Oh I see my 'ip' program is too old" versus "Ugh,
I need to try all this stuff by hand").
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev