use of org.ovirt.engine.core.common.businessentities.network.IpConfiguration in project ovirt-engine by oVirt.
the class NetworkAttachmentValidatorTest method createNetworkAttachmentWithIpv4Configuration.
private NetworkAttachment createNetworkAttachmentWithIpv4Configuration(Ipv4BootProtocol bootProtocol) {
IpConfiguration ipConfiguration = new IpConfiguration();
IPv4Address primaryAddress = new IPv4Address();
primaryAddress.setAddress(null);
primaryAddress.setNetmask(null);
primaryAddress.setBootProtocol(bootProtocol);
ipConfiguration.getIPv4Addresses().add(primaryAddress);
NetworkAttachment attachment = new NetworkAttachment();
attachment.setIpConfiguration(ipConfiguration);
return attachment;
}
use of org.ovirt.engine.core.common.businessentities.network.IpConfiguration in project ovirt-engine by oVirt.
the class NetworkInSyncWithVdsNetworkInterfaceTest method initIpv4Configuration.
private void initIpv4Configuration() {
IpConfiguration ipConfiguration = this.testedNetworkAttachment.getIpConfiguration();
ipConfiguration.setIPv4Addresses(Collections.singletonList(ipv4Address));
}
use of org.ovirt.engine.core.common.businessentities.network.IpConfiguration in project ovirt-engine by oVirt.
the class NetworkInSyncWithVdsNetworkInterfaceTest method initIpv6Configuration.
private void initIpv6Configuration() {
IpConfiguration ipConfiguration = this.testedNetworkAttachment.getIpConfiguration();
ipConfiguration.setIpV6Addresses(Collections.singletonList(ipv6Address));
}
use of org.ovirt.engine.core.common.businessentities.network.IpConfiguration in project ovirt-engine by oVirt.
the class HostNetworkAttachmentsPersisterTest method testPersistNetworkAttachmentsWhenNothingToUpdate.
@Test
public void testPersistNetworkAttachmentsWhenNothingToUpdate() throws Exception {
NetworkAttachment upToDateNetworkAttachment = createNetworkAttachment(clusterNetworkA);
upToDateNetworkAttachment.setNicId(interfaceWithAttachedClusterNetworkA.getId());
IpConfiguration ipConfiguration = NetworkUtils.createIpConfigurationFromVdsNetworkInterface(interfaceWithAttachedClusterNetworkA);
upToDateNetworkAttachment.setIpConfiguration(ipConfiguration);
upToDateNetworkAttachment.setProperties(customPropertiesForNics.getCustomPropertiesFor(interfaceWithAttachedClusterNetworkA));
when(networkAttachmentDao.getAllForHost(eq(hostId))).thenReturn(Collections.singletonList(upToDateNetworkAttachment));
createPersister(Collections.emptyList()).persistNetworkAttachments();
verify(networkAttachmentDao).getAllForHost(any());
verifyNoMoreInteractions(networkAttachmentDao);
}
use of org.ovirt.engine.core.common.businessentities.network.IpConfiguration in project ovirt-engine by oVirt.
the class HostNetworkAttachmentsPersisterTest method testPersistNetworkAttachmentsWhenNetworkMovedToDifferentNic.
@Test
public void testPersistNetworkAttachmentsWhenNetworkMovedToDifferentNic() throws Exception {
NetworkAttachment networkAttachmentForClusterNetworkA = createNetworkAttachment(clusterNetworkA);
// make network attachment out of sync, by setting different nicId and nicName
Guid notUpToDateNicId = Guid.newGuid();
networkAttachmentForClusterNetworkA.setNicId(notUpToDateNicId);
networkAttachmentForClusterNetworkA.setNicName("nonsense");
IpConfiguration ipConfiguration = NetworkUtils.createIpConfigurationFromVdsNetworkInterface(interfaceWithAttachedClusterNetworkA);
networkAttachmentForClusterNetworkA.setIpConfiguration(ipConfiguration);
networkAttachmentForClusterNetworkA.setProperties(customPropertiesForNics.getCustomPropertiesFor(interfaceWithAttachedClusterNetworkA));
callPersistNetworkAttachmentsAndVerifyThatNetworkAttachmentIsSynced(networkAttachmentForClusterNetworkA, createPersister(Collections.emptyList()));
}
Aggregations