code
stringlengths
3
6.57k
FakeISCSIStorage(configuration = self.configuration)
driver.do_setup()
copy.deepcopy(FakeConnector)
test_terminate_connection_snapshot_success(self, mock_iscsi_term)
mock_iscsi_term.assert_called_with(volume, FakeConnector)
test_terminate_connection_success(self)
self.driver.terminate_connection(self.volume, FakeConnector)
test_get_volume_status(self)
self.driver.get_volume_stats()
self.assertEqual(self.driver.VERSION, data['driver_version'])
mock.patch.object(rest_client.RestClient, 'extend_lun')
test_extend_volume_size_equal(self, mock_extend, mock_lun_info)
self.driver.extend_volume(self.volume, 3)
self.assertEqual(0, mock_extend.call_count)
mock.patch.object(rest_client.RestClient, 'extend_lun')
test_extend_volume_success(self, mock_extend, mock_lun_info)
self.driver.extend_volume(self.volume, 3)
self.assertEqual(1, mock_extend.call_count)
test_extend_volume_fail(self, mock_lun_info)
test_extend_nonexistent_volume(self)
fake_volume.fake_volume_obj(admin_contex)
test_get_admin_metadata(self)
huawei_utils.get_admin_metadata(tmp_volume)
self.assertEqual(expected_value, admin_metadata)
fake_volume.fake_volume_obj(admin_contex)
huawei_utils.get_admin_metadata(tmp_volume)
self.assertEqual(expected_value, admin_metadata)
test_login_fail(self)
test_create_snapshot_fail(self)
test_create_volume_fail(self)
test_delete_volume_fail(self)
self.driver.delete_volume(self.volume)
test_delete_snapshot_fail(self)
self.driver.delete_snapshot(self.snapshot)
test_delete_snapshot_with_snapshot_nonexistent(self)
self.driver.delete_snapshot(self.snapshot)
test_initialize_connection_fail(self)
test_lun_is_associated_to_lungroup(self)
self.driver.client.associate_lun_to_lungroup('11', '11')
self.assertTrue(result)
test_lun_is_not_associated_to_lun_group(self)
self.driver.client.associate_lun_to_lungroup('12', '12')
self.driver.client.remove_lun_from_lungroup('12', '12')
self.driver.client._is_lun_associated_to_lungroup('12', '12')
self.assertFalse(result)
test_get_tgtip(self)
self.driver.client.get_tgt_port_group(self.portgroup)
self.driver.client._get_tgt_ip_from_portgroup(portg_id)
self.assertEqual(self.target_ips, target_ip)
test_find_chap_info(self)
chapinfo.split(';')
self.assertEqual('mm-user', chap_username)
self.assertEqual('mm-user@storage', chap_password)
test_find_alua_info(self)
self.assertEqual('1', type)
test_get_pool_info(self)
self.driver.client.get_pool_info(pool_name, pools)
self.assertEqual(test_info, pool_info)
self.driver.client.get_pool_info(pool_name, pools)
self.assertEqual(test_info, pool_info)
self.driver.client.get_pool_info(pool_name, pools)
self.assertEqual(test_info, pool_info)
self.driver.client.get_pool_info(pool_name, pools)
self.assertEqual(test_info, pool_info)
test_get_smartx_specs_opts(self)
smartx.SmartX()
get_smartx_specs_opts(smarttier_opts)
self.assertEqual('3', smartx_opts['policy'])
ddt.data(FAKE_POOLS_UNSUPPORT_REPORT, FAKE_POOLS_SUPPORT_REPORT)
test_create_smartqos(self, mock_qos_value, pool_data)
self.driver.create_volume(self.volume)
self.assertEqual('1', lun_info['provider_location'])
self.driver.create_volume(self.volume)
self.assertEqual('1', lun_info['provider_location'])
test_create_smartqos_failed(self, qos_specs_value, pool_data)
ddt.data(FAKE_POOLS_UNSUPPORT_REPORT, FAKE_POOLS_SUPPORT_REPORT)
test_create_smartqos_without_huawei_type(self, pool_data)
self.driver.create_volume(self.volume)
self.assertEqual('1', lun_info['provider_location'])
self.driver.create_volume(self.volume)
self.assertEqual('1', lun_info['provider_location'])
ddt.data(FAKE_POOLS_UNSUPPORT_REPORT, FAKE_POOLS_SUPPORT_REPORT)
mock.patch.object(rest_client.RestClient, 'activate_deactivate_qos')
ddt.data(FAKE_POOLS_UNSUPPORT_REPORT, FAKE_POOLS_SUPPORT_REPORT)
mock.patch.object(rest_client.RestClient, 'create_qos_policy')
ddt.data(FAKE_POOLS_UNSUPPORT_REPORT, FAKE_POOLS_SUPPORT_REPORT)
test_delete_smartqos_with_lun_left(self, mock_qos_info, pool_data)
self.driver.delete_volume(self.volume)
ddt.data(FAKE_POOLS_UNSUPPORT_REPORT, FAKE_POOLS_SUPPORT_REPORT)
test_delete_smartqos_with_no_lun_left(self, mock_qos_info, pool_data)
self.driver.delete_volume(self.volume)
mock.patch.object(rest_client.RestClient, 'add_lun_to_partition')
test_create_smartx(self, mock_volume_types, mock_add_lun_to_partition)
self.driver.create_volume(self.volume)
self.assertEqual('1', lun_info['provider_location'])
test_create_smartCache_failed(self, opts, pool_data)
ddt.data(FAKE_POOLS_UNSUPPORT_REPORT, FAKE_POOLS_SUPPORT_REPORT)
ddt.data(FAKE_POOLS_UNSUPPORT_REPORT, FAKE_POOLS_SUPPORT_REPORT)
test_find_available_qos(self)
self.driver.client.find_available_qos(qos)