In unit tests, test setup() method not called for subdirectory tests

Bug #803021 reported by Lorin Hochstein
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Vish Ishaya

Bug Description

For tests that are in subdirectories of the tests directory, it appears that the setup() method in nova/tests/__init__.py does not get called.

A simple way to replicate this bug is to remove the clean.sqlite file and then run a test in a subdirectory:

$ rm clean.sqlite
$/run_tests.sh api.test_wsgi

Test
    test_debug ERROR
    test_router ERROR

======================================================================
ERROR: test_debug (api.test_wsgi.Test)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/lorin/nova/trunk/nova/test.py", line 74, in setUp
    os.path.join(FLAGS.state_path, FLAGS.sqlite_db))
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/shutil.py", line 52, in copyfile
    fsrc = open(src, 'rb')
IOError: [Errno 2] No such file or directory: '/Users/lorin/nova/trunk/nova/../clean.sqlite'

======================================================================
ERROR: test_router (api.test_wsgi.Test)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/lorin/nova/trunk/nova/test.py", line 74, in setUp
    os.path.join(FLAGS.state_path, FLAGS.sqlite_db))
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/shutil.py", line 52, in copyfile
    fsrc = open(src, 'rb')
IOError: [Errno 2] No such file or directory: '/Users/lorin/nova/trunk/nova/../clean.sqlite'

----------------------------------------------------------------------

Related branches

Thierry Carrez (ttx)
Changed in nova:
importance: Undecided → Low
status: New → Confirmed
Changed in nova:
assignee: nobody → Vish Ishaya (vishvananda)
Changed in nova:
status: Confirmed → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → diablo-3
Thierry Carrez (ttx)
Changed in nova:
milestone: diablo-3 → 2011.3
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.