We generally add methods to the fake as they are needed by the implementation. You should probably add the needed methods and return fake values.
Vish On Jun 27, 2012, at 7:17 AM, Leander Bessa Beernaert wrote: > I've been looking at the implementation of the tests and i the fake_libvirt > is a bit incomplete and lacks a lot of methods. This lack of methods causes > my diagnostics code to fail the test since an error is produced. > > For instance this is the output from dir(virDomain) from the fake_libvirt: > > ['UUIDString', 'XMLDesc', '__class__', '__delattr__', '__dict__', '__doc__', > '__format__', '__getattribute__', '__hash__', '__init__', '__module__', > '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', > '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_connection', > '_def', '_has_saved_state', '_parse_definition', '_snapshots', '_state', > '_transient', 'attachDevice', 'blockStats', 'create', 'createWithFlags', > 'destroy', 'detachDevice', 'hasManagedSaveImage', 'info', 'interfaceStats', > 'isActive', 'managedSave', 'managedSaveRemove', 'name', 'reset', 'resume', > 'shutdown', 'snapshotCreateXML', 'suspend', 'undefine'] > > and below from the real libvirt: > > ['ID', 'OSType', 'UUID', 'UUIDString', 'XMLDesc', '__del__', '__doc__', > '__init__', '__module__', '_conn', '_o', 'abortJob', 'attachDevice', > 'attachDeviceFlags', 'autostart', 'blkioParameters', 'blockInfo', > 'blockIoTune', 'blockJobAbort', 'blockJobInfo', 'blockJobSetSpeed', > 'blockPeek', 'blockPull', 'blockResize', 'blockStats', 'blockStatsFlags', > 'connect', 'controlInfo', 'coreDump', 'create', 'createWithFlags', 'destroy', > 'destroyFlags', 'detachDevice', 'detachDeviceFlags', 'hasCurrentSnapshot', > 'hasManagedSaveImage', 'info', 'injectNMI', 'interfaceStats', 'isActive', > 'isPersistent', 'isUpdated', 'jobInfo', 'managedSave', 'managedSaveRemove', > 'maxMemory', 'maxVcpus', 'memoryParameters', 'memoryPeek', 'memoryStats', > 'migrate', 'migrate2', 'migrateGetMaxSpeed', 'migrateSetMaxDowntime', > 'migrateSetMaxSpeed', 'migrateToURI', 'migrateToURI2', 'name', 'openConsole', > 'openGraphics', 'pinVcpu', 'pinVcpuFlags', 'reboot', 'reset', 'resume', > 'revertToSnapshot', 'save', 'saveFlags', 'schedulerParameters', > 'schedulerParametersFlags', 'schedulerType', 'screenshot', 'sendKey', > 'setAutostart', 'setBlkioParameters', 'setBlockIoTune', 'setMaxMemory', > 'setMemory', 'setMemoryFlags', 'setMemoryParameters', > 'setSchedulerParameters', 'setSchedulerParametersFlags', 'setVcpus', > 'setVcpusFlags', 'shutdown', 'snapshotCreateXML', 'snapshotCurrent', > 'snapshotListNames', 'snapshotLookupByName', 'snapshotNum', 'state', > 'suspend', 'undefine', 'undefineFlags', 'updateDeviceFlags', 'vcpuPinInfo', > 'vcpus', 'vcpusFlags'] > > How do I proceed now? Should i ate the required methods to the fake_libvirt? > Do note that i dont have the latest libvirt installed and am therefore > missing another set of crucial methods which i can't test. :s > > On Mon, Jun 25, 2012 at 4:43 PM, Leander Bessa Beernaert > <[email protected]> wrote: > I've implemented a diagnostics method for libvirt. The code works perfectly > with the devstack installation. However, when i run the test from > "run_tests.sh" this happens: http://paste.openstack.org/show/18754/. >From > what i've been told from the irc channel, the data supplied by the test is > different than the one i'm currently receiving. Now, i'm unsure which data > type i should except from the get_diagnostics method. > > > On Mon, Jun 25, 2012 at 4:01 PM, Sean Dague <[email protected]> wrote: > On 06/25/2012 10:41 AM, Leander Bessa Beernaert wrote: > Hello, > > I'm working on the diagnostics method for libvirt. I've > successfully managed to test it while running it manually and with > devstack. However, the test case in test_virt_drivers.py fails since it > supplies a different data type to the method. > > Could it be possible that there's a certain mismatch between the two or > that this particular method accepts multiple sorts of data-types? > > Can you be more specific with the issue? I've been in that code recently, so > I might be able to help sort this out. > > -Sean > > -- > Sean Dague > IBM Linux Technology Center > email: [email protected] > alt-email: [email protected] > > > > > _______________________________________________ > Mailing list: https://launchpad.net/~openstack > Post to : [email protected] > Unsubscribe : https://launchpad.net/~openstack > More help : https://help.launchpad.net/ListHelp > > > _______________________________________________ > Mailing list: https://launchpad.net/~openstack > Post to : [email protected] > Unsubscribe : https://launchpad.net/~openstack > More help : https://help.launchpad.net/ListHelp
_______________________________________________ Mailing list: https://launchpad.net/~openstack Post to : [email protected] Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp

