Skip to content

Commit

Permalink
Update reset_db to call setup if _DB is None.
Browse files Browse the repository at this point in the history
This resolves issues when running individual tests that require
a database. With this fix I can once again run individual test
modules that make use of the database. For example:

  ./run_tests.sh test_libvirt

Previously this would fail with database errors.

Fixes LP Bug #1032738.

Change-Id: Icce7ac9414f0e19eece44819a217634947de7f73
  • Loading branch information
dprince committed Aug 3, 2012
1 parent 87dcb13 commit 3356d55
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nova/tests/__init__.py
Expand Up @@ -61,6 +61,8 @@ def reset_db():
conn = engine.connect()
if _DB:
conn.connection.executescript(_DB)
else:
setup()
else:
shutil.copyfile(os.path.join(FLAGS.state_path, FLAGS.sqlite_clean_db),
os.path.join(FLAGS.state_path, FLAGS.sqlite_db))
Expand Down

0 comments on commit 3356d55

Please sign in to comment.