private void initIpv6ConfigurationBootProtocolGateway(Ipv6BootProtocol networkBootProtocol, boolean syncGateway) { initIpv6ConfigurationStaticBootProtocol(networkBootProtocol); ipv6Address.setGateway(IPV6_GATEWAY); iface.setIpv6Gateway(syncGateway ? IPV6_GATEWAY : null); }
entity.setIpv4Gateway(rs.getString("gateway")); entity.setIpv4DefaultRoute(rs.getBoolean("ipv4_default_route")); entity.setIpv6Gateway(rs.getString("ipv6_gateway")); entity.setIpv4Subnet(rs.getString("subnet")); entity.setIpv6Prefix(getInteger(rs, "ipv6_prefix"));
@Test public void testIsNetworkInSyncWhenIpv6GatewayBothNull() { initIpv6ConfigurationStaticBootProtocol(Ipv6BootProtocol.STATIC_IP); ipv6Address.setGateway(null); iface.setIpv6Gateway(null); assertThat(createTestedInstance().isNetworkInSync(), is(true)); }
private static void mapIpv6FromModel(HostNic model, VdsNetworkInterface entity) { if (model.isSetIpv6()) { if (model.getIpv6().isSetAddress()) { entity.setIpv6Address(model.getIpv6().getAddress()); } if (model.getIpv6().isSetGateway()) { entity.setIpv6Gateway(model.getIpv6().getGateway()); } if (model.getIpv6().isSetNetmask()) { try { final Integer ipv6Prefix = Integer.valueOf(model.getIpv6().getNetmask()); entity.setIpv6Prefix(ipv6Prefix); } catch (NumberFormatException ignore) { } } } if (model.isSetIpv6BootProtocol()) { Ipv6BootProtocol ipv6BootProtocol = Ipv6BootProtocolMapper.map(model.getIpv6BootProtocol()); if (ipv6BootProtocol != null) { entity.setIpv6BootProtocol(ipv6BootProtocol); } } }
@BeforeEach @Override public void setUp() throws Exception { super.setUp(); existingVdsInterface = dao.get(FixturesTool.VDS_NETWORK_INTERFACE); newQos = new HostNetworkQos(); newQos.setOutAverageLinkshare(30); newQos.setOutAverageUpperlimit(30); newQos.setOutAverageRealtime(30); newVdsInterface = new VdsNetworkInterface(); newVdsInterface.setStatistics(new VdsNetworkStatistics()); newVdsInterface.setId(Guid.newGuid()); newVdsInterface.setName("eth77"); newVdsInterface.setNetworkName("enginet"); newVdsInterface.setSpeed(1000); newVdsInterface.setType(3); newVdsInterface.setMacAddress("01:C0:81:21:71:17"); newVdsInterface.setIpv4BootProtocol(Ipv4BootProtocol.STATIC_IP); newVdsInterface.setIpv4Address("192.168.122.177"); newVdsInterface.setIpv4Subnet("255.255.255.0"); newVdsInterface.setIpv4Gateway("192.168.122.1"); newVdsInterface.setIpv6BootProtocol(Ipv6BootProtocol.AUTOCONF); newVdsInterface.setIpv6Address("ipv6 address"); newVdsInterface.setIpv6Prefix(666); newVdsInterface.setIpv6Gateway("ipv6 gateway"); newVdsInterface.setMtu(1500); newVdsInterface.setQos(newQos); newVdsStatistics = newVdsInterface.getStatistics(); }