Search in sources :

Example 1 with PoolType

use of com.cloud.hypervisor.kvm.resource.LibvirtStoragePoolDef.PoolType in project cloudstack by apache.

the class LibvirtStoragePoolDefTest method testRbdStoragePool.

public void testRbdStoragePool() {
    PoolType type = PoolType.RBD;
    String name = "myRBDPool";
    String uuid = "921ef8b2-955a-4c18-a697-66bb9adf6131";
    String host = "127.0.0.1";
    String dir = "cloudstackrbdpool";
    String authUsername = "admin";
    String secretUuid = "08c2fa02-50d0-4a78-8903-b742d3f34934";
    AuthenticationType auth = AuthenticationType.CEPH;
    int port = 6789;
    LibvirtStoragePoolDef pool = new LibvirtStoragePoolDef(type, name, uuid, host, port, dir, authUsername, auth, secretUuid);
    String expectedXml = "<pool type='" + type.toString() + "'>\n<name>" + name + "</name>\n<uuid>" + uuid + "</uuid>\n" + "<source>\n<host name='" + host + "' port='" + port + "'/>\n<name>" + dir + "</name>\n" + "<auth username='" + authUsername + "' type='" + auth.toString() + "'>\n<secret uuid='" + secretUuid + "'/>\n" + "</auth>\n</source>\n</pool>\n";
    assertEquals(expectedXml, pool.toString());
}
Also used : PoolType(com.cloud.hypervisor.kvm.resource.LibvirtStoragePoolDef.PoolType) AuthenticationType(com.cloud.hypervisor.kvm.resource.LibvirtStoragePoolDef.AuthenticationType)

Example 2 with PoolType

use of com.cloud.hypervisor.kvm.resource.LibvirtStoragePoolDef.PoolType in project cloudstack by apache.

the class LibvirtStoragePoolDefTest method testNfsStoragePool.

public void testNfsStoragePool() {
    PoolType type = PoolType.NETFS;
    String name = "myNFSPool";
    String uuid = "89a605bc-d470-4637-b3df-27388be452f5";
    String host = "127.0.0.1";
    String dir = "/export/primary";
    String targetPath = "/mnt/" + uuid;
    LibvirtStoragePoolDef pool = new LibvirtStoragePoolDef(type, name, uuid, host, dir, targetPath);
    String expectedXml = "<pool type='" + type.toString() + "'>\n<name>" + name + "</name>\n<uuid>" + uuid + "</uuid>\n" + "<source>\n<host name='" + host + "'/>\n<dir path='" + dir + "'/>\n</source>\n<target>\n" + "<path>" + targetPath + "</path>\n</target>\n</pool>\n";
    assertEquals(expectedXml, pool.toString());
}
Also used : PoolType(com.cloud.hypervisor.kvm.resource.LibvirtStoragePoolDef.PoolType)

Example 3 with PoolType

use of com.cloud.hypervisor.kvm.resource.LibvirtStoragePoolDef.PoolType in project cloudstack by apache.

the class LibvirtStoragePoolDefTest method testSetGetStoragePool.

public void testSetGetStoragePool() {
    PoolType type = PoolType.NETFS;
    String name = "myNFSPool";
    String uuid = "d7846cb0-f610-4a5b-8d38-ee6e8d63f37b";
    String host = "127.0.0.1";
    String dir = "/export/primary";
    String targetPath = "/mnt/" + uuid;
    int port = 1234;
    LibvirtStoragePoolDef pool = new LibvirtStoragePoolDef(type, name, uuid, host, port, dir, targetPath);
    assertEquals(type, pool.getPoolType());
    assertEquals(name, pool.getPoolName());
    assertEquals(host, pool.getSourceHost());
    assertEquals(port, pool.getSourcePort());
    assertEquals(dir, pool.getSourceDir());
    assertEquals(targetPath, pool.getTargetPath());
}
Also used : PoolType(com.cloud.hypervisor.kvm.resource.LibvirtStoragePoolDef.PoolType)

Example 4 with PoolType

use of com.cloud.hypervisor.kvm.resource.LibvirtStoragePoolDef.PoolType in project cosmic by MissionCriticalCloud.

the class LibvirtStoragePoolDefTest method testSetGetStoragePool.

public void testSetGetStoragePool() {
    final PoolType type = PoolType.NETFS;
    final String name = "myNFSPool";
    final String uuid = "d7846cb0-f610-4a5b-8d38-ee6e8d63f37b";
    final String host = "127.0.0.1";
    final String dir = "/export/primary";
    final String targetPath = "/mnt/" + uuid;
    final int port = 1234;
    final LibvirtStoragePoolDef pool = new LibvirtStoragePoolDef(type, name, uuid, host, port, dir, targetPath);
    assertEquals(type, pool.getPoolType());
    assertEquals(name, pool.getPoolName());
    assertEquals(host, pool.getSourceHost());
    assertEquals(port, pool.getSourcePort());
    assertEquals(dir, pool.getSourceDir());
    assertEquals(targetPath, pool.getTargetPath());
}
Also used : PoolType(com.cloud.hypervisor.kvm.resource.LibvirtStoragePoolDef.PoolType)

Example 5 with PoolType

use of com.cloud.hypervisor.kvm.resource.LibvirtStoragePoolDef.PoolType in project cosmic by MissionCriticalCloud.

the class LibvirtStoragePoolDefTest method testNfsStoragePool.

public void testNfsStoragePool() {
    final PoolType type = PoolType.NETFS;
    final String name = "myNFSPool";
    final String uuid = "89a605bc-d470-4637-b3df-27388be452f5";
    final String host = "127.0.0.1";
    final String dir = "/export/primary";
    final String targetPath = "/mnt/" + uuid;
    final LibvirtStoragePoolDef pool = new LibvirtStoragePoolDef(type, name, uuid, host, dir, targetPath);
    final String expectedXml = "<pool type='" + type.toString() + "'>\n<name>" + name + "</name>\n<uuid>" + uuid + "</uuid>\n" + "<source>\n<host name='" + host + "'/>\n<dir path='" + dir + "'/>\n</source>\n<target>\n" + "<path>" + targetPath + "</path>\n</target>\n</pool>\n";
    assertEquals(expectedXml, pool.toString());
}
Also used : PoolType(com.cloud.hypervisor.kvm.resource.LibvirtStoragePoolDef.PoolType)

Aggregations

PoolType (com.cloud.hypervisor.kvm.resource.LibvirtStoragePoolDef.PoolType)7 AuthenticationType (com.cloud.hypervisor.kvm.resource.LibvirtStoragePoolDef.AuthenticationType)3