use of org.ovirt.engine.core.common.businessentities.storage.LUNs in project ovirt-engine by oVirt.
the class SyncLunsInfoForBlockStorageDomainCommandTest method setUp.
@Before
public void setUp() {
doReturn(hostValidator).when(command).getHostValidator();
lunFromVg = new LUNs();
lunFromDb = new LUNs();
}
use of org.ovirt.engine.core.common.businessentities.storage.LUNs in project ovirt-engine by oVirt.
the class SyncLunsInfoForBlockStorageDomainCommandTest method testGetLunsToRemoveFromDb.
@Test
public void testGetLunsToRemoveFromDb() {
lunFromVg.setLUNId(Guid.newGuid().toString());
lunFromDb.setLUNId(Guid.newGuid().toString());
LUNs dummyLun = new LUNs();
dummyLun.setId(BusinessEntitiesDefinitions.DUMMY_LUN_ID_PREFIX + Guid.newGuid().toString());
List<LUNs> lunsFromVgInfo = Collections.singletonList(lunFromVg);
List<LUNs> lunsFromDb = Arrays.asList(lunFromDb, dummyLun);
assertEquals(command.getLunsToRemoveFromDb(lunsFromVgInfo, lunsFromDb), Collections.singletonList(lunFromDb));
}
use of org.ovirt.engine.core.common.businessentities.storage.LUNs in project ovirt-engine by oVirt.
the class SyncLunsInfoForBlockStorageDomainCommandTest method testGetLunsToUpdateInDbDiffLunIdDiffPvId.
@Test
public void testGetLunsToUpdateInDbDiffLunIdDiffPvId() {
Guid lunFromVgLunId = Guid.newGuid();
Map<LunHandler, List<LUNs>> lunsToUpdateInDb = getLunsToUpdateInDb(lunFromVgLunId, Guid.newGuid(), Guid.newGuid(), Guid.newGuid());
List<LUNs> newLunsToSaveInDb = lunsToUpdateInDb.get(command.saveLunsHandler);
assertEquals(Stream.of(command.saveLunsHandler, command.removeLunsHandler).collect(Collectors.toSet()), lunsToUpdateInDb.keySet());
assertLunIdInList(newLunsToSaveInDb, lunFromVgLunId);
}
use of org.ovirt.engine.core.common.businessentities.storage.LUNs in project ovirt-engine by oVirt.
the class SyncLunsInfoForBlockStorageDomainCommandTest method testGetLunsToUpdateInDbDiffLunIdSamePvId.
@Test
public void testGetLunsToUpdateInDbDiffLunIdSamePvId() {
Guid pvID = Guid.newGuid();
Guid lunFromVgLunId = Guid.newGuid();
Map<LunHandler, List<LUNs>> lunsToUpdateInDb = getLunsToUpdateInDb(lunFromVgLunId, Guid.newGuid(), pvID, pvID);
List<LUNs> newLunsToSaveInDb = lunsToUpdateInDb.get(command.saveLunsHandler);
assertEquals(Stream.of(command.saveLunsHandler, command.removeLunsHandler).collect(Collectors.toSet()), lunsToUpdateInDb.keySet());
assertLunIdInList(newLunsToSaveInDb, lunFromVgLunId);
}
use of org.ovirt.engine.core.common.businessentities.storage.LUNs in project ovirt-engine by oVirt.
the class AddExistingBlockStorageDomainCommandTest method getLUNs.
private static List<LUNs> getLUNs() {
LUNs lun = new LUNs();
lun.setId(Guid.newGuid().toString());
return Collections.singletonList(lun);
}
Aggregations