use of org.ovirt.engine.core.common.businessentities.network.ReportedConfiguration in project ovirt-engine by oVirt.
the class NetworkInSyncWithVdsNetworkInterfaceTest method testReportConfigurationsOnHostWhenIpv4BootProtocolNotStatic.
@Test
public void testReportConfigurationsOnHostWhenIpv4BootProtocolNotStatic() {
initIpv4ConfigurationBootProtocolAddress(Ipv4BootProtocol.NONE, false);
initIpv4ConfigurationBootProtocolNetmask(Ipv4BootProtocol.NONE, false);
initIpv4ConfigurationBootProtocolGateway(Ipv4BootProtocol.NONE, false);
NetworkInSyncWithVdsNetworkInterface testedInstanceWithSameNonQosValues = createTestedInstanceWithSameNonQosValues();
List<ReportedConfiguration> reportedConfigurationList = testedInstanceWithSameNonQosValues.reportConfigurationsOnHost().getReportedConfigurationList();
IPv4Address primaryAddress = this.testedNetworkAttachment.getIpConfiguration().getIpv4PrimaryAddress();
List<ReportedConfiguration> expectedReportedConfigurations = addReportedConfigurations(createBasicAndQosReportedConfigurations(), defaultRouteReportedConfiguration(false), new ReportedConfiguration(ReportedConfigurationType.IPV4_BOOT_PROTOCOL, iface.getIpv4BootProtocol().name(), primaryAddress.getBootProtocol().name(), true));
assertThat(reportedConfigurationList.containsAll(expectedReportedConfigurations), is(true));
assertThat(reportedConfigurationList.size(), is(expectedReportedConfigurations.size()));
}
use of org.ovirt.engine.core.common.businessentities.network.ReportedConfiguration in project ovirt-engine by oVirt.
the class NetworkInSyncWithVdsNetworkInterfaceTest method testReportConfigurationsOnHostWhenIfaceQosIsNull.
@Test
public void testReportConfigurationsOnHostWhenIfaceQosIsNull() throws Exception {
ifaceQos = null;
iface.setQos(null);
NetworkInSyncWithVdsNetworkInterface testedInstanceWithSameNonQosValues = createTestedInstanceWithSameNonQosValues();
networkQos.setOutAverageLinkshare(1);
networkQos.setOutAverageUpperlimit(1);
networkQos.setOutAverageRealtime(1);
ReportedConfigurations reportedConfigurations = testedInstanceWithSameNonQosValues.reportConfigurationsOnHost();
assertThat(createTestedInstanceWithSameNonQosValues().isNetworkInSync(), is(false));
assertThat(reportedConfigurations.isNetworkInSync(), is(false));
List<ReportedConfiguration> reportedConfigurationList = reportedConfigurations.getReportedConfigurationList();
List<ReportedConfiguration> expectedReportedConfigurations = addReportedConfigurations(createBasicReportedConfigurations(), defaultRouteReportedConfiguration(false), new ReportedConfiguration(ReportedConfigurationType.OUT_AVERAGE_LINK_SHARE, null, networkQos.getOutAverageLinkshare(), false), new ReportedConfiguration(ReportedConfigurationType.OUT_AVERAGE_REAL_TIME, null, networkQos.getOutAverageRealtime(), false), new ReportedConfiguration(ReportedConfigurationType.OUT_AVERAGE_UPPER_LIMIT, null, networkQos.getOutAverageUpperlimit(), false));
assertThat(reportedConfigurationList.containsAll(expectedReportedConfigurations), is(true));
assertThat(reportedConfigurationList.size(), is(expectedReportedConfigurations.size()));
}
use of org.ovirt.engine.core.common.businessentities.network.ReportedConfiguration in project ovirt-engine by oVirt.
the class NetworkInSyncWithVdsNetworkInterfaceTest method testReportConfigurationsOnHostWhenIpv4BootProtocolStatic.
private void testReportConfigurationsOnHostWhenIpv4BootProtocolStatic(boolean syncAddress, boolean syncNetmask, boolean syncGateway) {
initIpv4ConfigurationBootProtocolAddress(Ipv4BootProtocol.STATIC_IP, syncAddress);
initIpv4ConfigurationBootProtocolNetmask(Ipv4BootProtocol.STATIC_IP, syncNetmask);
initIpv4ConfigurationBootProtocolGateway(Ipv4BootProtocol.STATIC_IP, syncGateway);
NetworkInSyncWithVdsNetworkInterface testedInstanceWithSameNonQosValues = createTestedInstanceWithSameNonQosValues();
List<ReportedConfiguration> reportedConfigurationList = testedInstanceWithSameNonQosValues.reportConfigurationsOnHost().getReportedConfigurationList();
IPv4Address primaryAddress = this.testedNetworkAttachment.getIpConfiguration().getIpv4PrimaryAddress();
List<ReportedConfiguration> expectedReportedConfigurations = addReportedConfigurations(createBasicAndQosReportedConfigurations(), defaultRouteReportedConfiguration(false), new ReportedConfiguration(ReportedConfigurationType.IPV4_BOOT_PROTOCOL, iface.getIpv4BootProtocol().name(), primaryAddress.getBootProtocol().name(), true), new ReportedConfiguration(ReportedConfigurationType.IPV4_NETMASK, iface.getIpv4Subnet(), primaryAddress.getNetmask(), syncNetmask), new ReportedConfiguration(ReportedConfigurationType.IPV4_ADDRESS, iface.getIpv4Address(), primaryAddress.getAddress(), syncAddress), new ReportedConfiguration(ReportedConfigurationType.IPV4_GATEWAY, iface.getIpv4Gateway(), primaryAddress.getGateway(), syncGateway));
for (ReportedConfiguration expectedReportedConfiguration : expectedReportedConfigurations) {
assertThat("expected configuration not reported:" + expectedReportedConfiguration, reportedConfigurationList.contains(expectedReportedConfiguration), is(true));
}
assertThat(reportedConfigurationList.size(), is(expectedReportedConfigurations.size()));
}
use of org.ovirt.engine.core.common.businessentities.network.ReportedConfiguration in project ovirt-engine by oVirt.
the class NetworkInSyncWithVdsNetworkInterfaceTest method testReportConfigurationsOnHost.
@Test
public void testReportConfigurationsOnHost() throws Exception {
NetworkInSyncWithVdsNetworkInterface testedInstanceWithSameNonQosValues = createTestedInstanceWithSameNonQosValues();
ifaceQos.setOutAverageLinkshare(1);
ifaceQos.setOutAverageUpperlimit(1);
ifaceQos.setOutAverageRealtime(1);
ReportedConfigurations reportedConfigurations = testedInstanceWithSameNonQosValues.reportConfigurationsOnHost();
assertThat(reportedConfigurations.isNetworkInSync(), is(false));
List<ReportedConfiguration> reportedConfigurationList = reportedConfigurations.getReportedConfigurationList();
List<ReportedConfiguration> expectedReportedConfigurations = addReportedConfigurations(combineReportedConfigurations(createBasicReportedConfigurations(), reportQos(false)), defaultRouteReportedConfiguration(false));
assertThat(reportedConfigurationList.containsAll(expectedReportedConfigurations), is(true));
assertThat(reportedConfigurationList.size(), is(expectedReportedConfigurations.size()));
}
use of org.ovirt.engine.core.common.businessentities.network.ReportedConfiguration in project ovirt-engine by oVirt.
the class ItemInfoPopup method filterSyncProperties.
/**
* will filter out all sync properties
* @param networkModel must be managed
*/
private List<ReportedConfiguration> filterSyncProperties(LogicalNetworkModel networkModel) {
ReportedConfigurations reportedConfigurations = networkModel.getReportedConfigurations();
List<ReportedConfiguration> reportedConfigurationList = reportedConfigurations.getReportedConfigurationList();
return Linq.where(reportedConfigurationList, reportedConfiguration -> !reportedConfiguration.isInSync());
}
Aggregations