cinderlib/cinderlib
Gorka Eguileor a123ff5f82 Fix DBMS storage plugin
In previous patches (I469b4b9dd9966be8477f3cefbd6284bdaf17ca17 and
I4981ad558195895341c91fa37803713c8c0ab684) we assumed that unit tests
were failing because they needed to be updated, but that's only half of
the issue.  The other half is that the DBMS plugin needs to be updated
as well.

This misunderstanding lead to a broken DBMS system that unit tests don't
detect.

This patch fixes the DBMS system and reverts changes to unit tests that
those 2 patches introduced and are not necessary as well as removed the
FIXME comments that are now fixed.

Here's a brief description of why some of the issues were happening:

- Locked database issues were happening when a unit test from
  TestBasePersistence run before a DBMS unit test. It was caused by the
  replacement of the main_context_manager when it had not been used.  No
  longer a problem since we no longer replace it and we only replace its
  transaction factory when it has been used.

- "ValueError: Backend named fake_backend already exists with a
  different configuration" error was caused because in TestDBPersistence
  the tearDown method only called the parent's tearDown after the
  cleanup of the DB, so if the cleanup of the DB failed then the global
  existing backend would remain and a following test would have trouble
  with it.  Calling it first now to fix this.

- Splitting the running of unit tests in tox.ini was necessary because
  methods in Cinder DB API were always using the context manager
  transaction factory from the first DBMS Test Case class.  So some DBMS
  plugin methods would end up writing data to the previous database
  while others would write to the new database.  Now that we replace the
  transaction factory everything is going to the same DB.

Change-Id: I74ce945291697bc1fcc63a35d60ef71494fdaf19
2023-01-19 17:31:13 +01:00
..
bin Fix privsep issues inside virtual env 2022-06-24 15:26:48 +02:00
cmd Remove six 2022-12-14 05:40:11 +00:00
persistence Fix DBMS storage plugin 2023-01-19 17:31:13 +01:00
tests Fix DBMS storage plugin 2023-01-19 17:31:13 +01:00
__init__.py Remove six 2022-12-14 05:40:11 +00:00
_fake_packages.py Stop to use the __future__ module. 2020-06-02 20:08:16 +02:00
cinderlib.py Support driver's setup method 2022-12-14 11:50:44 +00:00
exception.py Remove unused exception 2019-02-04 17:06:58 +01:00
objects.py Remove six 2022-12-14 05:40:11 +00:00
serialization.py Remove six 2022-12-14 05:40:11 +00:00
utils.py Fix Volume snapshots and connections on deletion 2019-03-13 15:04:50 +01:00