> On Nov 23, 2020, at 10:13 AM, Daniel P. Berrangé <berrange@xxxxxxxxxx> wrote: > > Side-point.... > > > Looking at these patches makes me quite aware of the lack of unit > test coverage. The native <-> XML conversions are one of the places > we find most benefit from unit testing, as it catches many regrssions > we would otherwise introduce. > > Traditionally we would have 1 text file containing the hypervisor > native representation, and one containing the XML representation. > The unit tests would load the former, generate the XML and then > compare to the expected XML. > > This is potentially complicated in the hyperv driver as IIUC > there's no real config file containing the native hyperv repr. > > Is there any convenient way we can serialize the > > Msvm_ComputerSystem > Msvm_VirtualSystemSettingData > Msvm_ProcessorSettingData > Msvm_MemorySettingData > > classes to a text file format, suc that we can later load > them from a unit test ? As you suggested in the accidental off-the-mailing-list tangent that I created, I'll look into using openwsman response data for the tests, since that's effectively the "hypervisor native" format for remote access to a Hyper-V server. Project deadlines require me to keep working on implementing new functionality, so I'll have to consider how to approach unit tests at a later point. Once the base functionality (defining/undefining VMs, device attachment, basic networking, and screenshots) is complete, I'll be focusing on security. I'll make adding unit tests part of that work. -- Matt