use of org.ovirt.engine.core.common.businessentities.network.NetworkAttachment in project ovirt-engine by oVirt.
the class NetworkAttachmentsValidatorTest method createNetworkAttachment.
private NetworkAttachment createNetworkAttachment(Network network) {
NetworkAttachment result = new NetworkAttachment();
result.setNetworkId(network.getId());
return result;
}
use of org.ovirt.engine.core.common.businessentities.network.NetworkAttachment in project ovirt-engine by oVirt.
the class NetworkAttachmentsValidatorTest method testValidateNetworkExclusiveOnNicsAllAttachmentsMustHaveNicNameSet.
@Test(expected = IllegalArgumentException.class)
public void testValidateNetworkExclusiveOnNicsAllAttachmentsMustHaveNicNameSet() throws Exception {
NetworkAttachment networkAttachment = new NetworkAttachment();
networkAttachment.setNetworkId(vmNetwork1.getId());
List<NetworkAttachment> attachmentsToConfigure = Collections.singletonList(networkAttachment);
new NetworkAttachmentsValidator(attachmentsToConfigure, networkMap, networkExclusivenessValidator).validateNetworkExclusiveOnNics();
}
use of org.ovirt.engine.core.common.businessentities.network.NetworkAttachment in project ovirt-engine by oVirt.
the class NetworkAttachmentsValidatorTest method testVerifyUserAttachmentsDoesNotReferenceSameNetworkDuplicatelyWhenNoDuplicates.
@Test
public void testVerifyUserAttachmentsDoesNotReferenceSameNetworkDuplicatelyWhenNoDuplicates() {
Network networkA = createNetworkWithIdAndName("networkA");
NetworkAttachment networkAttachmentA = createNetworkAttachment(networkA);
Network networkB = createNetworkWithIdAndName("networkB");
NetworkAttachment networkAttachmentB = createNetworkAttachment(networkB);
List<NetworkAttachment> attachments = Arrays.asList(networkAttachmentA, networkAttachmentB);
BusinessEntityMap<Network> networksMap = new BusinessEntityMap<>(Arrays.asList(networkA, networkB));
NetworkAttachmentsValidator validator = new NetworkAttachmentsValidator(attachments, networksMap, networkExclusivenessValidator);
assertThat(validator.verifyUserAttachmentsDoesNotReferenceSameNetworkDuplicately(), isValid());
}
use of org.ovirt.engine.core.common.businessentities.network.NetworkAttachment in project ovirt-engine by oVirt.
the class NetworkAttachmentIpConfigurationValidatorTest method init.
@Before
public void init() {
NetworkAttachment networkAttachment = new NetworkAttachment();
networkAttachment.setNetworkName(NETWORK_NAME);
networkAttachment.setNicName(INTERFACE_NAME);
networkAttachments = new ArrayList<>();
networkAttachments.add(networkAttachment);
}
use of org.ovirt.engine.core.common.businessentities.network.NetworkAttachment in project ovirt-engine by oVirt.
the class BaseNetworkImplementationDetailsUtilsTest method createNetworkAttachment.
private NetworkAttachment createNetworkAttachment(HostNetworkQos qos, VdsNetworkInterface baseIface) {
NetworkAttachment networkAttachment = new NetworkAttachment();
networkAttachment.setId(Guid.newGuid());
networkAttachment.setNicId(baseIface.getId());
networkAttachment.setNicName(baseIface.getName());
networkAttachment.setHostNetworkQos(AnonymousHostNetworkQos.fromHostNetworkQos(qos));
return networkAttachment;
}
Aggregations