Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: OpenStack: Dev

[OpenStack][Nova] Possible inconsistency between devstack/nova execution and test_virt_drivers.py

 

 

OpenStack dev RSS feed   Index | Next | Previous | View Threaded


leanderbb at gmail

Jun 25, 2012, 7:41 AM

Post #1 of 10 (142 views)
Permalink
[OpenStack][Nova] Possible inconsistency between devstack/nova execution and test_virt_drivers.py

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?

Regards,
Leander


leanderbb at gmail

Jun 25, 2012, 7:44 AM

Post #2 of 10 (125 views)
Permalink
Re: [OpenStack][Nova] Possible inconsistency between devstack/nova execution and test_virt_drivers.py [In reply to]

Sorry, forgot to add the code:

*This is my method (this worked with devstack):*
def get_diagnostics(self, instance):
dom = self._lookup_by_name(instance['name'])
return diagnostics.get_diagnostics(dom)


*and this the test method*:

def test_get_diagnostics(self):
instance_ref, network_info = self._get_running_instance()
self.connection.get_diagnostics(instance_ref['name'])

On Mon, Jun 25, 2012 at 3:41 PM, Leander Bessa Beernaert <
leanderbb [at] gmail> 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?
>
> Regards,
> Leander
>


sdague at linux

Jun 25, 2012, 8:01 AM

Post #3 of 10 (129 views)
Permalink
Re: [OpenStack][Nova] Possible inconsistency between devstack/nova execution and test_virt_drivers.py [In reply to]

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: sdague [at] linux
alt-email: sldague [at] us



_______________________________________________
Mailing list: https://launchpad.net/~openstack
Post to : openstack [at] lists
Unsubscribe : https://launchpad.net/~openstack
More help : https://help.launchpad.net/ListHelp


jaypipes at gmail

Jun 25, 2012, 8:10 AM

Post #4 of 10 (126 views)
Permalink
Re: [OpenStack][Nova] Possible inconsistency between devstack/nova execution and test_virt_drivers.py [In reply to]

You are not returning the data in the test method, whereas you are in
the real method :)

-jay

On 06/25/2012 10:44 AM, Leander Bessa Beernaert wrote:
> Sorry, forgot to add the code:
>
> *This is my method (this worked with devstack):*
> def get_diagnostics(self, instance):
> dom = self._lookup_by_name(instance['name'])
> return diagnostics.get_diagnostics(dom)
>
>
> *and this the test method*:
>
> def test_get_diagnostics(self):
> instance_ref, network_info = self._get_running_instance()
> self.connection.get_diagnostics(instance_ref['name'])
>
> On Mon, Jun 25, 2012 at 3:41 PM, Leander Bessa Beernaert
> <leanderbb [at] gmail <mailto:leanderbb [at] gmail>> 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?
>
> Regards,
> Leander
>
>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openstack
> Post to : openstack [at] lists
> Unsubscribe : https://launchpad.net/~openstack
> More help : https://help.launchpad.net/ListHelp
>


_______________________________________________
Mailing list: https://launchpad.net/~openstack
Post to : openstack [at] lists
Unsubscribe : https://launchpad.net/~openstack
More help : https://help.launchpad.net/ListHelp


leanderbb at gmail

Jun 25, 2012, 8:35 AM

Post #5 of 10 (123 views)
Permalink
Re: [OpenStack][Nova] Possible inconsistency between devstack/nova execution and test_virt_drivers.py [In reply to]

I would like to add that I did not implement the test method, it was
already there. Also it supplies a different set of data than the one i
received when working with devstack.

Which of the data types should i assume to be correct, the one from
devstack or the one from the test?

On Mon, Jun 25, 2012 at 4:10 PM, Jay Pipes <jaypipes [at] gmail> wrote:

> You are not returning the data in the test method, whereas you are in the
> real method :)
>
> -jay
>
>
> On 06/25/2012 10:44 AM, Leander Bessa Beernaert wrote:
>
>> Sorry, forgot to add the code:
>>
>> *This is my method (this worked with devstack):*
>>
>> def get_diagnostics(self, instance):
>> dom = self._lookup_by_name(instance[**'name'])
>> return diagnostics.get_diagnostics(**dom)
>>
>>
>> *and this the test method*:
>>
>>
>> def test_get_diagnostics(self):
>> instance_ref, network_info = self._get_running_instance()
>> self.connection.get_**diagnostics(instance_ref['**name'])
>>
>> On Mon, Jun 25, 2012 at 3:41 PM, Leander Bessa Beernaert
>> <leanderbb [at] gmail <mailto:leanderbb [at] gmail>> 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?
>>
>> Regards,
>> Leander
>>
>>
>>
>>
>> ______________________________**_________________
>> Mailing list: https://launchpad.net/~**openstack<https://launchpad.net/~openstack>
>> Post to : openstack [at] lists
>> Unsubscribe : https://launchpad.net/~**openstack<https://launchpad.net/~openstack>
>> More help : https://help.launchpad.net/**ListHelp<https://help.launchpad.net/ListHelp>
>>
>>
>
> ______________________________**_________________
> Mailing list: https://launchpad.net/~**openstack<https://launchpad.net/~openstack>
> Post to : openstack [at] lists
> Unsubscribe : https://launchpad.net/~**openstack<https://launchpad.net/~openstack>
> More help : https://help.launchpad.net/**ListHelp<https://help.launchpad.net/ListHelp>
>


leanderbb at gmail

Jun 25, 2012, 8:43 AM

Post #6 of 10 (119 views)
Permalink
Re: [OpenStack][Nova] Possible inconsistency between devstack/nova execution and test_virt_drivers.py [In reply to]

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 <sdague [at] linux>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: sdague [at] linux
> alt-email: sldague [at] us
>
>
>
>
> ______________________________**_________________
> Mailing list: https://launchpad.net/~**openstack<https://launchpad.net/~openstack>
> Post to : openstack [at] lists
> Unsubscribe : https://launchpad.net/~**openstack<https://launchpad.net/~openstack>
> More help : https://help.launchpad.net/**ListHelp<https://help.launchpad.net/ListHelp>
>


leanderbb at gmail

Jun 27, 2012, 7:17 AM

Post #7 of 10 (125 views)
Permalink
Re: [OpenStack][Nova] Possible inconsistency between devstack/nova execution and test_virt_drivers.py [In reply to]

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 <
leanderbb [at] gmail> 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 <sdague [at] linux>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: sdague [at] linux
>> alt-email: sldague [at] us
>>
>>
>>
>>
>> ______________________________**_________________
>> Mailing list: https://launchpad.net/~**openstack<https://launchpad.net/~openstack>
>> Post to : openstack [at] lists
>> Unsubscribe : https://launchpad.net/~**openstack<https://launchpad.net/~openstack>
>> More help : https://help.launchpad.net/**ListHelp<https://help.launchpad.net/ListHelp>
>>
>
>


jaypipes at gmail

Jun 27, 2012, 8:50 AM

Post #8 of 10 (126 views)
Permalink
Re: [OpenStack][Nova] Possible inconsistency between devstack/nova execution and test_virt_drivers.py [In reply to]

On 06/27/2012 10:17 AM, Leander Bessa Beernaert wrote:
<snip>
> 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

No. In general, you only want to put methods into the fake driver that
are *called* by the OpenStack code. If you are calling methods on the
VirDomain with your new diagnostics code, then yes, you will need to
implement corresponding fake methods in the fake driver.

All the best,
-jay

_______________________________________________
Mailing list: https://launchpad.net/~openstack
Post to : openstack [at] lists
Unsubscribe : https://launchpad.net/~openstack
More help : https://help.launchpad.net/ListHelp


vishvananda at gmail

Jun 27, 2012, 9:00 AM

Post #9 of 10 (127 views)
Permalink
Re: [OpenStack][Nova] Possible inconsistency between devstack/nova execution and test_virt_drivers.py [In reply to]

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 <leanderbb [at] gmail> 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 <sdague [at] linux> 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: sdague [at] linux
> alt-email: sldague [at] us
>
>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openstack
> Post to : openstack [at] lists
> Unsubscribe : https://launchpad.net/~openstack
> More help : https://help.launchpad.net/ListHelp
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openstack
> Post to : openstack [at] lists
> Unsubscribe : https://launchpad.net/~openstack
> More help : https://help.launchpad.net/ListHelp


leanderbb at gmail

Jun 28, 2012, 3:55 AM

Post #10 of 10 (115 views)
Permalink
Re: [OpenStack][Nova] Possible inconsistency between devstack/nova execution and test_virt_drivers.py [In reply to]

Ok. I will add the required methods to the fakelbvirt.

Regards,
Leander

On Wed, Jun 27, 2012 at 4:50 PM, Jay Pipes <jaypipes [at] gmail> wrote:

> On 06/27/2012 10:17 AM, Leander Bessa Beernaert wrote:
> <snip>
>
> 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
>>
>
> No. In general, you only want to put methods into the fake driver that are
> *called* by the OpenStack code. If you are calling methods on the VirDomain
> with your new diagnostics code, then yes, you will need to implement
> corresponding fake methods in the fake driver.
>
> All the best,
> -jay
>
>
> ______________________________**_________________
> Mailing list: https://launchpad.net/~**openstack<https://launchpad.net/~openstack>
> Post to : openstack [at] lists
> Unsubscribe : https://launchpad.net/~**openstack<https://launchpad.net/~openstack>
> More help : https://help.launchpad.net/**ListHelp<https://help.launchpad.net/ListHelp>
>

OpenStack dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.