mirror of https://github.com/apache/jclouds.git
added lifecycle methods to cloudstack
This commit is contained in:
parent
56f1d7266a
commit
634a33fe5f
|
@ -80,8 +80,62 @@ public interface VirtualMachineAsyncClient {
|
||||||
@Unwrap
|
@Unwrap
|
||||||
@Consumes(MediaType.APPLICATION_JSON)
|
@Consumes(MediaType.APPLICATION_JSON)
|
||||||
ListenableFuture<AsyncCreateResponse> deployVirtualMachine(@QueryParam("serviceofferingid") long serviceOfferingId,
|
ListenableFuture<AsyncCreateResponse> deployVirtualMachine(@QueryParam("serviceofferingid") long serviceOfferingId,
|
||||||
@QueryParam("templateid") long templateId, @QueryParam("zoneid") long zoneId,
|
@QueryParam("templateid") long templateId, @QueryParam("zoneid") long zoneId,
|
||||||
DeployVirtualMachineOptions... options);
|
DeployVirtualMachineOptions... options);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see VirtualMachineClient#rebootVirtualMachine
|
||||||
|
*/
|
||||||
|
@GET
|
||||||
|
@QueryParams(keys = "command", values = "rebootVirtualMachine")
|
||||||
|
@Unwrap(depth = 2)
|
||||||
|
@Consumes(MediaType.APPLICATION_JSON)
|
||||||
|
ListenableFuture<Long> rebootVirtualMachine(@QueryParam("id") long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see VirtualMachineClient#startVirtualMachine
|
||||||
|
*/
|
||||||
|
@GET
|
||||||
|
@QueryParams(keys = "command", values = "startVirtualMachine")
|
||||||
|
@Unwrap(depth = 2)
|
||||||
|
@Consumes(MediaType.APPLICATION_JSON)
|
||||||
|
ListenableFuture<Long> startVirtualMachine(@QueryParam("id") long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see VirtualMachineClient#stopVirtualMachine
|
||||||
|
*/
|
||||||
|
@GET
|
||||||
|
@QueryParams(keys = "command", values = "stopVirtualMachine")
|
||||||
|
@Unwrap(depth = 2)
|
||||||
|
@Consumes(MediaType.APPLICATION_JSON)
|
||||||
|
ListenableFuture<Long> stopVirtualMachine(@QueryParam("id") long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see VirtualMachineClient#resetPasswordForVirtualMachine
|
||||||
|
*/
|
||||||
|
@GET
|
||||||
|
@QueryParams(keys = "command", values = "resetPasswordForVirtualMachine")
|
||||||
|
@Unwrap(depth = 2)
|
||||||
|
@Consumes(MediaType.APPLICATION_JSON)
|
||||||
|
ListenableFuture<Long> resetPasswordForVirtualMachine(@QueryParam("id") long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see VirtualMachineClient#changeServiceForVirtualMachine
|
||||||
|
*/
|
||||||
|
@GET
|
||||||
|
@QueryParams(keys = "command", values = "changeServiceForVirtualMachine")
|
||||||
|
@Unwrap(depth = 2)
|
||||||
|
@Consumes(MediaType.APPLICATION_JSON)
|
||||||
|
ListenableFuture<Long> changeServiceForVirtualMachine(@QueryParam("id") long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see VirtualMachineClient#updateVirtualMachine
|
||||||
|
*/
|
||||||
|
@GET
|
||||||
|
@QueryParams(keys = "command", values = "updateVirtualMachine")
|
||||||
|
@Unwrap(depth = 2)
|
||||||
|
@Consumes(MediaType.APPLICATION_JSON)
|
||||||
|
ListenableFuture<Long> updateVirtualMachine(@QueryParam("id") long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see VirtualMachineClient#destroyVirtualMachine
|
* @see VirtualMachineClient#destroyVirtualMachine
|
||||||
|
|
|
@ -69,7 +69,63 @@ public interface VirtualMachineClient {
|
||||||
* @return virtual machine
|
* @return virtual machine
|
||||||
*/
|
*/
|
||||||
AsyncCreateResponse deployVirtualMachine(long serviceOfferingId, long templateId, long zoneId,
|
AsyncCreateResponse deployVirtualMachine(long serviceOfferingId, long templateId, long zoneId,
|
||||||
DeployVirtualMachineOptions... options);
|
DeployVirtualMachineOptions... options);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reboots a virtual machine.
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* The ID of the virtual machine
|
||||||
|
* @return job id related to destroying the VM
|
||||||
|
*/
|
||||||
|
Long rebootVirtualMachine(long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Starts a virtual machine.
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* The ID of the virtual machine
|
||||||
|
* @return job id related to destroying the VM
|
||||||
|
*/
|
||||||
|
Long startVirtualMachine(long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stops a virtual machine.
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* The ID of the virtual machine
|
||||||
|
* @return job id related to destroying the VM
|
||||||
|
*/
|
||||||
|
Long stopVirtualMachine(long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resets the password for virtual machine. The virtual machine must be in a "Stopped" state and
|
||||||
|
* the template must already support this feature for this command to take effect.
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* The ID of the virtual machine
|
||||||
|
* @return job id related to destroying the VM
|
||||||
|
*/
|
||||||
|
Long resetPasswordForVirtualMachine(long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Changes the service offering for a virtual machine. The virtual machine must be in a "Stopped"
|
||||||
|
* state for this command to take effect.
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* The ID of the virtual machine
|
||||||
|
* @return job id related to destroying the VM
|
||||||
|
*/
|
||||||
|
Long changeServiceForVirtualMachine(long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates parameters of a virtual machine.
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* The ID of the virtual machine
|
||||||
|
* @return job id related to destroying the VM
|
||||||
|
*/
|
||||||
|
Long updateVirtualMachine(long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destroys a virtual machine. Once destroyed, only the administrator can recover it.
|
* Destroys a virtual machine. Once destroyed, only the administrator can recover it.
|
||||||
|
|
|
@ -46,11 +46,11 @@ import com.google.inject.TypeLiteral;
|
||||||
public class VirtualMachineAsyncClientTest extends BaseCloudStackAsyncClientTest<VirtualMachineAsyncClient> {
|
public class VirtualMachineAsyncClientTest extends BaseCloudStackAsyncClientTest<VirtualMachineAsyncClient> {
|
||||||
public void testListVirtualMachines() throws SecurityException, NoSuchMethodException, IOException {
|
public void testListVirtualMachines() throws SecurityException, NoSuchMethodException, IOException {
|
||||||
Method method = VirtualMachineAsyncClient.class.getMethod("listVirtualMachines",
|
Method method = VirtualMachineAsyncClient.class.getMethod("listVirtualMachines",
|
||||||
ListVirtualMachinesOptions[].class);
|
ListVirtualMachinesOptions[].class);
|
||||||
HttpRequest httpRequest = processor.createRequest(method);
|
HttpRequest httpRequest = processor.createRequest(method);
|
||||||
|
|
||||||
assertRequestLineEquals(httpRequest,
|
assertRequestLineEquals(httpRequest,
|
||||||
"GET http://localhost:8080/client/api?response=json&command=listVirtualMachines HTTP/1.1");
|
"GET http://localhost:8080/client/api?response=json&command=listVirtualMachines HTTP/1.1");
|
||||||
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
|
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
|
||||||
assertPayloadEquals(httpRequest, null, null, false);
|
assertPayloadEquals(httpRequest, null, null, false);
|
||||||
|
|
||||||
|
@ -64,13 +64,13 @@ public class VirtualMachineAsyncClientTest extends BaseCloudStackAsyncClientTest
|
||||||
|
|
||||||
public void testListVirtualMachinesOptions() throws SecurityException, NoSuchMethodException, IOException {
|
public void testListVirtualMachinesOptions() throws SecurityException, NoSuchMethodException, IOException {
|
||||||
Method method = VirtualMachineAsyncClient.class.getMethod("listVirtualMachines",
|
Method method = VirtualMachineAsyncClient.class.getMethod("listVirtualMachines",
|
||||||
ListVirtualMachinesOptions[].class);
|
ListVirtualMachinesOptions[].class);
|
||||||
HttpRequest httpRequest = processor.createRequest(method,
|
HttpRequest httpRequest = processor.createRequest(method, ListVirtualMachinesOptions.Builder.accountInDomain(
|
||||||
ListVirtualMachinesOptions.Builder.accountInDomain("adrian", 6).usesVirtualNetwork(true));
|
"adrian", 6).usesVirtualNetwork(true));
|
||||||
|
|
||||||
assertRequestLineEquals(
|
assertRequestLineEquals(
|
||||||
httpRequest,
|
httpRequest,
|
||||||
"GET http://localhost:8080/client/api?response=json&command=listVirtualMachines&account=adrian&domainid=6&forvirtualnetwork=true HTTP/1.1");
|
"GET http://localhost:8080/client/api?response=json&command=listVirtualMachines&account=adrian&domainid=6&forvirtualnetwork=true HTTP/1.1");
|
||||||
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
|
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
|
||||||
assertPayloadEquals(httpRequest, null, null, false);
|
assertPayloadEquals(httpRequest, null, null, false);
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ public class VirtualMachineAsyncClientTest extends BaseCloudStackAsyncClientTest
|
||||||
HttpRequest httpRequest = processor.createRequest(method, 5);
|
HttpRequest httpRequest = processor.createRequest(method, 5);
|
||||||
|
|
||||||
assertRequestLineEquals(httpRequest,
|
assertRequestLineEquals(httpRequest,
|
||||||
"GET http://localhost:8080/client/api?response=json&command=listVirtualMachines&id=5 HTTP/1.1");
|
"GET http://localhost:8080/client/api?response=json&command=listVirtualMachines&id=5 HTTP/1.1");
|
||||||
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
|
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
|
||||||
assertPayloadEquals(httpRequest, null, null, false);
|
assertPayloadEquals(httpRequest, null, null, false);
|
||||||
|
|
||||||
|
@ -101,12 +101,12 @@ public class VirtualMachineAsyncClientTest extends BaseCloudStackAsyncClientTest
|
||||||
|
|
||||||
public void testDeployVirtualMachine() throws SecurityException, NoSuchMethodException, IOException {
|
public void testDeployVirtualMachine() throws SecurityException, NoSuchMethodException, IOException {
|
||||||
Method method = VirtualMachineAsyncClient.class.getMethod("deployVirtualMachine", long.class, long.class,
|
Method method = VirtualMachineAsyncClient.class.getMethod("deployVirtualMachine", long.class, long.class,
|
||||||
long.class, DeployVirtualMachineOptions[].class);
|
long.class, DeployVirtualMachineOptions[].class);
|
||||||
HttpRequest httpRequest = processor.createRequest(method, 4, 5, 6);
|
HttpRequest httpRequest = processor.createRequest(method, 4, 5, 6);
|
||||||
|
|
||||||
assertRequestLineEquals(
|
assertRequestLineEquals(
|
||||||
httpRequest,
|
httpRequest,
|
||||||
"GET http://localhost:8080/client/api?response=json&command=deployVirtualMachine&serviceofferingid=4&zoneid=6&templateid=5 HTTP/1.1");
|
"GET http://localhost:8080/client/api?response=json&command=deployVirtualMachine&serviceofferingid=4&zoneid=6&templateid=5 HTTP/1.1");
|
||||||
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
|
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
|
||||||
assertPayloadEquals(httpRequest, null, null, false);
|
assertPayloadEquals(httpRequest, null, null, false);
|
||||||
|
|
||||||
|
@ -118,12 +118,114 @@ public class VirtualMachineAsyncClientTest extends BaseCloudStackAsyncClientTest
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testRebootVirtualMachine() throws SecurityException, NoSuchMethodException, IOException {
|
||||||
|
Method method = VirtualMachineAsyncClient.class.getMethod("rebootVirtualMachine", long.class);
|
||||||
|
HttpRequest httpRequest = processor.createRequest(method, 5);
|
||||||
|
|
||||||
|
assertRequestLineEquals(httpRequest,
|
||||||
|
"GET http://localhost:8080/client/api?response=json&command=rebootVirtualMachine&id=5 HTTP/1.1");
|
||||||
|
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
|
||||||
|
assertPayloadEquals(httpRequest, null, null, false);
|
||||||
|
|
||||||
|
assertResponseParserClassEquals(method, httpRequest, UnwrapOnlyNestedJsonValue.class);
|
||||||
|
assertSaxResponseParserClassEquals(method, null);
|
||||||
|
assertExceptionParserClassEquals(method, MapHttp4xxCodesToExceptions.class);
|
||||||
|
|
||||||
|
checkFilters(httpRequest);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testStartVirtualMachine() throws SecurityException, NoSuchMethodException, IOException {
|
||||||
|
Method method = VirtualMachineAsyncClient.class.getMethod("startVirtualMachine", long.class);
|
||||||
|
HttpRequest httpRequest = processor.createRequest(method, 5);
|
||||||
|
|
||||||
|
assertRequestLineEquals(httpRequest,
|
||||||
|
"GET http://localhost:8080/client/api?response=json&command=startVirtualMachine&id=5 HTTP/1.1");
|
||||||
|
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
|
||||||
|
assertPayloadEquals(httpRequest, null, null, false);
|
||||||
|
|
||||||
|
assertResponseParserClassEquals(method, httpRequest, UnwrapOnlyNestedJsonValue.class);
|
||||||
|
assertSaxResponseParserClassEquals(method, null);
|
||||||
|
assertExceptionParserClassEquals(method, MapHttp4xxCodesToExceptions.class);
|
||||||
|
|
||||||
|
checkFilters(httpRequest);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testStopVirtualMachine() throws SecurityException, NoSuchMethodException, IOException {
|
||||||
|
Method method = VirtualMachineAsyncClient.class.getMethod("stopVirtualMachine", long.class);
|
||||||
|
HttpRequest httpRequest = processor.createRequest(method, 5);
|
||||||
|
|
||||||
|
assertRequestLineEquals(httpRequest,
|
||||||
|
"GET http://localhost:8080/client/api?response=json&command=stopVirtualMachine&id=5 HTTP/1.1");
|
||||||
|
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
|
||||||
|
assertPayloadEquals(httpRequest, null, null, false);
|
||||||
|
|
||||||
|
assertResponseParserClassEquals(method, httpRequest, UnwrapOnlyNestedJsonValue.class);
|
||||||
|
assertSaxResponseParserClassEquals(method, null);
|
||||||
|
assertExceptionParserClassEquals(method, MapHttp4xxCodesToExceptions.class);
|
||||||
|
|
||||||
|
checkFilters(httpRequest);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testResetPasswordForVirtualMachine() throws SecurityException, NoSuchMethodException, IOException {
|
||||||
|
Method method = VirtualMachineAsyncClient.class.getMethod("resetPasswordForVirtualMachine", long.class);
|
||||||
|
HttpRequest httpRequest = processor.createRequest(method, 5);
|
||||||
|
|
||||||
|
assertRequestLineEquals(httpRequest,
|
||||||
|
"GET http://localhost:8080/client/api?response=json&command=resetPasswordForVirtualMachine&id=5 HTTP/1.1");
|
||||||
|
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
|
||||||
|
assertPayloadEquals(httpRequest, null, null, false);
|
||||||
|
|
||||||
|
assertResponseParserClassEquals(method, httpRequest, UnwrapOnlyNestedJsonValue.class);
|
||||||
|
assertSaxResponseParserClassEquals(method, null);
|
||||||
|
assertExceptionParserClassEquals(method, MapHttp4xxCodesToExceptions.class);
|
||||||
|
|
||||||
|
checkFilters(httpRequest);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testChangeServiceForVirtualMachine() throws SecurityException, NoSuchMethodException, IOException {
|
||||||
|
Method method = VirtualMachineAsyncClient.class.getMethod("changeServiceForVirtualMachine", long.class);
|
||||||
|
HttpRequest httpRequest = processor.createRequest(method, 5);
|
||||||
|
|
||||||
|
assertRequestLineEquals(httpRequest,
|
||||||
|
"GET http://localhost:8080/client/api?response=json&command=changeServiceForVirtualMachine&id=5 HTTP/1.1");
|
||||||
|
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
|
||||||
|
assertPayloadEquals(httpRequest, null, null, false);
|
||||||
|
|
||||||
|
assertResponseParserClassEquals(method, httpRequest, UnwrapOnlyNestedJsonValue.class);
|
||||||
|
assertSaxResponseParserClassEquals(method, null);
|
||||||
|
assertExceptionParserClassEquals(method, MapHttp4xxCodesToExceptions.class);
|
||||||
|
|
||||||
|
checkFilters(httpRequest);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testUpdateVirtualMachine() throws SecurityException, NoSuchMethodException, IOException {
|
||||||
|
Method method = VirtualMachineAsyncClient.class.getMethod("updateVirtualMachine", long.class);
|
||||||
|
HttpRequest httpRequest = processor.createRequest(method, 5);
|
||||||
|
|
||||||
|
assertRequestLineEquals(httpRequest,
|
||||||
|
"GET http://localhost:8080/client/api?response=json&command=updateVirtualMachine&id=5 HTTP/1.1");
|
||||||
|
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
|
||||||
|
assertPayloadEquals(httpRequest, null, null, false);
|
||||||
|
|
||||||
|
assertResponseParserClassEquals(method, httpRequest, UnwrapOnlyNestedJsonValue.class);
|
||||||
|
assertSaxResponseParserClassEquals(method, null);
|
||||||
|
assertExceptionParserClassEquals(method, MapHttp4xxCodesToExceptions.class);
|
||||||
|
|
||||||
|
checkFilters(httpRequest);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public void testDestroyVirtualMachine() throws SecurityException, NoSuchMethodException, IOException {
|
public void testDestroyVirtualMachine() throws SecurityException, NoSuchMethodException, IOException {
|
||||||
Method method = VirtualMachineAsyncClient.class.getMethod("destroyVirtualMachine", long.class);
|
Method method = VirtualMachineAsyncClient.class.getMethod("destroyVirtualMachine", long.class);
|
||||||
HttpRequest httpRequest = processor.createRequest(method, 5);
|
HttpRequest httpRequest = processor.createRequest(method, 5);
|
||||||
|
|
||||||
assertRequestLineEquals(httpRequest,
|
assertRequestLineEquals(httpRequest,
|
||||||
"GET http://localhost:8080/client/api?response=json&command=destroyVirtualMachine&id=5 HTTP/1.1");
|
"GET http://localhost:8080/client/api?response=json&command=destroyVirtualMachine&id=5 HTTP/1.1");
|
||||||
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
|
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
|
||||||
assertPayloadEquals(httpRequest, null, null, false);
|
assertPayloadEquals(httpRequest, null, null, false);
|
||||||
|
|
||||||
|
|
|
@ -45,6 +45,7 @@ import org.testng.annotations.AfterGroups;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
import com.google.common.base.Predicate;
|
import com.google.common.base.Predicate;
|
||||||
|
import static com.google.common.base.Predicates.*;
|
||||||
import com.google.common.collect.ComparisonChain;
|
import com.google.common.collect.ComparisonChain;
|
||||||
import com.google.common.collect.Ordering;
|
import com.google.common.collect.Ordering;
|
||||||
|
|
||||||
|
@ -74,7 +75,8 @@ public class VirtualMachineClientLiveTest extends BaseCloudStackClientLiveTest {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Template arg0) {
|
public boolean apply(Template arg0) {
|
||||||
return arg0.getZoneId() == zone.getId() && arg0.isFeatured() && arg0.isReady();
|
return arg0.getZoneId() == zone.getId() && arg0.isFeatured() && arg0.isReady()
|
||||||
|
&& arg0.getOSType().equals("Ubuntu 10.04 (64-bit)");
|
||||||
}
|
}
|
||||||
|
|
||||||
}).getId();
|
}).getId();
|
||||||
|
@ -115,12 +117,35 @@ public class VirtualMachineClientLiveTest extends BaseCloudStackClientLiveTest {
|
||||||
return vm;
|
return vm;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testCreateDestroyVirtualMachine() throws Exception {
|
public void testCreateVirtualMachine() throws Exception {
|
||||||
vm = createVirtualMachine(client, jobComplete, virtualMachineRunning);
|
vm = createVirtualMachine(client, jobComplete, virtualMachineRunning);
|
||||||
assertEquals(vm.getRootDeviceType(), "NetworkFilesystem");
|
assert or(equalTo("NetworkFilesystem"), equalTo("IscsiLUN")).apply(vm.getRootDeviceType()) : vm;
|
||||||
checkVm(vm);
|
checkVm(vm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test(dependsOnMethods = "testCreateVirtualMachine")
|
||||||
|
public void testLifeCycle() throws Exception {
|
||||||
|
Long job = client.getVirtualMachineClient().stopVirtualMachine(vm.getId());
|
||||||
|
assert jobComplete.apply(job);
|
||||||
|
vm = client.getVirtualMachineClient().getVirtualMachine(vm.getId());
|
||||||
|
assertEquals(vm.getState(), VirtualMachine.State.STOPPED);
|
||||||
|
|
||||||
|
job = client.getVirtualMachineClient().resetPasswordForVirtualMachine(vm.getId());
|
||||||
|
assert jobComplete.apply(job);
|
||||||
|
vm = client.getVirtualMachineClient().getVirtualMachine(vm.getId());
|
||||||
|
// TODO: check if error or not base on isPasswordEnabled
|
||||||
|
|
||||||
|
job = client.getVirtualMachineClient().startVirtualMachine(vm.getId());
|
||||||
|
assert jobComplete.apply(job);
|
||||||
|
vm = client.getVirtualMachineClient().getVirtualMachine(vm.getId());
|
||||||
|
assertEquals(vm.getState(), VirtualMachine.State.RUNNING);
|
||||||
|
|
||||||
|
job = client.getVirtualMachineClient().rebootVirtualMachine(vm.getId());
|
||||||
|
assert jobComplete.apply(job);
|
||||||
|
vm = client.getVirtualMachineClient().getVirtualMachine(vm.getId());
|
||||||
|
assertEquals(vm.getState(), VirtualMachine.State.RUNNING);
|
||||||
|
}
|
||||||
|
|
||||||
@AfterGroups(groups = "live")
|
@AfterGroups(groups = "live")
|
||||||
protected void tearDown() {
|
protected void tearDown() {
|
||||||
if (vm != null) {
|
if (vm != null) {
|
||||||
|
|
Loading…
Reference in New Issue