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 org.junit.Assert;
|
||||
import org.junit.Assume;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.Spy;
|
||||
@ -51,8 +52,7 @@ public class LibvirtOvsFetchInterfaceCommandWrapperTest {
|
||||
while(interfaces.hasMoreElements()) {
|
||||
NetworkInterface networkInterface = interfaces.nextElement();
|
||||
if (networkInterface.getInetAddresses().hasMoreElements() &&
|
||||
(networkInterface.getName().startsWith("eth") ||
|
||||
networkInterface.getName().startsWith("wl"))) {
|
||||
networkInterface.getName().matches("^(eth|wl|en).*")) {
|
||||
interfaceName = networkInterface.getName();
|
||||
Enumeration<InetAddress> addresses = networkInterface.getInetAddresses();
|
||||
while(addresses.hasMoreElements()) {
|
||||
@ -62,9 +62,13 @@ public class LibvirtOvsFetchInterfaceCommandWrapperTest {
|
||||
break;
|
||||
};
|
||||
}
|
||||
if (StringUtils.isNotBlank(interfaceName) && StringUtils.isNotBlank(ipAddress)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (SocketException ignored) {}
|
||||
Assume.assumeTrue(StringUtils.isNotBlank(interfaceName));
|
||||
Ternary<String, String, String> result = null;
|
||||
try {
|
||||
result = wrapper.getInterfaceDetails(interfaceName);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user