use of org.ovirt.engine.api.model.Action in project ovirt-engine by oVirt.
the class BackendStorageDomainResourceTest method reduceLuns.
@Test
public void reduceLuns() throws Exception {
List<String> paramsLuns = new LinkedList<>();
paramsLuns.add(GUIDS[2].toString());
paramsLuns.add(GUIDS[3].toString());
setUriInfo(setUpActionExpectations(ActionType.ReduceSANStorageDomainDevices, ReduceSANStorageDomainDevicesCommandParameters.class, new String[] { "DevicesToReduce", "StorageDomainId" }, new Object[] { paramsLuns, GUIDS[0] }, true, true));
Action action = new Action();
LogicalUnits luns = new LogicalUnits();
paramsLuns.forEach(s -> {
LogicalUnit lun = new LogicalUnit();
lun.setId(s);
luns.getLogicalUnits().add(lun);
});
action.setLogicalUnits(luns);
verifyActionResponse(resource.reduceLuns(action));
}
use of org.ovirt.engine.api.model.Action in project ovirt-engine by oVirt.
the class BackendHostResourceTest method testIscsiDiscover.
@Test
public void testIscsiDiscover() throws Exception {
IscsiDetails iscsiDetails = new IscsiDetails();
iscsiDetails.setAddress(ISCSI_SERVER_ADDRESS);
iscsiDetails.setPort(ISCSI_PORT_INT);
iscsiDetails.setUsername(ISCSI_USER_NAME);
iscsiDetails.setPassword(ISCSI_USER_PASS);
Action action = new Action();
action.setIscsi(iscsiDetails);
QueryReturnValue queryResult = new QueryReturnValue();
queryResult.setSucceeded(true);
when(backend.runQuery(eq(QueryType.DiscoverSendTargets), eqParams(DiscoverSendTargetsQueryParameters.class, addSession("VdsId", "Connection.Connection", "Connection.Port", "Connection.UserName", "Connection.Password"), addSession(GUIDS[0], ISCSI_SERVER_ADDRESS, ISCSI_PORT_STRING, ISCSI_USER_NAME, ISCSI_USER_PASS)))).thenReturn(queryResult);
enqueueInteraction(() -> verify(backend, atLeastOnce()).runQuery(eq(QueryType.DiscoverSendTargets), eqParams(DiscoverSendTargetsQueryParameters.class, addSession("VdsId", "Connection.Connection", "Connection.Port", "Connection.UserName", "Connection.Password"), addSession(GUIDS[0], ISCSI_SERVER_ADDRESS, ISCSI_PORT_STRING, ISCSI_USER_NAME, ISCSI_USER_PASS))));
resource.iscsiDiscover(action);
}
use of org.ovirt.engine.api.model.Action in project ovirt-engine by oVirt.
the class BackendTemplateDiskResourceTest method testIncompleteCopy.
@Test
public void testIncompleteCopy() throws Exception {
setUriInfo(setUpBasicUriExpectations());
try {
resource.copy(new Action());
fail("expected WebApplicationException on incomplete parameters");
} catch (WebApplicationException wae) {
verifyIncompleteException(wae, "Action", "copy", "storageDomain.id|name");
}
}
use of org.ovirt.engine.api.model.Action in project ovirt-engine by oVirt.
the class BackendTemplateDiskResourceTest method setUpCopyParams.
private Action setUpCopyParams(boolean byName) {
Action action = new Action();
StorageDomain sd = new StorageDomain();
if (byName) {
sd.setName(NAMES[2]);
} else {
sd.setId(GUIDS[3].toString());
}
action.setStorageDomain(sd);
return action;
}
use of org.ovirt.engine.api.model.Action in project ovirt-engine by oVirt.
the class BackendTemplateDiskResourceTest method testIncompleteExport.
@Test
public void testIncompleteExport() throws Exception {
setUriInfo(setUpBasicUriExpectations());
try {
resource.export(new Action());
fail("expected WebApplicationException on incomplete parameters");
} catch (WebApplicationException wae) {
verifyIncompleteException(wae, "Action", "export", "storageDomain.id|name");
}
}
Aggregations