mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
LibvirtOvsFetchInterfaceCommandWrapperTest fix (test fails in mac) - skip it if no interfaces with eth and wl (#9382)
* test fix (fails in mac) - skip it if no interfaces with eth and wl * review comments
This commit is contained in:
parent
22ef08154d
commit
877c4d9a64
@ -26,6 +26,7 @@ import java.util.List;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
|
import org.junit.Assume;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.mockito.Spy;
|
import org.mockito.Spy;
|
||||||
@ -51,8 +52,7 @@ public class LibvirtOvsFetchInterfaceCommandWrapperTest {
|
|||||||
while(interfaces.hasMoreElements()) {
|
while(interfaces.hasMoreElements()) {
|
||||||
NetworkInterface networkInterface = interfaces.nextElement();
|
NetworkInterface networkInterface = interfaces.nextElement();
|
||||||
if (networkInterface.getInetAddresses().hasMoreElements() &&
|
if (networkInterface.getInetAddresses().hasMoreElements() &&
|
||||||
(networkInterface.getName().startsWith("eth") ||
|
networkInterface.getName().matches("^(eth|wl|en).*")) {
|
||||||
networkInterface.getName().startsWith("wl"))) {
|
|
||||||
interfaceName = networkInterface.getName();
|
interfaceName = networkInterface.getName();
|
||||||
Enumeration<InetAddress> addresses = networkInterface.getInetAddresses();
|
Enumeration<InetAddress> addresses = networkInterface.getInetAddresses();
|
||||||
while(addresses.hasMoreElements()) {
|
while(addresses.hasMoreElements()) {
|
||||||
@ -62,9 +62,13 @@ public class LibvirtOvsFetchInterfaceCommandWrapperTest {
|
|||||||
break;
|
break;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
if (StringUtils.isNotBlank(interfaceName) && StringUtils.isNotBlank(ipAddress)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (SocketException ignored) {}
|
} catch (SocketException ignored) {}
|
||||||
|
Assume.assumeTrue(StringUtils.isNotBlank(interfaceName));
|
||||||
Ternary<String, String, String> result = null;
|
Ternary<String, String, String> result = null;
|
||||||
try {
|
try {
|
||||||
result = wrapper.getInterfaceDetails(interfaceName);
|
result = wrapper.getInterfaceDetails(interfaceName);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user