assertEquals(expectedXml, pool.toString());
}
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";
authType auth = authType.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());