use of org.ovirt.engine.core.common.businessentities.network.ReportedConfiguration in project ovirt-engine by oVirt.
the class NetworkInSyncWithVdsNetworkInterfaceTest method testReportConfigurationsOnHostWhenDefaultRouteDiffers.
@Test
public void testReportConfigurationsOnHostWhenDefaultRouteDiffers() {
// cannot use initIpv4ConfigurationBootProtocol because of 'randomized tests' technique.
iface.setIpv4BootProtocol(Ipv4BootProtocol.DHCP);
IPv4Address address = new IPv4Address();
address.setBootProtocol(Ipv4BootProtocol.DHCP);
testedNetworkAttachment.getIpConfiguration().setIPv4Addresses(Collections.singletonList(address));
// network has default route role
NetworkInSyncWithVdsNetworkInterface testedInstance = createTestedInstanceWithSameNonQosValues(true);
ReportedConfigurations reportedConfigurations = testedInstance.reportConfigurationsOnHost();
assertThat(reportedConfigurations.isNetworkInSync(), is(false));
List<ReportedConfiguration> reportedConfigurationList = reportedConfigurations.getReportedConfigurationList();
List<ReportedConfiguration> expectedReportedConfigurations = addReportedConfigurations(combineReportedConfigurations(createBasicReportedConfigurations(), reportQos(true)), new ReportedConfiguration(ReportedConfigurationType.IPV4_BOOT_PROTOCOL, iface.getIpv4BootProtocol().name(), /*ipv4Address*/
address.getBootProtocol().name(), true), new ReportedConfiguration(ReportedConfigurationType.DNS_CONFIGURATION, addressesAsString(sampleDnsResolverConfiguration.getNameServers()), "192.168.1.1,2001:0db8:85a3:0000:0000:8a2e:0370:7334", true), new ReportedConfiguration(ReportedConfigurationType.DEFAULT_ROUTE, false, true, 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 addSyncDiff.
/**
* @param networkModel must be managed
*/
private void addSyncDiff(LogicalNetworkModel networkModel) {
addRow(templates.imageTextSetupNetwork(notInSyncImage, templates.coloredText(constants.hostOutOfSync(), SafeStylesUtils.forTrustedColor(TEXT_COLOR))));
SafeHtml safeHtml = SafeHtmlUtils.fromTrustedString(generatePreviewSentence());
addRow(safeHtml);
List<ReportedConfiguration> panelParameters = filterSyncProperties(networkModel);
Widget networkOutOfSyncPanel = new NetworkOutOfSyncPanel(panelParameters).outOfSyncTableAsWidget();
contents.insertRow(contents.getRowCount());
contents.setWidget(contents.getRowCount(), 0, networkOutOfSyncPanel);
}
use of org.ovirt.engine.core.common.businessentities.network.ReportedConfiguration in project ovirt-engine by oVirt.
the class NetworkOutOfSyncPanel method outOfSyncTableAsWidget.
public Widget outOfSyncTableAsWidget() {
addTableFirstRow();
for (ReportedConfiguration reportedConfiguration : reportedConfigurationList) {
List<Label> values = reportedConfigurationAsList(reportedConfiguration);
TextAlign textAlign = resolveAlignment(reportedConfiguration.getType());
addOutOfSyncRow(values, textAlign);
}
return flowPanel.asWidget();
}
use of org.ovirt.engine.core.common.businessentities.network.ReportedConfiguration in project ovirt-engine by oVirt.
the class NetworkInSyncWithVdsNetworkInterfaceTest method testReportConfigurationsOnHostWhenSwitchTypeIsOutOfSync.
@Test
public void testReportConfigurationsOnHostWhenSwitchTypeIsOutOfSync() throws Exception {
cluster.setRequiredSwitchTypeForCluster(SwitchType.OVS);
ReportedConfigurations reportedConfigurations = createTestedInstance().reportConfigurationsOnHost();
assertThat(reportedConfigurations.isNetworkInSync(), is(false));
List<ReportedConfiguration> reportedConfigurationList = reportedConfigurations.getReportedConfigurationList();
ReportedConfiguration expectedReportedConfiguration = new ReportedConfiguration(ReportedConfigurationType.SWITCH_TYPE, SwitchType.LEGACY, SwitchType.OVS, false);
assertThat(reportedConfigurationList.contains(expectedReportedConfiguration), is(true));
}
use of org.ovirt.engine.core.common.businessentities.network.ReportedConfiguration in project ovirt-engine by oVirt.
the class NetworkInSyncWithVdsNetworkInterfaceTest method testReportConfigurationsOnHostWhenDnsConfigurationResolverOutOfSync.
@Test
public void testReportConfigurationsOnHostWhenDnsConfigurationResolverOutOfSync() {
iface.setIpv4DefaultRoute(true);
// cannot use initIpv4ConfigurationBootProtocol because of 'randomized tests' technique.
iface.setIpv4BootProtocol(Ipv4BootProtocol.DHCP);
IPv4Address address = new IPv4Address();
address.setBootProtocol(Ipv4BootProtocol.DHCP);
testedNetworkAttachment.getIpConfiguration().setIPv4Addresses(Collections.singletonList(address));
network.setDnsResolverConfiguration(sampleDnsResolverConfiguration2);
ReportedConfigurations reportedConfigurations = createTestedInstanceWithSameNonQosValues(true).reportConfigurationsOnHost();
assertThat(reportedConfigurations.isNetworkInSync(), is(false));
List<ReportedConfiguration> reportedConfigurationList = reportedConfigurations.getReportedConfigurationList();
List<ReportedConfiguration> expectedReportedConfigurations = addReportedConfigurations(combineReportedConfigurations(createBasicReportedConfigurations(), reportQos(true)), new ReportedConfiguration(ReportedConfigurationType.IPV4_BOOT_PROTOCOL, iface.getIpv4BootProtocol().name(), /*ipv4Address*/
address.getBootProtocol().name(), true), new ReportedConfiguration(ReportedConfigurationType.DNS_CONFIGURATION, addressesAsString(sampleDnsResolverConfiguration.getNameServers()), addressesAsString(network.getDnsResolverConfiguration().getNameServers()), false), new ReportedConfiguration(ReportedConfigurationType.DEFAULT_ROUTE, true, true, true));
assertThat(reportedConfigurationList.containsAll(expectedReportedConfigurations), is(true));
assertThat(reportedConfigurationList.size(), is(expectedReportedConfigurations.size()));
}
Aggregations