test_libvirt shouldn't mock import_class/import_object
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Medium
|
Dan Prince |
Bug Description
I'm getting some libvirt test failures when using nova trunk:
[dan.prince@
CacheConcurrenc
test_
test_
IptablesFirewal
test_
test_
test_
test_
test_
test_
test_
LibvirtConnTestCase
test_
test_
ERROR
test_
test_
test_
test_
test_multi_nic OK 0.08
test_
test_
test_snapshot OK 0.01
test_
test_
test_
test_
test_
test_
test_
test_
test_
test_
NWFilterTestCase
test_
test_
test_
test_
=======
ERROR: test_ensure_
-------
Traceback (most recent call last):
File "/home/
network_info = _fake_network_
File "/home/
network = network_
File "/home/
self.
File "/home/
nova.
File "/home/
return ImageService()
File "/usr/lib/
% (' '.join(
AttributeError: No values given for arguments: import_str
=======
ERROR: test_ensure_
-------
Traceback (most recent call last):
File "/home/
self.
File "/usr/lib/
mock_
File "/usr/lib/
raise ExpectedMethodC
ExpectedMethodC
0. import_
1. import_
=======
FAIL: test_spawn_
-------
Traceback (most recent call last):
File "/home/
network_info = _fake_network_
File "/home/
network = network_
File "/home/
self.driver = utils.import_
File "/usr/lib/
return mock_method(
File "/usr/lib/
expected_method = self._VerifyMet
File "/usr/lib/
expected = self._PopNextMe
File "/usr/lib/
raise UnexpectedMetho
UnexpectedMetho
-------
Ran 33 tests in 5.130s
FAILED (errors=2, failures=1)
Slowest 5 tests took 1.90 secs:
0.40 test_live_
0.39 test_xml_
0.39 test_creates_
0.37 test_static_filters (nova.tests.
0.36 test_unfilter_
---
The failures seem to stem from the fact that we are mocking out import_class and import_object. Using flags and fakes seems like a saner way to implement things in test_libvirt...
Related branches
- Brian Lamar (community): Approve
- Sandy Walsh (community): Approve
- Devin Carlen (community): Approve
-
Diff: 164 lines (+63/-55)2 files modifiednova/tests/fake_network.py (+30/-0)
nova/tests/test_libvirt.py (+33/-55)
Changed in nova: | |
status: | New → In Progress |
assignee: | nobody → Dan Prince (dan-prince) |
importance: | Undecided → Medium |
Changed in nova: | |
status: | In Progress → Fix Committed |
Changed in nova: | |
milestone: | none → essex-1 |
Changed in nova: | |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | essex-1 → 2012.1 |
> The failures seem to stem from the fact that we are mocking out
> import_class and import_object. Using flags and fakes seems like a saner
> way to implement things in test_libvirt...
I have a branch awaiting review that does exactly this nova/virt- test-improvemen ts). It has a fakelibvirt
(~soren/
implementation that has an API identical to libvirt's, but doesn't
actually do anything apart from bookkeeping.