check-system-userspace: Waiting for port's availability before creation.
authorIlya Maximets <i.maximets@samsung.com>
Fri, 4 Mar 2016 05:31:57 +0000 (08:31 +0300)
committerJoe Stringer <joe@ovn.org>
Tue, 29 Mar 2016 20:19:37 +0000 (09:19 +1300)
Fixes failure of test due to not yet fully destroyed ports from
previous test if ovs-vswitchd was killed.

Example:

netdev_linux|WARN|br0: creating tap device failed: Device or resource busy
bridge|WARN|could not open network device br0 (Device or resource busy)

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Joe Stringer <joe@ovn.org>
tests/system-userspace-macros.at

index 565a7a0..4fed777 100644 (file)
@@ -14,8 +14,10 @@ m4_define([_ADD_BR], [[add-br $1 -- set Bridge $1 datapath_type="netdev" protoco
 # specifies the expected output after filtering through uuidfilt.pl.
 m4_define([OVS_TRAFFIC_VSWITCHD_START],
   [
+   OVS_WAIT_WHILE([ip link show ovs-netdev])
    _OVS_VSWITCHD_START([--disable-system])
    dnl Add bridges, ports, etc.
+   OVS_WAIT_WHILE([ip link show br0])
    AT_CHECK([ovs-vsctl -- _ADD_BR([br0]) -- $1 m4_if([$2], [], [], [| ${PERL} $srcdir/uuidfilt.pl])], [0], [$2])
 ])