Package com.cloud.hypervisor.kvm.resource.LibvirtSecretDef

Examples of com.cloud.hypervisor.kvm.resource.LibvirtSecretDef.usage


public class LibvirtSecretDefTest extends TestCase {

    public void testVolumeSecretDef() {
        String uuid = "db66f42b-a79e-4666-9910-9dfc8a024427";
        String name = "myEncryptedQCOW2";
        usage use = usage.VOLUME;

        LibvirtSecretDef def = new LibvirtSecretDef(use, uuid);
        def.setVolumeVolume(name);

        String expectedXml = "<secret ephemeral='no' private='no'>\n<uuid>" + uuid + "</uuid>\n" +
                             "<usage type='" + use.toString() + "'>\n<volume>" + name + "</volume>\n</usage>\n</secret>\n";

        assertEquals(expectedXml, def.toString());
    }
View Full Code Here


    }

    public void testCephSecretDef() {
        String uuid = "a9febe83-ac5c-467a-bf19-eb75325ec23c";
        String name = "admin";
        usage use = usage.CEPH;

        LibvirtSecretDef def = new LibvirtSecretDef(use, uuid);
        def.setCephName(name);

        String expectedXml = "<secret ephemeral='no' private='no'>\n<uuid>" + uuid + "</uuid>\n" +
                             "<usage type='" + use.toString() + "'>\n<name>" + name + "</name>\n</usage>\n</secret>\n";

        assertEquals(expectedXml, def.toString());
    }
View Full Code Here

TOP

Related Classes of com.cloud.hypervisor.kvm.resource.LibvirtSecretDef.usage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.