code
stringlengths
3
6.57k
FCSanLookupService()
array. (tgt_wwns, portg_id, init_targ_map)
self.assertEqual(expected_wwns, tgt_wwns)
self.assertEqual(expected_map, init_targ_map)
self.assertEqual(1, delete.call_count)
test_get_init_targ_map(self)
FCSanLookupService()
self.assertEqual(expected_wwns, tgt_wwns)
self.assertEqual(expected_map, init_targ_map)
test_get_init_targ_map_no_host(self)
FCSanLookupService()
self.assertEqual(expected_ret, ret)
test_multi_resturls_success(self)
self.driver.create_volume(self.volume)
self.assertEqual('1', lun_info['provider_location'])
test_get_id_from_result(self)
self.driver.client._get_id_from_result(result, name, key)
self.assertIsNone(re)
self.driver.client._get_id_from_result(result, name, key)
self.assertIsNone(re)
self.driver.client._get_id_from_result(result, name, key)
self.assertIsNone(re)
self.driver.client._get_id_from_result(result, name, key)
self.assertIsNone(re)
self.driver.client._get_id_from_result(result, name, key)
self.assertEqual('1', re)
test_get_capacity(self, mock_get_pool_info)
self.assertEqual(expected_pool_capacity, pool_capacity)
self.driver.create_volume(self.hyper_volume)
self.assertEqual(metadata, lun_info['metadata'])
ddt.data(FAKE_POOLS_UNSUPPORT_REPORT, FAKE_POOLS_SUPPORT_REPORT)
mock.patch.object(rest_client.RestClient, 'create_hypermetro')
exception.VolumeBackendAPIException(data='Error occurred.')
test_hypermetro_connection_success_2(self, mock_map, mock_metadata)
self.assertEqual(1, fc_properties['data']['target_lun'])
test_terminate_hypermetro_connection_success(self, mock_metradata)
self.driver.metro.disconnect_volume_fc(self.volume, FakeConnector)
test_hypermetroid_none_fail(self, mock_metadata, moke_metro_name)
unittest.skip("Skip until bug #1578986 is fixed")
test_wait_volume_ready_success(self)
self.driver.metro._wait_volume_ready("11")
self.assertIsNone(flag)
test_create_snapshot_fail_hypermetro(self)
test_create_snapshot_fail_no_snapshot_id(self)
test_get_online_free_wwns(self, mock_call)
self.driver.client.get_online_free_wwns()
self.assertEqual(['1'], wwns)
test_rename_lun(self, mock_call)
self.driver.client.rename_lun('1', new_name, des)
self.assertEqual(1, mock_call.call_count)
mock_call.assert_called_once_with(url, data, "PUT")
test_is_host_associated_to_hostgroup_no_data(self, mock_call)
self.driver.client.is_host_associated_to_hostgroup('1')
self.assertFalse(res)
test_is_host_associated_to_hostgroup_true(self, mock_call)
self.driver.client.is_host_associated_to_hostgroup('1')
self.assertTrue(res)
test_is_host_associated_to_hostgroup_false(self, mock_call)
self.driver.client.is_host_associated_to_hostgroup('1')
self.assertFalse(res)
test_create_hypermetro_consistencygroup_success(self, mock_grouptype)
context.get_admin_context()
self.driver.create_consistencygroup(ctxt, self.cg)
context.get_admin_context()
self.driver.create_consistencygroup(ctxt, self.cg)
test_delete_hypermetro_consistencygroup_success(self, mock_grouptype)
context.get_admin_context()
test_delete_normal_consistencygroup_success(self)
context.get_admin_context()
context.get_admin_context()
test_create_hypermetro_consistencygroup_success_2(self)
context.get_admin_context()
copy.deepcopy(self.cg)
self.driver.create_consistencygroup(ctxt, temp_cg)
test_is_initiator_associated_to_host_raise(self)
test_is_initiator_associated_to_host_true(self)
self.driver.client.is_initiator_associated_to_host('ini-1', '1')
self.assertFalse(ret)
self.driver.client.is_initiator_associated_to_host('ini-2', '2')
self.assertTrue(ret)
HuaweiConfTestCase(test.TestCase)
setUp(self)
super(HuaweiConfTestCase, self)
setUp()
tempfile.mkdtemp()
mock.Mock()
huawei_conf.HuaweiConf(self.conf)
_create_fake_conf_file(self)
minidom.Document()
doc.createElement('config')
doc.appendChild(config)
doc.createElement('Storage')
config.appendChild(storage)
doc.createElement('RestURL')
url.appendChild(url_text)
storage.appendChild(url)
doc.createElement('UserName')
doc.createTextNode('admin')
username.appendChild(username_text)
storage.appendChild(username)