cinder/cinder/tests/unit
Gorka Eguileor 6cfecade9e Refactor sqlalchemy service methods
This patch refactors the sqlalchemy DB methods related to the service to
consolidate the methods into the minimum number that is actually needed,
to reduce the number of DB calls per operation, and to reduce the data
retrieved from the DB server.

For method consolidation the patch removes
`service_get_by_host_and_topic`, `service_get_by_args`,
`service_get_all_by_topic`, and `service_get_all_by_binary`, and
includes the functionality provided by those methods in `service_get`
and `service_get_all` methods.

To reduce the number of DB calls we won't retrieve the service from the
DB when deleting or updating a service.

And to reduce the data retrieved from the DB we filter UP nodes in the
DB instead of locally.

This patch is related to the efforts to support HA A/A in c-vol nodes.
Job distribution patches are dependent on this one.

Specs: https://review.openstack.org/327283
Implements: blueprint cinder-volume-active-active-support
Change-Id: I5c453dcb5c38301721c3017ba8e782c0fdf850e6
2016-07-22 15:46:00 +02:00
..
api Refactor sqlalchemy service methods 2016-07-22 15:46:00 +02:00
backup Fix some typos 2016-07-19 12:30:07 +02:00
brick Replace use of mox with mock in test_brick_lvm 2016-06-29 18:41:52 +03:00
compute Bump to Nova v2.1 2016-06-03 14:25:39 +08:00
consistencygroup Tests: mock notifier in CG tests 2016-07-21 11:19:46 -06:00
db Merge "Move QualityOfServiceSpecs to use VersionedObject" 2016-07-14 22:14:17 +00:00
glance Added more options while uploading volume as image 2016-03-23 18:55:53 +00:00
image Fix image-volume cache to use volume object when evicting 2016-05-23 21:06:47 -07:00
keymgr Fix call to Barbican Secrets create() 2016-03-03 14:15:08 +00:00
message Add pagination support to messages 2016-05-27 10:49:00 +00:00
monkey_patch_example
objects Refactor sqlalchemy service methods 2016-07-22 15:46:00 +02:00
scheduler Refactor sqlalchemy service methods 2016-07-22 15:46:00 +02:00
targets Do not conjecture volume-id from iscsi_name 2016-07-08 01:36:06 -04:00
volume Merge "NetApp: Support new parameter to cDOT clone API" 2016-07-22 00:12:24 +00:00
windows Use versionedobjects in remotefs.py 2016-06-15 07:59:30 +00:00
zonemanager Use assertEqual/Less/Greater/In/IsNone 2016-07-04 17:58:16 +02:00
__init__.py Re-enabled hacking checks for H105 2016-01-05 11:22:40 +02:00
cast_as_call.py
conf_fixture.py
fake_constants.py Tests: lower case all fake uuid constants 2016-05-03 13:36:22 -04:00
fake_driver.py Merge "Update initialize_connection to use versionedobjects" 2016-07-18 10:23:18 +00:00
fake_hpe_3par_client.py 3PAR fix create_cloned_volume for larger size 2016-03-16 03:39:12 -07:00
fake_hpe_client_exceptions.py 3par driver handles concurrent host create conflict 2016-07-14 17:06:24 -07:00
fake_hpe_lefthand_client.py LeftHand: Updating minimum client version 2016-02-24 21:31:54 +00:00
fake_notifier.py
fake_objects.py Use manifest to backport OVOs during upgrades 2016-06-12 13:49:01 +02:00
fake_service.py
fake_snapshot.py Add SnapshotStatus enum field 2016-05-19 15:16:18 -05:00
fake_utils.py
fake_vmem_client.py Violin Memory iSCSI storage for 7000 series AFA 2016-07-12 20:08:43 -07:00
fake_volume.py Tests: lower case all fake uuid constants 2016-05-03 13:36:22 -04:00
policy.json List manageable volumes and snapshots 2016-05-29 11:06:10 +03:00
test_api.py
test_api_urlmap.py Replace use of mox with mock in test_api_urlmap 2016-07-01 17:17:44 +03:00
test_block_device.py Block Device Driver: report pools in volume stats 2016-07-20 14:31:08 +00:00
test_blockbridge.py Tests: Fix mock imports 2016-05-19 14:51:24 -04:00
test_cloudbyte.py Use cinders test class in cloudbyte unit tests 2016-06-17 12:08:38 -06:00
test_cmd.py Refactor sqlalchemy service methods 2016-07-22 15:46:00 +02:00
test_coho.py Fix some typos 2016-07-05 15:11:39 +02:00
test_context.py Use assertEqual/Less/Greater/In/IsNone 2016-07-04 17:58:16 +02:00
test_coordination.py Start/Stop coordinator with Volume service 2016-06-13 16:20:03 -05:00
test_coprhd.py Implementation for CoprHD Cinder Drivers 2016-07-11 15:50:23 +05:30
test_db_api.py Refactor sqlalchemy service methods 2016-07-22 15:46:00 +02:00
test_dellfc.py Updated unit tests to use official unittest methods 2016-06-29 21:49:50 +00:00
test_dellsc.py Dell SC: Added support for failover_host failback 2016-06-01 13:30:17 -05:00
test_dellscapi.py Dell SC: Add secondary DSM support 2016-07-19 10:18:54 -05:00
test_dothill.py Hacking Checks for assertTrue/IsNone() 2015-11-25 11:22:35 -06:00
test_drbdmanagedrv.py Use assertEqual/Less/Greater/In/IsNone 2016-07-04 17:58:16 +02:00
test_emc_vmax.py Merge "EMC VMAX - locking SG for concurrent threads" 2016-07-06 07:38:52 +00:00
test_emc_xtremio.py Replace int with float to bring math.ceil into effect 2016-07-01 11:51:21 +08:00
test_eqlx.py EQLX: Extend of snapshot or clone failure 2016-07-02 14:37:53 -05:00
test_evaluator.py
test_exception.py Change default Exception code to 500 2015-10-13 11:52:47 -04:00
test_falconstor_fss.py FalconStor: New Cinder driver in Newton 2016-07-07 01:10:58 +08:00
test_fixtures.py Copy unit tests for StandardLogging fixture from Nova 2016-03-01 09:44:22 -05:00
test_glusterfs.py Use versionedobjects in remotefs.py 2016-06-15 07:59:30 +00:00
test_gpfs.py Snapshot object has no attribute about size 2016-07-06 14:14:25 +00:00
test_hacking.py Revert "Add hacking check to prevent assert_called_once" 2016-05-24 12:36:22 -04:00
test_hitachi_hbsd_horcm_fc.py Hitachi drivers: resize volume if cloned image is larger 2016-03-17 20:17:37 +01:00
test_hitachi_hbsd_snm2_fc.py Hitachi drivers: resize volume if cloned image is larger 2016-03-17 20:17:37 +01:00
test_hitachi_hbsd_snm2_iscsi.py Hitachi drivers: resize volume if cloned image is larger 2016-03-17 20:17:37 +01:00
test_hitachi_hnas_backend.py Replace manually changing CONF options 2016-05-06 14:19:04 +03:00
test_hitachi_hnas_iscsi.py Use assertEqual/Less/Greater/In/IsNone 2016-07-04 17:58:16 +02:00
test_hitachi_hnas_nfs.py Deprecate nas_ip and change this to nas_host 2016-04-18 15:08:11 +03:00
test_hpe3par.py 3par driver handles concurrent host create conflict 2016-07-14 17:06:24 -07:00
test_hpe_xp_fc.py Merge "Remove duplicated code in volume manager and base driver" 2016-03-03 02:24:24 +00:00
test_hpelefthand.py Merge "Implemented unit test cases for HPE LeftHand driver" 2016-07-07 04:19:50 +00:00
test_huawei_drivers.py Huawei: Support reporting disk type of pool 2016-07-19 14:58:48 +08:00
test_huawei_drivers_compatibility.py Rename Huawei drivers 2015-12-24 09:20:24 +08:00
test_ibm_flashsystem.py ibm flashsystem: Fixing hardcoded attribute 2016-04-22 16:16:55 +00:00
test_ibm_flashsystem_iscsi.py IBM FlashSystem: Add host check for iSCSI driver 2016-06-16 01:52:22 +00:00
test_ibm_xiv_ds8k.py Replace use of mox with mock in test_ibm_xiv_ds8k 2016-06-30 17:29:52 +03:00
test_image_utils.py Image virtual size doesn't fit to volume size 2016-07-11 12:46:09 +03:00
test_infortrend_cli.py Snapshot object has no attribute about size 2016-07-06 14:14:25 +00:00
test_infortrend_common.py Use assertEqual/Less/Greater/In/IsNone 2016-07-04 17:58:16 +02:00
test_lvm_driver.py Replace use of mox with mock in test_lvm_driver 2016-06-29 16:02:36 +03:00
test_migrations.py User messages API for error cases 2016-04-29 18:41:10 +00:00
test_misc.py Remove downgrade migrations 2015-12-18 14:04:16 +02:00
test_netapp.py NetApp: Replace SSC for cDOT block & file drivers 2016-06-20 16:39:37 +00:00
test_netapp_nfs.py NetApp: Support new parameter to cDOT clone API 2016-07-20 18:57:26 +00:00
test_nexenta.py Remove mox usage from test_nexenta 2016-05-25 10:06:52 -05:00
test_nexenta5_iscsi.py NexentaStor drivers: resize volume if cloned image is larger 2016-03-28 11:46:32 -07:00
test_nexenta5_nfs.py Deprecate nas_ip and change this to nas_host 2016-04-18 15:08:11 +03:00
test_nexenta_edge.py Nexenta: Added HA support and enhance get_volume_stats() 2016-07-08 19:53:07 -06:00
test_nexenta_edge_nbd.py Nexenta: Add NBD driver for NexentaEdge. 2016-06-22 12:52:54 -06:00
test_nfs.py Use versionedobjects in remotefs.py 2016-06-15 07:59:30 +00:00
test_nimble.py Merge "Nimble: Don't query all vols from DB in do_setup()" 2016-06-26 19:53:54 +00:00
test_prophetstor_dpl.py Correct iscsi lun type 2016-02-23 23:43:44 +08:00
test_pure.py Fix failure with "None" volume type in Pure drivers 2016-07-08 14:45:14 -07:00
test_qos_specs.py Move QualityOfServiceSpecs to use VersionedObject 2016-07-06 16:37:08 +00:00
test_quobyte.py Use assertEqual/Less/Greater/In/IsNone 2016-07-04 17:58:16 +02:00
test_quota.py Don't apply config fixture to auth_token.CONF 2016-07-11 12:53:34 +10:00
test_quota_utils.py Don't apply config fixture to auth_token.CONF 2016-07-11 12:53:34 +10:00
test_rbd.py Image virtual size doesn't fit to volume size 2016-07-11 12:46:09 +03:00
test_remotefs.py Use versionedobjects in remotefs.py 2016-06-15 07:59:30 +00:00
test_rpc.py Use manifest to backport OVOs during upgrades 2016-06-12 13:49:01 +02:00
test_san.py
test_scality.py Use versionedobjects in remotefs.py 2016-06-15 07:59:30 +00:00
test_service.py Refactor sqlalchemy service methods 2016-07-22 15:46:00 +02:00
test_sheepdog.py Move all backups related unit tests to backup directory 2016-05-26 17:09:33 +03:00
test_smbfs.py Remove mock.patch.stopall call in test_smbfs 2016-06-28 10:43:10 +02:00
test_solidfire.py SolidFire driver should return ceiling of volume size 2016-06-08 09:36:49 +08:00
test_ssh_utils.py Replace mock with self.override_config 2016-06-24 13:42:21 +03:00
test_storwize_svc.py Merge "Storwize: Fix exception ProcessExecutionError" 2016-07-19 18:12:48 +00:00
test_synology_common.py Fix typo in delete snapshot in Synology driver 2016-07-14 19:49:26 +08:00
test_synology_iscsi.py Add Synology DSM storage driver 2016-07-12 15:21:52 +08:00
test_tegile.py Merge "Remove access_mode 'rw' setting in drivers" 2016-02-11 06:14:44 +00:00
test_test.py Updated unit tests to use official unittest methods 2016-06-29 21:49:50 +00:00
test_test_utils.py
test_tintri.py Fix invalid uuids in tintri unit tests 2016-04-22 12:58:30 -04:00
test_utils.py Removed unused code from cinder.utils 2016-07-14 16:20:11 +05:30
test_v7000_common.py Violin Memory iSCSI storage for 7000 series AFA 2016-07-12 20:08:43 -07:00
test_v7000_fcp.py Hacking Checks for assertTrue/IsNone() 2015-11-25 11:22:35 -06:00
test_v7000_iscsi.py Violin Memory iSCSI storage for 7000 series AFA 2016-07-12 20:08:43 -07:00
test_vmware_datastore.py VMware: Reduce volume creation time 2016-04-07 03:51:25 -07:00
test_vmware_vmdk.py Merge "VMware: Refactor vmdk unit tests" 2016-07-17 20:06:27 +00:00
test_vmware_volumeops.py VMware:Persist storage policy ID in vmdk meta-data 2016-06-17 11:52:59 +05:30
test_volume.py Refactor sqlalchemy service methods 2016-07-22 15:46:00 +02:00
test_volume_configuration.py
test_volume_glance_metadata.py Tests: Define fake_constants as constants 2016-04-12 16:56:19 -04:00
test_volume_rpcapi.py Update initialize_connection to use versionedobjects 2016-06-20 17:38:09 -05:00
test_volume_throttling.py Cleanup unused conf variables 2016-02-16 11:26:06 +11:00
test_volume_transfer.py Tests: lower case all fake uuid constants 2016-05-03 13:36:22 -04:00
test_volume_types.py Cleanup volume_type_projects 2016-06-13 13:39:10 +05:30
test_volume_types_extra_specs.py
test_volume_utils.py Improve DB volume check in LVM manage volume 2016-06-21 15:36:12 +02:00
test_vzstorage.py vzstorage: add ploop volume format support 2016-06-15 07:59:30 +00:00
test_xio.py Remove unused logging import and LOG global var 2016-05-20 17:17:38 +08:00
test_zadara.py Add backend driver for Zadara Storage VPSA 2016-07-08 18:30:02 +00:00
test_zfssa.py Volume manage/unmanage support to ZFSSA drivers 2016-02-23 14:38:39 -05:00
test_zte_ks.py Add ZTE Block Storage Driver 2016-07-12 10:10:56 +08:00
utils.py Remove API races from consistency groups 2016-06-01 17:18:06 +02:00