use of com.cloud.hypervisor.ovm3.objects.Ovm3ResourceException in project cloudstack by apache.
the class StoragePluginTest method testStorageFileCreationFileExistS.
@Test(expected = Ovm3ResourceException.class)
public void testStorageFileCreationFileExistS() throws Ovm3ResourceException {
con.setResult(results.errorResponseWrap("exceptions OSError:[Errno.17] File exists " + FILE));
FileProperties file = sPt.storagePluginCreate(FSMNTUUID, NFSHOST, FILE, SIZE, false);
file.getSize();
}
use of com.cloud.hypervisor.ovm3.objects.Ovm3ResourceException in project cloudstack by apache.
the class Ovm3HypervisorResourceTest method createOtherVmTest.
@Test
public void createOtherVmTest() throws ConfigurationException, Ovm3ResourceException {
VirtualMachineTO vmspec = createVm(vmName);
vmspec.setOs("bogus");
hypervisor = vmActionPreparation();
StartCommand cmd = new StartCommand(vmspec, getHost(hypervisor.getName()), true);
Answer ra = hypervisor.executeRequest(cmd);
results.basicBooleanTest(ra.getResult());
}
use of com.cloud.hypervisor.ovm3.objects.Ovm3ResourceException in project cloudstack by apache.
the class Ovm3VmSupport method execute.
/*
*/
public GetVncPortAnswer execute(GetVncPortCommand cmd) {
try {
Xen host = new Xen(c);
Xen.Vm vm = host.getRunningVmConfig(cmd.getName());
Integer vncPort = vm.getVncPort();
LOGGER.debug("get vnc port for " + cmd.getName() + ": " + vncPort);
return new GetVncPortAnswer(cmd, c.getIp(), vncPort);
} catch (Ovm3ResourceException e) {
LOGGER.debug("get vnc port for " + cmd.getName() + " failed", e);
return new GetVncPortAnswer(cmd, e.getMessage());
}
}
use of com.cloud.hypervisor.ovm3.objects.Ovm3ResourceException in project cloudstack by apache.
the class CloudStackPluginTest method testDomrExec.
@Test
public void testDomrExec() throws Ovm3ResourceException {
con.setResult(domrExecXml);
ReturnCode x = cSp.domrExec(domrIp, "ls");
assertNotNull(x);
assertEquals(x.getExit(), (Integer) 0);
assertEquals(x.getRc(), true);
assertEquals(x.getExit(), (Integer) 0);
assertNotNull(x.getStdOut());
/* failed */
domrExecXml = domrExecXml.replace("<i8>0</i8>", "<i8>1</i8>");
domrExecXml = domrExecXml.replace("<value><string></string></value>", "<value><string>Something went wrong!</string></value>");
con.setResult(domrExecXml);
ReturnCode y = cSp.domrExec(domrIp, "ls");
assertNotNull(y);
assertEquals(y.getRc(), false);
assertEquals(y.getExit(), (Integer) 1);
assertNotNull(x.getStdErr());
}
use of com.cloud.hypervisor.ovm3.objects.Ovm3ResourceException in project cloudstack by apache.
the class StoragePluginTest method testStorageFileInfo.
@Test
public void testStorageFileInfo() throws Ovm3ResourceException {
con.setResult(results.simpleResponseWrapWrapper(FILECREATEXML));
FileProperties file = sPt.storagePluginGetFileInfo(FSMNTUUID, NFSHOST, FILE);
file.getName();
file.getUuid();
file.getType();
file.getSize();
}
Aggregations