use of org.ovirt.engine.core.common.action.HostSetupNetworksParameters in project ovirt-engine by oVirt.
the class NicLabelValidatorTest method labelBeingAttachedToNonVlanNonSlaveInterfaceAttachToNewSlave.
@Test
public void labelBeingAttachedToNonVlanNonSlaveInterfaceAttachToNewSlave() {
HostSetupNetworksParameters params = createHostSetupNetworksParams();
VdsNetworkInterface slave = createNic();
CreateOrUpdateBond createOrUpdateBond = new CreateOrUpdateBond();
createOrUpdateBond.setName("bond");
createOrUpdateBond.setSlaves(Collections.singleton(slave.getName()));
params.setCreateOrUpdateBonds(Collections.singletonList(createOrUpdateBond));
assertLabelBeingAttachedToNonVlanNonSlaveInterfaceFailed(params, slave);
}
use of org.ovirt.engine.core.common.action.HostSetupNetworksParameters in project ovirt-engine by oVirt.
the class NicLabelValidatorTest method labelBeingAttachedToValidBondAttachedBondBecomingNotValid.
@Test
public void labelBeingAttachedToValidBondAttachedBondBecomingNotValid() {
Bond existingBond = new Bond("bond");
existingBond.setSlaves(Arrays.asList("slave1", "slave2"));
HostSetupNetworksParameters params = createHostSetupNetworksParams();
CreateOrUpdateBond updatedBond = new CreateOrUpdateBond();
updatedBond.setName(existingBond.getName());
updatedBond.setSlaves(new HashSet<>());
params.getCreateOrUpdateBonds().add(updatedBond);
assertLabelBeingAttachedToValidBondFailed(params, existingBond);
}
use of org.ovirt.engine.core.common.action.HostSetupNetworksParameters in project ovirt-engine by oVirt.
the class NicLabelValidatorTest method labelAppearsOnlyOnceInParamsTwiceInLabels.
@Test
public void labelAppearsOnlyOnceInParamsTwiceInLabels() {
HostSetupNetworksParameters params = setLabelsOnParams(createSet(createNicLabel("lbl1"), createNicLabel("lbl1")), createSet("lbl2"));
asserThatLabelAppearsOnlyOnceInParamsFailed(createNicLabelValidator(params), new HashSet<>(Collections.singletonList("lbl1")));
}
use of org.ovirt.engine.core.common.action.HostSetupNetworksParameters in project ovirt-engine by oVirt.
the class NicLabelValidatorTest method labelAppearsOnlyOnceInParamsInBothLabelsAndRemoveLabels.
@Test
public void labelAppearsOnlyOnceInParamsInBothLabelsAndRemoveLabels() {
HostSetupNetworksParameters params = setLabelsOnParams(createSet(createNicLabel("lbl1")), createSet("lbl1"));
asserThatLabelAppearsOnlyOnceInParamsFailed(createNicLabelValidator(params), new HashSet<>(Collections.singletonList("lbl1")));
}
use of org.ovirt.engine.core.common.action.HostSetupNetworksParameters in project ovirt-engine by oVirt.
the class NetworkConfiguratorTest method createSetupNetworkParamsTest.
private IpConfiguration createSetupNetworkParamsTest(Version clusterVersion, Matcher<Collection<? extends IpV6Address>> ipv6AddressMatcher) {
setIpDetails(nic);
host.setClusterCompatibilityVersion(clusterVersion);
final HostSetupNetworksParameters actual = underTest.createSetupNetworkParams(nic);
assertThat(actual.getNetworkAttachments(), hasSize(1));
final IpConfiguration ipConfiguration = actual.getNetworkAttachments().get(0).getIpConfiguration();
assertIpv4Details(ipConfiguration);
assertThat(ipConfiguration.getIpV6Addresses(), ipv6AddressMatcher);
return ipConfiguration;
}
Aggregations