nova/db/* almost only tested indirectly
Bug #828631 reported by
Soren Hansen
This bug affects 3 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Invalid
|
Low
|
Unassigned |
Bug Description
On the surface, it looks like nova/db/* has reasonably good test coverage, but almost all the code exercised is from other parts of the code that consumes the db api.
It would be great to have direct unit tests for all the stuff in here.
Example:
The method to pull an instance_ref out of the database gets exercised a lot, because other parts of Nova end up calling it when they're being tested. Instead, we should have a test that e.g.:
* creates an instance
* reads the instance back
* deletes it
* tries to read it back as an average user (which should raise an exception)
* tries to read it back as an adming (which should work, but the instance should have ['deleted'] = True)
replaced by blueprint: https:/ /blueprints. launchpad. net/nova/ +spec/db- api-tests