system-common-macros: clean up veth device on test failure.
'on_exit' should be run directly after creation
of veth device.
Fixes: ("kmod-macros: Move some code to traffic-common-macros.")
Acked-by: Eelco Chaudron
Acked-by: Flavio Leitner
Acked-by: Aaron Conole
@@ -72,6 +72,7 @@ m4_define([ADD_INT],
#
m4_define([ADD_VETH],
[ AT_CHECK([ip link add $1 type veth peer name ovs-$1 || return 77])
+ on_exit 'ip link del ovs-$1'
CONFIGURE_VETH_OFFLOADS([$1])
AT_CHECK([ip link set $1 netns $2])
AT_CHECK([ip link set dev ovs-$1 up])
@@ -85,7 +86,6 @@ m4_define([ADD_VETH],
if test -n "$6"; then
NS_CHECK_EXEC([$2], [ip route add default via $6])
fi
- on_exit 'ip link del ovs-$1'
]
)
