Search in sources :

Example 6 with ReportedConfigurations

use of org.ovirt.engine.core.common.businessentities.network.ReportedConfigurations 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()));
}
Also used : ReportedConfigurations(org.ovirt.engine.core.common.businessentities.network.ReportedConfigurations) ReportedConfiguration(org.ovirt.engine.core.common.businessentities.network.ReportedConfiguration) Test(org.junit.Test)

Example 7 with ReportedConfigurations

use of org.ovirt.engine.core.common.businessentities.network.ReportedConfigurations 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()));
}
Also used : ReportedConfigurations(org.ovirt.engine.core.common.businessentities.network.ReportedConfigurations) ReportedConfiguration(org.ovirt.engine.core.common.businessentities.network.ReportedConfiguration) Test(org.junit.Test)

Example 8 with ReportedConfigurations

use of org.ovirt.engine.core.common.businessentities.network.ReportedConfigurations 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());
}
Also used : ReportedConfigurations(org.ovirt.engine.core.common.businessentities.network.ReportedConfigurations) ReportedConfiguration(org.ovirt.engine.core.common.businessentities.network.ReportedConfiguration)

Aggregations

ReportedConfigurations (org.ovirt.engine.core.common.businessentities.network.ReportedConfigurations)8 ReportedConfiguration (org.ovirt.engine.core.common.businessentities.network.ReportedConfiguration)6 Test (org.junit.Test)5 IPv4Address (org.ovirt.engine.core.common.businessentities.network.IPv4Address)2 Network (org.ovirt.engine.core.common.businessentities.network.Network)1 VdsNetworkInterface (org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface)1 NetworkInSyncWithVdsNetworkInterface (org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterface)1