[openstack-dev] [nova] Tempest whitebox tests in nova

Adalberto Medeiros adalbas at linux.vnet.ibm.com
Mon Sep 16 13:33:14 UTC 2013


Hello!

I'm looking at where would be the most appropriate place to have the 
tempest whitebox tests in nova unit tests. At first look, the 
nova/tests/db/test_db_api.py seems to be an appropriate place. As 
previously in tempest, I can work directly with the db and change states 
accordingly. However, the logic to allow certain actions depending on 
instance states seems not to be covered at this level.

For example, one of the logic tested is try to delete an instance in 
vm_state = 'resized' and task_state='resize_prep' . This should raise an 
Exception, but that does not happen considering only the db level. It 
would require to import manager methods in this case.

On the other hand, having the whitebox tests on the manager test level, 
we have most of db methods stubbed or use of fakes, so it wouldn't 
really be doing what are expected in terms of whitebox.

I think one option is to import the manager in the db level to apply the 
needed logic, but I'm looking for more advice from the nova team and to 
understand if my assumptions are correct so far.

More information about the whitebox tests for servers in tempest (from 
the patch that removes those tests): 
https://review.openstack.org/#/c/46116/3/tempest/whitebox/test_servers_whitebox.py

The nova db tests: 
https://github.com/openstack/nova/blob/master/nova/tests/db/test_db_api.py

Regards,

-- 
Adalberto Medeiros
Linux Technology Center
Openstack and Cloud Development
IBM Brazil
Email: adalbas at linux.vnet.ibm.com




More information about the OpenStack-dev mailing list