Search in sources :

Example 1 with AuthenticationType

use of com.cloud.agent.resource.kvm.xml.LibvirtStoragePoolDef.AuthenticationType in project cosmic by MissionCriticalCloud.

the class LibvirtStoragePoolDefTest method testRbdStoragePool.

public void testRbdStoragePool() {
    final PoolType type = PoolType.RBD;
    final String name = "myRBDPool";
    final String uuid = "921ef8b2-955a-4c18-a697-66bb9adf6131";
    final String host = "127.0.0.1";
    final String dir = "cloudstackrbdpool";
    final String authUsername = "admin";
    final String secretUuid = "08c2fa02-50d0-4a78-8903-b742d3f34934";
    final AuthenticationType auth = AuthenticationType.CEPH;
    final int port = 6789;
    final LibvirtStoragePoolDef pool = new LibvirtStoragePoolDef(type, name, uuid, host, port, dir, authUsername, auth, secretUuid);
    final 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.agent.resource.kvm.xml.LibvirtStoragePoolDef.PoolType) LibvirtStoragePoolDef(com.cloud.agent.resource.kvm.xml.LibvirtStoragePoolDef) AuthenticationType(com.cloud.agent.resource.kvm.xml.LibvirtStoragePoolDef.AuthenticationType)

Aggregations

LibvirtStoragePoolDef (com.cloud.agent.resource.kvm.xml.LibvirtStoragePoolDef)1 AuthenticationType (com.cloud.agent.resource.kvm.xml.LibvirtStoragePoolDef.AuthenticationType)1 PoolType (com.cloud.agent.resource.kvm.xml.LibvirtStoragePoolDef.PoolType)1