use of com.cloud.hypervisor.kvm.resource.LibvirtSecretDef.Usage in project cloudstack by apache.
the class LibvirtSecretDefTest method testVolumeSecretDef.
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());
}
use of com.cloud.hypervisor.kvm.resource.LibvirtSecretDef.Usage in project cloudstack by apache.
the class LibvirtSecretDefTest method testCephSecretDef.
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());
}
use of com.cloud.hypervisor.kvm.resource.LibvirtSecretDef.Usage in project cosmic by MissionCriticalCloud.
the class LibvirtSecretDefTest method testCephSecretDef.
public void testCephSecretDef() {
final String uuid = "a9febe83-ac5c-467a-bf19-eb75325ec23c";
final String name = "admin";
final Usage use = Usage.CEPH;
final LibvirtSecretDef def = new LibvirtSecretDef(use, uuid);
def.setCephName(name);
final 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());
}
use of com.cloud.hypervisor.kvm.resource.LibvirtSecretDef.Usage in project cosmic by MissionCriticalCloud.
the class LibvirtSecretDefTest method testVolumeSecretDef.
public void testVolumeSecretDef() {
final String uuid = "db66f42b-a79e-4666-9910-9dfc8a024427";
final String name = "myEncryptedQCOW2";
final Usage use = Usage.VOLUME;
final LibvirtSecretDef def = new LibvirtSecretDef(use, uuid);
def.setVolumeVolume(name);
final 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());
}
Aggregations