![]() 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 |
||
---|---|---|
cinderlib | ||
devstack | ||
doc | ||
playbooks | ||
releasenotes | ||
roles/run-cinderlib-tests | ||
tools | ||
.gitignore | ||
.gitreview | ||
.stestr.conf | ||
.zuul.yaml | ||
CONTRIBUTING.rst | ||
DESCRIPTION.rst | ||
HACKING.rst | ||
LICENSE | ||
README.rst | ||
babel.cfg | ||
bindep.txt | ||
requirements.txt | ||
setup.cfg | ||
setup.py | ||
test-requirements.txt | ||
tox.ini |
README.rst
Cinder Library
Introduction
The Cinder Library, also known as cinderlib, is a Python library that leverages the Cinder project to provide an object oriented abstraction around Cinder's storage drivers to allow their usage directly without running any of the Cinder services or surrounding services, such as KeyStone, MySQL or RabbitMQ.
- Free software: Apache Software License 2.0
- Documentation: https://docs.openstack.org/cinderlib/latest/
The library is intended for developers who only need the basic CRUD functionality of the drivers and don't care for all the additional features Cinder provides such as quotas, replication, multi-tenancy, migrations, retyping, scheduling, backups, authorization, authentication, REST API, etc.
The library was originally created as an external project, so it didn't have the broad range of backend testing Cinder does, and only a limited number of drivers were validated at the time. Drivers should work out of the box, and we'll keep a list of drivers that have added the cinderlib functional tests to the driver gates confirming they work and ensuring they will keep working.
Features
- Use a Cinder driver without running a DBMS, Message broker, or Cinder service.
- Using multiple simultaneous drivers on the same application.
- Basic operations support:
- Create volume
- Delete volume
- Extend volume
- Clone volume
- Create snapshot
- Delete snapshot
- Create volume from snapshot
- Connect volume
- Disconnect volume
- Local attach
- Local detach
- Validate connector
- Extra Specs for specific backend functionality.
- Backend QoS
- Multi-pool support
- Metadata persistence plugins:
- Stateless: Caller stores JSON serialization.
- Database: Metadata is stored in a database: MySQL, PostgreSQL, SQLite...
- Custom plugin: Caller provides module to store Metadata and cinderlib calls it when necessary.
Demo
![](https://asciinema.org/a/TcTR7Lu7jI0pEsd9ThEn01l7n.png)