use of org.ovirt.engine.api.model.Action in project ovirt-engine by oVirt.
the class BackendHostResourceTest method testApproveChangingCluster.
@Test
public void testApproveChangingCluster() throws Exception {
setUpGetEntityExpectations(4);
setUriInfo(setUpActionExpectations(ActionType.ChangeVDSCluster, ChangeVDSClusterParameters.class, new String[] { "ClusterId", "VdsId" }, new Object[] { GUIDS[0], GUIDS[0] }, true, true, new ActionReturnValue(), false));
setUriInfo(setUpActionExpectations(ActionType.UpdateVds, UpdateVdsActionParameters.class, new String[] {}, new Object[] {}, true, true));
setUriInfo(setUpActionExpectations(ActionType.ApproveVds, ApproveVdsParameters.class, new String[] { "VdsId" }, new Object[] { GUIDS[0] }));
org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster();
cluster.setId(GUIDS[0].toString());
Action action = new Action();
action.setCluster(cluster);
verifyActionResponse(resource.approve(action));
}
use of org.ovirt.engine.api.model.Action in project ovirt-engine by oVirt.
the class BackendHostResourceTest method testUpgrade.
@Test
public void testUpgrade() throws Exception {
setUriInfo(setUpActionExpectations(ActionType.UpgradeHost, UpgradeHostParameters.class, new String[] { "VdsId", "oVirtIsoFile" }, new Object[] { GUIDS[0], NAMES[0] }));
Action action = new Action();
action.setImage(NAMES[0]);
verifyActionResponse(resource.upgrade(action));
}
use of org.ovirt.engine.api.model.Action in project ovirt-engine by oVirt.
the class BackendHostResourceTest method testInstall.
@Test
public void testInstall() throws Exception {
setUpGetEntityWithNoCertificateInfoExpectations();
setUriInfo(setUpActionExpectations(ActionType.UpdateVds, UpdateVdsActionParameters.class, new String[] { "RootPassword" }, new Object[] { NAMES[2] }));
Action action = new Action();
action.setRootPassword(NAMES[2]);
verifyActionResponse(resource.install(action));
}
use of org.ovirt.engine.api.model.Action in project ovirt-engine by oVirt.
the class BackendHostResourceTest method testIscsiLogin.
@Test
public void testIscsiLogin() throws Exception {
setUriInfo(setUpActionExpectations(ActionType.ConnectStorageToVds, StorageServerConnectionParametersBase.class, new String[] { "VdsId", "StorageServerConnection.Connection", "StorageServerConnection.Portal", "StorageServerConnection.Iqn", "StorageServerConnection.Port", "StorageServerConnection.StorageType", "StorageServerConnection.UserName", "StorageServerConnection.Password" }, new Object[] { GUIDS[0], ISCSI_SERVER_ADDRESS, // TODO: right now hard-coded, but this should change when VDSM and Backend support portal
StorageServerConnections.DEFAULT_TPGT, ISCSI_IQN, ISCSI_PORT_STRING, ISCSI_STORAGE_TYPE, ISCSI_USER_NAME, ISCSI_USER_PASS }));
Action action = new Action();
IscsiDetails iscsiDetails = new IscsiDetails();
iscsiDetails.setAddress(ISCSI_SERVER_ADDRESS);
iscsiDetails.setPort(ISCSI_PORT_INT);
iscsiDetails.setTarget(ISCSI_IQN);
iscsiDetails.setUsername(ISCSI_USER_NAME);
iscsiDetails.setPassword(ISCSI_USER_PASS);
action.setIscsi(iscsiDetails);
verifyActionResponse(resource.iscsiLogin(action));
}
use of org.ovirt.engine.api.model.Action in project ovirt-engine by oVirt.
the class BackendHostResourceTest method doTestActivateAsync.
private void doTestActivateAsync(AsyncTaskStatusEnum asyncStatus, CreationStatus actionStatus) throws Exception {
setUriInfo(setUpActionExpectations(ActionType.ActivateVds, VdsActionParameters.class, new String[] { "VdsId" }, new Object[] { GUIDS[0] }, asList(GUIDS[1]), asList(new AsyncTaskStatus(asyncStatus))));
Response response = resource.activate(new Action());
verifyActionResponse(response, "hosts/" + GUIDS[0], true, null);
Action action = (Action) response.getEntity();
assertTrue(action.isSetStatus());
assertEquals(actionStatus.value(), action.getStatus());
}
Aggregations