cinder/cinder/tests/unit/backup
xing-yang 763dd8cdc5 Fix backup using temp snapshot code path
- Non-disruptive backup using a temp snapshot works in Liberty
but was broken in Mitaka.
- Backup a snapshot directly without creating a temp volume
worked when the feature was first added in Mitaka but was broken
later in Mitaka.

This patch provides a fix as follows:
1. It checks an existing config option backup_use_same_host.
   By default, this option is False.
2. When the backup service starts, it checks the above option. If
   the option is True, the backup service will find volume manager
   on the current node and get volume backends.
3. If the option is True and backup_use_temp_snapshot returns True,
   volume service returns the snapshot to the backup service in
   get_backup_device and backup will be performed using the snapshot.
   Otherwise, the volume will be returned as the backup device and
   the backup will be performed using the volume.

This fix is a Mitaka backport candidate. After this is merged,
we will provide a more complete fix which allows backup using
temp snapshot to happen on a remote node as well and we will
also clean up the code to get volume backends on the backup node.

The unit test test_backup_volume_inuse_temp_snapshot in test_volume.py
is removed. This test was testing backup_volume in
cinder/volume/driver.py, but this code path is not used any more.
Backup now starts in create_backup in backup/manager.py which calls
_run_backup which calls _attach_snapshot in volume/driver.py. The new
test test_create_backup_with_temp_snapshot in test_backup.py tests
the new code path.

Change-Id: I2e0c115e1dacf9eea73803cdbb1452bfeb56d87c
Closes-Bug: #1578034
Closes-Bug: #1575886
2016-05-17 18:15:53 -04:00
..
drivers Move all backups related unit tests to backup directory 2016-05-26 17:09:33 +03:00
__init__.py Move unit tests into dedicated directory 2015-04-21 18:40:40 -06:00
fake_backup.py Move all backups related unit tests to backup directory 2016-05-26 17:09:33 +03:00
fake_google_client.py Use googleapiclient import instead of apiclient 2016-03-11 12:19:01 +01:00
fake_google_client2.py Add cinder backup driver for Google Cloud Storage 2016-01-18 23:28:23 +05:30
fake_service.py Remove oslo logging from backup unit tests 2015-06-27 21:23:34 +00:00
fake_service_with_verify.py Remove oslo logging from backup unit tests 2015-06-27 21:23:34 +00:00
fake_swift_client.py Remove oslo logging from backup unit tests 2015-06-27 21:23:34 +00:00
fake_swift_client2.py Switch to the oslo_utils.fileutils 2015-08-20 07:47:48 +00:00
test_backup.py Fix backup using temp snapshot code path 2016-05-17 18:15:53 -04:00
test_rpcapi.py Move all backups related unit tests to backup directory 2016-05-26 17:09:33 +03:00