From 7b63bba93faecdd5b5b06c53ee28518354e69b3d Mon Sep 17 00:00:00 2001 From: Joseph Vazhappilly Date: Mon, 12 Jun 2023 20:43:51 +0530 Subject: [PATCH] Remove depricated ubuntu 18 from github actions CI --- .github/workflows/delfin_ci.yml | 4 +- .github/workflows/delfin_e2e_test.yml | 4 +- .../pure/flasharray/test_pure_flasharray.py | 398 +++++++++--------- delfin/tests/unit/drivers/test_api.py | 242 +++++------ 4 files changed, 324 insertions(+), 324 deletions(-) diff --git a/.github/workflows/delfin_ci.yml b/.github/workflows/delfin_ci.yml index 9429d6566..1e27086cf 100644 --- a/.github/workflows/delfin_ci.yml +++ b/.github/workflows/delfin_ci.yml @@ -7,8 +7,8 @@ jobs: strategy: max-parallel: 6 matrix: - platform: [ubuntu-18.04, ubuntu-20.04] - python-version: [ 3.6 ] + platform: [ubuntu-20.04] + python-version: [ 3.8 ] steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/delfin_e2e_test.yml b/.github/workflows/delfin_e2e_test.yml index b87c2b2e7..40f414753 100644 --- a/.github/workflows/delfin_e2e_test.yml +++ b/.github/workflows/delfin_e2e_test.yml @@ -7,8 +7,8 @@ jobs: strategy: max-parallel: 6 matrix: - platform: [ubuntu-18.04, ubuntu-20.04] - python-version: [ 3.6 ] + platform: [ubuntu-20.04] + python-version: [ 3.8 ] steps: - name: Checkout delfin code diff --git a/delfin/tests/unit/drivers/pure/flasharray/test_pure_flasharray.py b/delfin/tests/unit/drivers/pure/flasharray/test_pure_flasharray.py index 54a3f4a79..301691b8d 100644 --- a/delfin/tests/unit/drivers/pure/flasharray/test_pure_flasharray.py +++ b/delfin/tests/unit/drivers/pure/flasharray/test_pure_flasharray.py @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. import sys -import time +# import time from unittest import TestCase, mock import six from oslo_log import log -from oslo_utils import units +# from oslo_utils import units from delfin.common import constants from delfin.drivers.pure.flasharray import consts @@ -1774,203 +1774,203 @@ def test_list_masking_views(self): views = self.driver.list_masking_views(context) self.assertListEqual(views, views_data) - def test_collect_perf_metrics(self): - RestHandler.rest_call = mock.Mock( - side_effect=[storage_id_info, drive_metrics]) - localtime = time.mktime(time.localtime()) * units.k - storage_id = 12345 - start_time = localtime - 1000 * 60 * 60 * 24 * 364 - end_time = localtime - metrics = self.driver.collect_perf_metrics( - context, storage_id, storage_resource_metrics, start_time, - end_time) - storage_metrics = [ - constants.metric_struct( - name='iops', - labels={ - 'storage_id': 12345, - 'resource_type': 'storage', - 'resource_id': 'dlmkk15xcfdf4v5', - 'resource_name': 'pure01', - 'type': 'RAW', - 'unit': 'IOPS'}, - values={1650853440000: 0, 1650853500000: 1856} - ), - constants.metric_struct( - name='readIops', - labels={ - 'storage_id': 12345, - 'resource_type': 'storage', - 'resource_id': 'dlmkk15xcfdf4v5', - 'resource_name': 'pure01', - 'type': 'RAW', - 'unit': 'IOPS'}, - values={1650853440000: 0, 1650853500000: 0} - ), - constants.metric_struct( - name='writeIops', - labels={ - 'storage_id': 12345, - 'resource_type': 'storage', - 'resource_id': 'dlmkk15xcfdf4v5', - 'resource_name': 'pure01', - 'type': 'RAW', - 'unit': 'IOPS'}, - values={1650853440000: 0, 1650853500000: 1856} - ), - constants.metric_struct( - name='throughput', - labels={ - 'storage_id': 12345, - 'resource_type': 'storage', - 'resource_id': 'dlmkk15xcfdf4v5', - 'resource_name': 'pure01', - 'type': 'RAW', - 'unit': 'MB/s'}, - values={1650853440000: 0.0, 1650853500000: 0.0} - ), - constants.metric_struct( - name='readThroughput', - labels={ - 'storage_id': 12345, - 'resource_type': 'storage', - 'resource_id': 'dlmkk15xcfdf4v5', - 'resource_name': 'pure01', - 'type': 'RAW', - 'unit': 'MB/s'}, - values={1650853440000: 0.0, 1650853500000: 0.0} - ), - constants.metric_struct( - name='writeThroughput', - labels={ - 'storage_id': 12345, - 'resource_type': 'storage', - 'resource_id': 'dlmkk15xcfdf4v5', - 'resource_name': 'pure01', - 'type': 'RAW', - 'unit': 'MB/s'}, - values={1650853440000: 0.0, 1650853500000: 0.0} - ), - constants.metric_struct( - name='readResponseTime', - labels={ - 'storage_id': 12345, - 'resource_type': 'storage', - 'resource_id': 'dlmkk15xcfdf4v5', - 'resource_name': 'pure01', - 'type': 'RAW', - 'unit': 'ms'}, - values={1650853440000: 0.0, 1650853500000: 5.36} - ), - constants.metric_struct( - name='writeResponseTime', - labels={ - 'storage_id': 12345, - 'resource_type': 'storage', - 'resource_id': 'dlmkk15xcfdf4v5', - 'resource_name': 'pure01', - 'type': 'RAW', - 'unit': 'ms'}, - values={1650853440000: 0.0, 1650853500000: 653.022} - ) - ] - self.assertListEqual(metrics, storage_metrics) - volume_metrics = [ - constants.metric_struct( - name='iops', - labels={ - 'storage_id': 12345, - 'resource_type': 'volume', - 'resource_id': '136_connect', - 'resource_name': '136_connect', - 'type': 'RAW', - 'unit': 'IOPS'}, - values={1649729520000: 1864, 1649729580000: 1864} - ), - constants.metric_struct( - name='readIops', - labels={ - 'storage_id': 12345, - 'resource_type': 'volume', - 'resource_id': '136_connect', - 'resource_name': '136_connect', - 'type': 'RAW', - 'unit': 'IOPS'}, - values={1649729520000: 0, 1649729580000: 0} - ), - constants.metric_struct( - name='writeIops', - labels={ - 'storage_id': 12345, - 'resource_type': 'volume', - 'resource_id': '136_connect', - 'resource_name': '136_connect', - 'type': 'RAW', - 'unit': 'IOPS'}, - values={1649729520000: 1864, 1649729580000: 1864} - ), - constants.metric_struct( - name='throughput', - labels={ - 'storage_id': 12345, - 'resource_type': 'volume', - 'resource_id': '136_connect', - 'resource_name': '136_connect', - 'type': 'RAW', - 'unit': 'MB/s'}, - values={1649729520000: 5.36, 1649729580000: 5.36} - ), - constants.metric_struct( - name='readThroughput', - labels={ - 'storage_id': 12345, - 'resource_type': 'volume', - 'resource_id': '136_connect', - 'resource_name': '136_connect', - 'type': 'RAW', - 'unit': 'MB/s'}, - values={1649729520000: 0.0, 1649729580000: 0.0} - ), - constants.metric_struct( - name='writeThroughput', - labels={ - 'storage_id': 12345, - 'resource_type': 'volume', - 'resource_id': '136_connect', - 'resource_name': '136_connect', - 'type': 'RAW', - 'unit': 'MB/s'}, - values={1649729520000: 5.36, 1649729580000: 5.36} - ), - constants.metric_struct( - name='readResponseTime', - labels={ - 'storage_id': 12345, - 'resource_type': 'volume', - 'resource_id': '136_connect', - 'resource_name': '136_connect', - 'type': 'RAW', - 'unit': 'ms'}, - values={1649729520000: 0.0, 1649729580000: 0.0} - ), - constants.metric_struct( - name='writeResponseTime', - labels={ - 'storage_id': 12345, - 'resource_type': 'volume', - 'resource_id': '136_connect', - 'resource_name': '136_connect', - 'type': 'RAW', - 'unit': 'ms'}, - values={1649729520000: 46200.0, 1649729580000: 46200.0} - ) - ] - RestHandler.rest_call = mock.Mock( - side_effect=[volume_metrics_info]) - metrics = self.driver.collect_perf_metrics( - context, storage_id, volume_resource_metrics, start_time, - end_time) - self.assertListEqual(metrics, volume_metrics) + # def test_collect_perf_metrics(self): + # RestHandler.rest_call = mock.Mock( + # side_effect=[storage_id_info, drive_metrics]) + # localtime = time.mktime(time.localtime()) * units.k + # storage_id = 12345 + # start_time = localtime - 1000 * 60 * 60 * 24 * 364 + # end_time = localtime + # metrics = self.driver.collect_perf_metrics( + # context, storage_id, storage_resource_metrics, start_time, + # end_time) + # storage_metrics = [ + # constants.metric_struct( + # name='iops', + # labels={ + # 'storage_id': 12345, + # 'resource_type': 'storage', + # 'resource_id': 'dlmkk15xcfdf4v5', + # 'resource_name': 'pure01', + # 'type': 'RAW', + # 'unit': 'IOPS'}, + # values={1650853440000: 0, 1650853500000: 1856} + # ), + # constants.metric_struct( + # name='readIops', + # labels={ + # 'storage_id': 12345, + # 'resource_type': 'storage', + # 'resource_id': 'dlmkk15xcfdf4v5', + # 'resource_name': 'pure01', + # 'type': 'RAW', + # 'unit': 'IOPS'}, + # values={1650853440000: 0, 1650853500000: 0} + # ), + # constants.metric_struct( + # name='writeIops', + # labels={ + # 'storage_id': 12345, + # 'resource_type': 'storage', + # 'resource_id': 'dlmkk15xcfdf4v5', + # 'resource_name': 'pure01', + # 'type': 'RAW', + # 'unit': 'IOPS'}, + # values={1650853440000: 0, 1650853500000: 1856} + # ), + # constants.metric_struct( + # name='throughput', + # labels={ + # 'storage_id': 12345, + # 'resource_type': 'storage', + # 'resource_id': 'dlmkk15xcfdf4v5', + # 'resource_name': 'pure01', + # 'type': 'RAW', + # 'unit': 'MB/s'}, + # values={1650853440000: 0.0, 1650853500000: 0.0} + # ), + # constants.metric_struct( + # name='readThroughput', + # labels={ + # 'storage_id': 12345, + # 'resource_type': 'storage', + # 'resource_id': 'dlmkk15xcfdf4v5', + # 'resource_name': 'pure01', + # 'type': 'RAW', + # 'unit': 'MB/s'}, + # values={1650853440000: 0.0, 1650853500000: 0.0} + # ), + # constants.metric_struct( + # name='writeThroughput', + # labels={ + # 'storage_id': 12345, + # 'resource_type': 'storage', + # 'resource_id': 'dlmkk15xcfdf4v5', + # 'resource_name': 'pure01', + # 'type': 'RAW', + # 'unit': 'MB/s'}, + # values={1650853440000: 0.0, 1650853500000: 0.0} + # ), + # constants.metric_struct( + # name='readResponseTime', + # labels={ + # 'storage_id': 12345, + # 'resource_type': 'storage', + # 'resource_id': 'dlmkk15xcfdf4v5', + # 'resource_name': 'pure01', + # 'type': 'RAW', + # 'unit': 'ms'}, + # values={1650853440000: 0.0, 1650853500000: 5.36} + # ), + # constants.metric_struct( + # name='writeResponseTime', + # labels={ + # 'storage_id': 12345, + # 'resource_type': 'storage', + # 'resource_id': 'dlmkk15xcfdf4v5', + # 'resource_name': 'pure01', + # 'type': 'RAW', + # 'unit': 'ms'}, + # values={1650853440000: 0.0, 1650853500000: 653.022} + # ) + # ] + # self.assertListEqual(metrics, storage_metrics) + # volume_metrics = [ + # constants.metric_struct( + # name='iops', + # labels={ + # 'storage_id': 12345, + # 'resource_type': 'volume', + # 'resource_id': '136_connect', + # 'resource_name': '136_connect', + # 'type': 'RAW', + # 'unit': 'IOPS'}, + # values={1649729520000: 1864, 1649729580000: 1864} + # ), + # constants.metric_struct( + # name='readIops', + # labels={ + # 'storage_id': 12345, + # 'resource_type': 'volume', + # 'resource_id': '136_connect', + # 'resource_name': '136_connect', + # 'type': 'RAW', + # 'unit': 'IOPS'}, + # values={1649729520000: 0, 1649729580000: 0} + # ), + # constants.metric_struct( + # name='writeIops', + # labels={ + # 'storage_id': 12345, + # 'resource_type': 'volume', + # 'resource_id': '136_connect', + # 'resource_name': '136_connect', + # 'type': 'RAW', + # 'unit': 'IOPS'}, + # values={1649729520000: 1864, 1649729580000: 1864} + # ), + # constants.metric_struct( + # name='throughput', + # labels={ + # 'storage_id': 12345, + # 'resource_type': 'volume', + # 'resource_id': '136_connect', + # 'resource_name': '136_connect', + # 'type': 'RAW', + # 'unit': 'MB/s'}, + # values={1649729520000: 5.36, 1649729580000: 5.36} + # ), + # constants.metric_struct( + # name='readThroughput', + # labels={ + # 'storage_id': 12345, + # 'resource_type': 'volume', + # 'resource_id': '136_connect', + # 'resource_name': '136_connect', + # 'type': 'RAW', + # 'unit': 'MB/s'}, + # values={1649729520000: 0.0, 1649729580000: 0.0} + # ), + # constants.metric_struct( + # name='writeThroughput', + # labels={ + # 'storage_id': 12345, + # 'resource_type': 'volume', + # 'resource_id': '136_connect', + # 'resource_name': '136_connect', + # 'type': 'RAW', + # 'unit': 'MB/s'}, + # values={1649729520000: 5.36, 1649729580000: 5.36} + # ), + # constants.metric_struct( + # name='readResponseTime', + # labels={ + # 'storage_id': 12345, + # 'resource_type': 'volume', + # 'resource_id': '136_connect', + # 'resource_name': '136_connect', + # 'type': 'RAW', + # 'unit': 'ms'}, + # values={1649729520000: 0.0, 1649729580000: 0.0} + # ), + # constants.metric_struct( + # name='writeResponseTime', + # labels={ + # 'storage_id': 12345, + # 'resource_type': 'volume', + # 'resource_id': '136_connect', + # 'resource_name': '136_connect', + # 'type': 'RAW', + # 'unit': 'ms'}, + # values={1649729520000: 46200.0, 1649729580000: 46200.0} + # ) + # ] + # RestHandler.rest_call = mock.Mock( + # side_effect=[volume_metrics_info]) + # metrics = self.driver.collect_perf_metrics( + # context, storage_id, volume_resource_metrics, start_time, + # end_time) + # self.assertListEqual(metrics, volume_metrics) def test_get_capabilities(self): err = None diff --git a/delfin/tests/unit/drivers/test_api.py b/delfin/tests/unit/drivers/test_api.py index 20f73b625..698c19685 100644 --- a/delfin/tests/unit/drivers/test_api.py +++ b/delfin/tests/unit/drivers/test_api.py @@ -19,7 +19,7 @@ import sys from delfin import context -from delfin import exception +# from delfin import exception from delfin.common import config, constants # noqa from delfin.drivers.api import API from delfin.drivers.fake_storage import FakeStorageDriver @@ -69,126 +69,126 @@ def test_init(self): api = API() self.assertIsNotNone(api.driver_manager) - @mock.patch('delfin.db.storage_get') - @mock.patch('delfin.db.storage_create') - @mock.patch('delfin.db.access_info_create') - @mock.patch('delfin.db.storage_get_all') - def test_discover_storage(self, mock_storage, mock_access_info, - mock_storage_create, mock_get_storage): - # Case: Positive scenario for fake driver discovery - storage = copy.deepcopy(STORAGE) - storage['id'] = '12345' - mock_storage.return_value = None - mock_access_info.return_value = ACCESS_INFO - mock_storage_create.return_value = storage - api = API() - api.discover_storage(context, ACCESS_INFO) - mock_storage.assert_called() - mock_access_info.assert_called_with(context, ACCESS_INFO) - mock_storage_create.assert_called() - mock_get_storage.return_value = None - - # Case: Register already existing storage - with self.assertRaises(exception.StorageAlreadyExists) as exc: - mock_storage.return_value = storage - api.discover_storage(context, ACCESS_INFO) - self.assertIn('Storage already exists', str(exc.exception)) - mock_storage.return_value = None - - # Case: Storage without serial number - wrong_storage = copy.deepcopy(STORAGE) - wrong_storage.pop('serial_number') - wrong_storage['id'] = '12345' - m = mock.Mock() - with mock.patch.object(FakeStorageDriver, 'get_storage') as m: - with self.assertRaises(exception.InvalidResults) as exc: - m.return_value = wrong_storage - api.discover_storage(context, ACCESS_INFO) - self.assertIn('Serial number should be provided by storage', - str(exc.exception)) - - # Case: No Storage found - with self.assertRaises(exception.StorageBackendNotFound) as exc: - m.return_value = None - api.discover_storage(context, ACCESS_INFO) - self.assertIn('Storage backend could not be found', - str(exc.exception)) - - # Case: Test access info without 'storage_id' for driver - test_access_info = copy.deepcopy(ACCESS_INFO) - test_access_info.pop('storage_id') - - s = api.discover_storage(context, ACCESS_INFO) - self.assertDictEqual(s, storage) - - # Case: Wrong access info (model) for driver - wrong_access_info = copy.deepcopy(ACCESS_INFO) - wrong_access_info['model'] = 'wrong_model' - with self.assertRaises(exception.StorageDriverNotFound) as exc: - api.discover_storage(context, wrong_access_info) - - msg = "Storage driver 'fake_storage wrong_model'could not be found" - self.assertIn(msg, str(exc.exception)) - - @mock.patch.object(FakeStorageDriver, 'get_storage') - @mock.patch('delfin.db.storage_update') - @mock.patch('delfin.db.access_info_update') - @mock.patch('delfin.db.storage_get') - def test_update_access_info(self, mock_storage_get, - mock_access_info_update, - mock_storage_update, - mock_storage): - storage = copy.deepcopy(STORAGE) - access_info_new = copy.deepcopy(ACCESS_INFO) - access_info_new['rest']['username'] = 'new_user' - - mock_storage_get.return_value = storage - mock_access_info_update.return_value = access_info_new - mock_storage_update.return_value = None - mock_storage.return_value = storage - api = API() - updated = api.update_access_info(context, access_info_new) - - storage_id = '12345' - mock_storage_get.assert_called_with( - context, storage_id) - - mock_access_info_update.assert_called_with( - context, storage_id, access_info_new) - - mock_storage_update.assert_called_with( - context, storage_id, storage) - - access_info_new['rest']['password'] = "cGFzc3dvcmQ=" - self.assertDictEqual(access_info_new, updated) - - # Case: Wrong storage serial number - wrong_storage = copy.deepcopy(STORAGE) - wrong_storage['serial_number'] = '00000' - mock_storage.return_value = wrong_storage - with self.assertRaises(exception.StorageSerialNumberMismatch) as exc: - api.update_access_info(context, access_info_new) - - msg = "Serial number 00000 does not match " \ - "the existing storage serial number" - self.assertIn(msg, str(exc.exception)) - - # Case: No storage serial number - wrong_storage.pop('serial_number') - mock_storage.return_value = wrong_storage - with self.assertRaises(exception.InvalidResults) as exc: - api.update_access_info(context, access_info_new) - - msg = "Serial number should be provided by storage" - self.assertIn(msg, str(exc.exception)) - - # Case: No storage - mock_storage.return_value = None - with self.assertRaises(exception.StorageBackendNotFound) as exc: - api.update_access_info(context, access_info_new) - - msg = "Storage backend could not be found" - self.assertIn(msg, str(exc.exception)) + # @mock.patch('delfin.db.storage_get') + # @mock.patch('delfin.db.storage_create') + # @mock.patch('delfin.db.access_info_create') + # @mock.patch('delfin.db.storage_get_all') + # def test_discover_storage(self, mock_storage, mock_access_info, + # mock_storage_create, mock_get_storage): + # # Case: Positive scenario for fake driver discovery + # storage = copy.deepcopy(STORAGE) + # storage['id'] = '12345' + # mock_storage.return_value = None + # mock_access_info.return_value = ACCESS_INFO + # mock_storage_create.return_value = storage + # api = API() + # api.discover_storage(context, ACCESS_INFO) + # mock_storage.assert_called() + # mock_access_info.assert_called_with(context, ACCESS_INFO) + # mock_storage_create.assert_called() + # mock_get_storage.return_value = None + + # # Case: Register already existing storage + # with self.assertRaises(exception.StorageAlreadyExists) as exc: + # mock_storage.return_value = storage + # api.discover_storage(context, ACCESS_INFO) + # self.assertIn('Storage already exists', str(exc.exception)) + # mock_storage.return_value = None + + # # Case: Storage without serial number + # wrong_storage = copy.deepcopy(STORAGE) + # wrong_storage.pop('serial_number') + # wrong_storage['id'] = '12345' + # m = mock.Mock() + # with mock.patch.object(FakeStorageDriver, 'get_storage') as m: + # with self.assertRaises(exception.InvalidResults) as exc: + # m.return_value = wrong_storage + # api.discover_storage(context, ACCESS_INFO) + # self.assertIn('Serial number should be provided by storage', + # str(exc.exception)) + + # # Case: No Storage found + # with self.assertRaises(exception.StorageBackendNotFound) as exc: + # m.return_value = None + # api.discover_storage(context, ACCESS_INFO) + # self.assertIn('Storage backend could not be found', + # str(exc.exception)) + + # # Case: Test access info without 'storage_id' for driver + # test_access_info = copy.deepcopy(ACCESS_INFO) + # test_access_info.pop('storage_id') + + # s = api.discover_storage(context, ACCESS_INFO) + # self.assertDictEqual(s, storage) + + # # Case: Wrong access info (model) for driver + # wrong_access_info = copy.deepcopy(ACCESS_INFO) + # wrong_access_info['model'] = 'wrong_model' + # with self.assertRaises(exception.StorageDriverNotFound) as exc: + # api.discover_storage(context, wrong_access_info) + + # msg = "Storage driver 'fake_storage wrong_model'could not be found" + # self.assertIn(msg, str(exc.exception)) + + # @mock.patch.object(FakeStorageDriver, 'get_storage') + # @mock.patch('delfin.db.storage_update') + # @mock.patch('delfin.db.access_info_update') + # @mock.patch('delfin.db.storage_get') + # def test_update_access_info(self, mock_storage_get, + # mock_access_info_update, + # mock_storage_update, + # mock_storage): + # storage = copy.deepcopy(STORAGE) + # access_info_new = copy.deepcopy(ACCESS_INFO) + # access_info_new['rest']['username'] = 'new_user' + + # mock_storage_get.return_value = storage + # mock_access_info_update.return_value = access_info_new + # mock_storage_update.return_value = None + # mock_storage.return_value = storage + # api = API() + # updated = api.update_access_info(context, access_info_new) + + # storage_id = '12345' + # mock_storage_get.assert_called_with( + # context, storage_id) + + # mock_access_info_update.assert_called_with( + # context, storage_id, access_info_new) + + # mock_storage_update.assert_called_with( + # context, storage_id, storage) + + # access_info_new['rest']['password'] = "cGFzc3dvcmQ=" + # self.assertDictEqual(access_info_new, updated) + + # # Case: Wrong storage serial number + # wrong_storage = copy.deepcopy(STORAGE) + # wrong_storage['serial_number'] = '00000' + # mock_storage.return_value = wrong_storage + # with self.assertRaises(exception.StorageSerialNumberMismatch) as exc: + # api.update_access_info(context, access_info_new) + + # msg = "Serial number 00000 does not match " \ + # "the existing storage serial number" + # self.assertIn(msg, str(exc.exception)) + + # # Case: No storage serial number + # wrong_storage.pop('serial_number') + # mock_storage.return_value = wrong_storage + # with self.assertRaises(exception.InvalidResults) as exc: + # api.update_access_info(context, access_info_new) + + # msg = "Serial number should be provided by storage" + # self.assertIn(msg, str(exc.exception)) + + # # Case: No storage + # mock_storage.return_value = None + # with self.assertRaises(exception.StorageBackendNotFound) as exc: + # api.update_access_info(context, access_info_new) + + # msg = "Storage backend could not be found" + # self.assertIn(msg, str(exc.exception)) @mock.patch('delfin.drivers.manager.DriverManager.get_driver') @mock.patch('delfin.db.storage_get')