use of org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig in project ovirt-engine by oVirt.
the class HostNicVfsConfigDaoTest method testGetWithInvalidId.
/**
* Ensures that a null hostNicVfsConfig is returned.
*/
@Test
public void testGetWithInvalidId() {
HostNicVfsConfig result = dao.get(Guid.Empty);
assertNull(result);
}
use of org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig in project ovirt-engine by oVirt.
the class HostNicVfsConfigDaoTest method testAddNetwork.
@Test
public void testAddNetwork() {
HostNicVfsConfig vfsConfig = dao.get(FixturesTool.HOST_NIC_VFS_CONFIG_NOT_ALL_NETWORKS_ALLOWED_2);
checkNetworks(vfsConfig, 1);
dao.addNetwork(FixturesTool.HOST_NIC_VFS_CONFIG_NOT_ALL_NETWORKS_ALLOWED_2, FixturesTool.NETWORK_ENGINE_2);
vfsConfig = dao.get(FixturesTool.HOST_NIC_VFS_CONFIG_NOT_ALL_NETWORKS_ALLOWED_2);
checkNetworks(vfsConfig, 2);
}
use of org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig in project ovirt-engine by oVirt.
the class HostNicVfsConfigDaoTest method testAddLabel.
@Test
public void testAddLabel() {
HostNicVfsConfig vfsConfig = dao.get(FixturesTool.HOST_NIC_VFS_CONFIG_NOT_ALL_NETWORKS_ALLOWED_2);
checkLabels(vfsConfig, 3);
String label = "newLbl";
dao.addLabel(FixturesTool.HOST_NIC_VFS_CONFIG_NOT_ALL_NETWORKS_ALLOWED_2, label);
vfsConfig = dao.get(FixturesTool.HOST_NIC_VFS_CONFIG_NOT_ALL_NETWORKS_ALLOWED_2);
checkLabels(vfsConfig, 4);
}
use of org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig in project ovirt-engine by oVirt.
the class BackendVirtualFunctionAllowedNetworksResource method loadVfAllowedNetworks.
private Set<Guid> loadVfAllowedNetworks() {
final BackendHostNicsResource hostNicsResource = getParent();
final HostNicVfsConfig vfsConfig = hostNicsResource.findVfsConfig(nicId);
if (vfsConfig == null) {
return Collections.emptySet();
}
final Set<Guid> networkIds = vfsConfig.getNetworks();
return networkIds;
}
use of org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig in project ovirt-engine by oVirt.
the class BackendVirtualFunctionAllowedLabelsResource method getHostNicLabels.
@Override
protected List<NetworkLabel> getHostNicLabels(Guid hostNicId) {
final BackendHostNicsResource hostNicsResource = inject(new BackendHostNicsResource(hostId));
final HostNicVfsConfig vfsConfig = hostNicsResource.findVfsConfig(hostNicId);
if (vfsConfig == null) {
return Collections.emptyList();
}
final Set<String> networkLabelIds = vfsConfig.getNetworkLabels();
return networkLabelIds.stream().map(NetworkLabel::new).collect(toList());
}
Aggregations