DaanHoogland commented on a change in pull request #2983: KVM live storage
migration intra cluster from NFS source and destination
URL: https://github.com/apache/cloudstack/pull/2983#discussion_r229193941
##########
File path:
plugins/hypervisors/kvm/src/test/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtMigrateCommandWrapperTest.java
##########
@@ -325,4 +442,27 @@ public void testMigrationUriException() {
LibvirtMigrateCommandWrapper lw = new LibvirtMigrateCommandWrapper();
lw.createMigrationURI(null, new LibvirtComputingResource());
}
+
+ @Test
+ public void testReplaceStorageXmlDiskNotManagedStorage() throws
ParserConfigurationException, TransformerException, SAXException, IOException {
+ final LibvirtMigrateCommandWrapper lw = new
LibvirtMigrateCommandWrapper();
+ String destDisk1FileName = "XXXXXXXXXXXXXX";
+ String destDisk2FileName = "YYYYYYYYYYYYYY";
+ String destDisk1Path = String.format("/mnt/%s/%s", destPoolUuid,
destDisk1FileName);
+ MigrateCommand.MigrateDiskInfo migrateDisk1Info = new
MigrateCommand.MigrateDiskInfo(disk1SourceFilename,
+ MigrateCommand.MigrateDiskInfo.DiskType.FILE,
MigrateCommand.MigrateDiskInfo.DriverType.QCOW2,
+ MigrateCommand.MigrateDiskInfo.Source.FILE, destDisk1Path);
+ String destDisk2Path = String.format("/mnt/%s/%s", destPoolUuid,
destDisk2FileName);
+ MigrateCommand.MigrateDiskInfo migrateDisk2Info = new
MigrateCommand.MigrateDiskInfo(disk2SourceFilename,
+ MigrateCommand.MigrateDiskInfo.DiskType.FILE,
MigrateCommand.MigrateDiskInfo.DriverType.QCOW2,
+ MigrateCommand.MigrateDiskInfo.Source.FILE, destDisk2Path);
+ Map<String, MigrateCommand.MigrateDiskInfo> migrateStorage = new
HashMap<>();
+ migrateStorage.put(disk1SourceFilename, migrateDisk1Info);
+ migrateStorage.put(disk2SourceFilename, migrateDisk2Info);
+ String newXml = lw.replaceStorage(sourceMultidiskDomainXml,
migrateStorage, false);
+ assertTrue(newXml.contains(destDisk1Path));
Review comment:
rather not check for the exact path? (like the assertFalse checks below)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services